It seems to work sometimes and other times it doesn’t, but, when I set my main camera to draw with the clear flags set to “Depth Only” and a background camera with the clear flags set to “Skybox”, with the main camera on a higher depth setting than the BG camera, the background I get the background area smeared with the main camera and the BG camera seems to be completely ignored.
If I swap between forward and deferred rendering the problem turns on and off.
Is this just a limitation of deferred rendering, or is this a bug?
I’ve attached two images showing what I’m talking about.
Yeah, could be that with Deferred Lighting this does not quite work (since deferred lighting is more involved in switching render targets etc. than forward).
Why do you have to use two cameras? If it’s for performance (culling some layers earlier) purposes - maybe you can use one camera, and set layerCullDistances instead?
I have a project that renders a ‘product’ over a gradient background, the background needs to be static, whilst the product can be ‘orbited’ via the main camera. For simplicity I created a background camera, clear flags set to depth only as its a full screen background and set its depth lower than the main camera. Main camera clear flags set to ‘don’t clear’.
In forward rendering it works fine, in defered I lose the background. I’m sure there are various workarounds to this, but disappointing to lose such a simple method for rendering behind the main camera.
Did anyone figure this out? I’m seeing it under 3.4.2 - when the game starts things are OK, but as soon as I start spawning effects and stuff, I’m suddenly only able to render either my environment camera or my first-person-weapon camera. Is it a bug? A misconfiguration? Or what?
If I switch the first-person-weapon camera to use the Forward path then I’m able to render both cameras OK, but then the lighting on the player’s gun doesn’t match the lighting on the environment properly.
I’m using a 2nd camera to generate a 3D skybox (similar to how the source engine does it). By having a mini-terrain, with a 2nd camera slaved to the first (but moving much less), I get semi-distant objects who move correctly but are comparatively low-res.
Works perfectly when forward-rendered but fails with deferred.
To resurrect an ancient thread (but since I ran into this issue and Google took me here): Aras provided the answer in 2010, but failed to mention one caveat. layerCullDistances can only be used to lower the far clip distance for a specific layer, not set it to higher. I.e. the solution is simply to do the inverse: set the camera far clip high, then write your real far clip into all layers that are not the layer you want to render at a further distance.