Some more info … The Canvas is set to “Screen Space - Camera”
The camera is orthographic, and is showing the GUI in the editor and game view.
cam.redner() renders the skybox or solid color to the renderTexture, but not the GUI.
Does anyone have any idea? or should I file a bug?
As much as it saddens me to say this it’s likely a bug and you should file one. i’m going to guess that maybe it won’t get fixed for v1 but hopefully soon after
This can probably be worked around by using a screen space - camera UI and setting it to render from your specific camera (set to orthographic mode). The ‘overlay’ mode doesn’t go through the normal render pipeline so it’s not injected into a normal camera render.
Can you actually make the overlay UI “go through a normal render pipeline”?
Is it possible to capture the UI somehow in a render texture and blit it to the scene behind? A feature like this would be great to enable post processing effects on a canvas.
Are we stuck using Screen Space - Camera UI in this case?
I already did that succesfully. but not with manual rendering though. If the canvas is set to Screen Space - Camera and the Camera has a render texture assigned, this works quite well for me. Not sure what you want to achieve by manual rendering though, thats something I didn’t test for the UI yet.
In my case, i need to render the canvas into one texture immediately. And then i don’t need this canvas anymore. It will be perfect if i can keep this canvas as prefabs in asset folder instead of the scene.
What i do now is that: I copy this prefabs into scene and create a camera with rendertexture. I call ResetAspect() ResetProjectionMatrix() Render(). And then delete the canvas and the camera. It doesn’t work quite well the size of the canvas is wrong. If i let those objects stay, then they can render a correct image in next frame.
Same problem… Unity5, trying to get some nice screenshots from a button press during gameplay… I have a single camera with canvas, screen space overlay gui, but the gui does not show up on the Camera.Render()
(also tried world-space and screen-space-camera) all with the same result… no gui rendered.
Any update to this problem ? bug ?