Hi, I used to have 2 cameras stacked to render a model over the UI, but after switching to the LWRP I noticed stacking was not allowed, so I started using a render texture instead.
Now everything works great in the editor, but when I build I see the model beign render as if it’s camera had a “don’t clear flag”.
How to solve?
Hey! Camera stacking is indeed not supported in LWRP, but it will be available in Universal RP package very soon - in 7.2 package.
As for Render Texture issue - what LWRP version do you use?
Unity version : 2019.2.15f1 (I think is the last stable version)
LWRP version: 6.9.2 (says it’s up to date)
I have 2 cameras in the scene, one is the main one, the other is the camera that renders the mesh to a texture. The background option of the camera that renders to texture is set to “Don’t care”.
Try setting clearflag to a color and with full transparency.
The result is the same unfortunately.
I’m kind of wondering what’s really happening. I mean, it seems that the camera is beign stacked anyway, just like it was previously, but it doesn’t clear the buffer, wich makes it useless. I guess I can look at how to make another render pass.
But it would mean that the render texture is no longer a viable option altogether.
I hate it when the resut in the editor doesn’t much the build because it makes it so diffcult to debug. You have to be constantly re building to see if a solution worked.
I use render textures in combination with a few shaders and a render pass to do something like you seem to be doing and it works fine. How do you display the render texture, with a shader or in gui?
I use a RawImage (GUI), in a canvas.