help I am trying to get the players viewport as a texture 2d

One example with a material and a widget in front of it
One example with a material where the widget gets rendered into the material

RetainerBox did not work as I expected.