- Home /
TargetTexture and Render to the screen
Hi.
I am trying to do some optimization in my project, and found such problem. I have 2 Cameras with absolutely the same configuration (fieldOfView, position, rotation e.t.c). The only difference, is that first Camera used targetTexture (which used as texture for material on plane), and the other used Depth and render to the screen. But they are rendering absolutely the same frame, with absolutely the same culling and so on. And it is too expensive for me, to render the same frame twice. In documentation, there is a note: "Making this reference (using targetTexture) will disable this Camera's capability to render to the screen".
Is this possible, to get only one Camera, that would generate targetTexture and render to the screen using Depth at the same time? Is there any possible workaround to make this? It is essential for me.
Well, you could have it draw to a target texture, and then use a second camera always pointed at that texture in an independent layer so that it doesn't have to do very much work... It really depends on how high-detail the render texture is.