I have a scene where different popups can layer on top of the main scene. Right now when a new popup is shown, im leaving it deactivated, activating everything underneath, taking a render texture capture and then turning off everything but the top one and putting the captured image below it. Using a shader on the texture I darken it.
This all works great except there is flicker because I am turning on the layers to draw them. I used WaitUntilEndOfFrame because if I didn’t I got broken results.
What I would like is a way to avoid the WaitUntilEndOfFrame so I can activate things, force a full new screen draw to happen(blocking execution until it finished), save it to the render texture and then hide them again such that the user will not see any of this.
Note I am using camera.render to draw, this is what doesn’t work well without the wait until end of frame, but then causes the changes to be visible to the user.