They inspected flowers and balloons before a walkabout at the venue on Saturday.
A royal source said the Prince of Wales asked his brother and his wife to join them in viewing the tributes.
The source said: “The Prince of Wales invited the Duke and Duchess to join him
and the Princes of Wales earlier.”
The last time William was joined in public by his brother at Windsor Castle was at the funeral of the Duke of Edinburgh in April last year.
Both couples left in the same vehicle as the engagement, which lasted more than 40 minutes, came to a close.
All four were dressed in black as they walked along the gates of the castle.
At one point during the walkabout, Meghan was seen being given a close hug by a young girl in the crowd.
The duke and duchess held hands as they looked at the tributes, with Harry at one point affectionately putting his hand on Meghan’s back.
Each member of the royal family was seen pointing at different tributes and discussing them amongst each other as members of the crowd waved at them.
William and Kate and Harry and Meghan then greeted well-wishers at Windsor Castle with a number holding up mobile phones to take a photo of the royals.
A crowd at the castle broke out into applause as the couples approached members of the public and spoke to them.
William was seen speaking intently to a member of the crowd, at one moment shaking a woman’s hand. Both William and Kate could be seen thanking people.
Kate crouched down at one moment and began speaking to a child who had started to cry.
The child stopped crying when Kate approached her.
Meghan was also seen shaking the hands of several children and well-wishers at Windsor.
She walked over to a section of the crowd and approached a teenager, who was seen putting her hand over her mouth in shock.
The duchess and her husband spoke briefly for a few moments and Meghan could be seen assuring a young girl by putting her hand on her shoulder.
The girl then said: “Can I have a hug?” and Meghan was seen nodding, before leaning in and giving her a big hug.
The touching moment was filmed by other members in the crowd.
The duke and duchess were handed bunches of flowers which they both accepted.
William and Kate were also given bunches of flowers by members of the crowd as one visitor waved a Welsh flag in the background.
At one moment, a small Paddington Bear was given to William, which he passed on to an aide.
He was seen lightly touching Kate’s back at one moment as she crouched down again to speak to a child at the front of the gates.
The crowd was heard chatting excitedly and taking photographs as William and Kate and the Duke and Duchess of Sussex stopped to speak to each person at the front of the barriers.
The royal couples walked along separately from one another, with William and Kate speaking to people on one side of the road and Harry and Meghan speaking to people on the other side of the road.