Unity Community


Results 1 to 11 of 11

  1. Posts
    75

    camera depth does not work in deferred lighting mode

    The problem is :

    I have two cameras, A for the main 3d scene, B for renderering guis behind the main 3d scene. The reseon two use two cameras is GUITEXTURE and GUITEXT are always on top of the main scene.
    for A I set Clear flags to depth only, depth to -1, culling mask to the main 3D scene
    for B I set clera flags to solid color, depth to -3, culling mask to the layer I define for the guis,rendering path is forward.

    The problem is that if I set A's rendering path to forward, everything goes fine. If I set it to "deferred lighting", It seems only can see the 3D scene, and everything without any depth values becomes black and can not see the behind guis. Seems "depth only" does not work in defered lighting mode. Is that a bug on something?


  2. Posts
    75
    If I turn off camera A, I can see the guis rendered by camera B. So I guess the contents in camrea A just occlude camera B's contents because "depth only"clearing mask does not work in deferred lighting cameras


  3. Posts
    75
    has anybody meet similar problems before?


  4. Posts
    75
    Is here the right place to ask or I should ask at scripting forum?


  5. Location
    That creepy house on the end of every street
    Posts
    1,564
    Quote Originally Posted by azuretttc View Post
    Is here the right place to ask or I should ask at scripting forum?
    You can try, the reason I haven't responded (dunno about others reasons) is cause I can't really tell what's wrong so have nothing useful to respond with except I've not noticed anything.
    Resident Lightmap Whore and person voted least likely to take the Apocalypse seriously.
    I'm a PC, and hiding porn on your computer was my idea.
    Support these plugins: Playmaker, uLink, SSE and Volume Grass. Or I'll set Miss Piggy on you.
    Hire niosop - awesome programmer, a genius actually!
    It's too hot to work right now!


  6. Posts
    75
    thanks, has anybody met similar problems before? Is this really a bug that unity have problems on depth rendering in deferred lighting mode? I'm using 3.2.0f4 pro

  7. Unity Developer

    Location
    Copenhagen
    Posts
    185
    Hey azuretttc,
    the problem you're describing is a known issue. It is caused by the fact that the final pass of prepass rendering (so the pass that renders the geometry the second time and applies the result of the lighting pass to it) is rendered into a render texture. Then it is just blit-copied into the back buffer, overriding everything that was rendered there before.

    Fixing that problem requires some changes in other subsystems, so won't be a quick one, but it has been placed on our roadmap.

    A workaround is probably possible if the second camera (the deferred one) would render into a render texture and you would handle compositing that with the first camera's output yourself.


  8. Posts
    3
    I know this thread was started back in 2011, but it appears to still be an issue. I have exactly the same problem in that i have two camera's setup as deferred with the 'top' layered camera set to depth only. In Forward Rendering i get the composited result i'd expect but in Deferred i only see the top layer result.

    As this was raised in 2011, do you have any idea when it will be resolved? Failing that i will look at going down a rendered texture route.

    Thanks.

    Mike.


  9. Location
    UK
    Posts
    882
    Quote Originally Posted by mikemalinowski View Post
    I know this thread was started back in 2011, but it appears to still be an issue. I have exactly the same problem in that i have two camera's setup as deferred with the 'top' layered camera set to depth only. In Forward Rendering i get the composited result i'd expect but in Deferred i only see the top layer result.

    As this was raised in 2011, do you have any idea when it will be resolved? Failing that i will look at going down a rendered texture route.

    Thanks.

    Mike.
    Try to layer your camera's, let's say for e.g. you use a UI / GUI for camera to render you need a new layer to add the UI render with the correct depth to overlay. If they are both in default, the new camera will always take poll position.


  10. Posts
    3
    Hey ShadowK, the issue is not with the ordering of my render 'layers'. With all my cameras set to forward rendering i get exactly the result I expect by layering the depths of the cameras to overlay and 'see through' the top level ones.

    The issue is with the depth ordering not working in deferred rendering mode. Or more specifically the 'transparency/empty pixels' between depths.

    Sadly I am not layering for the GUI, otherwise I could just set the GUI camera to Forward Rendering. Instead my actual 3D view is made up of a couple of cameras layered atop of each other to get a very specific effect. Ideally i'd like to use deferred rendering to achieve the visual id i am after but unless I can solve this i will have to fall back to Forward.

    Is this behaviour expected?


  11. Location
    UK
    Posts
    882
    Quote Originally Posted by mikemalinowski View Post
    Hey ShadowK, the issue is not with the ordering of my render 'layers'. With all my cameras set to forward rendering i get exactly the result I expect by layering the depths of the cameras to overlay and 'see through' the top level ones.

    The issue is with the depth ordering not working in deferred rendering mode. Or more specifically the 'transparency/empty pixels' between depths.

    Sadly I am not layering for the GUI, otherwise I could just set the GUI camera to Forward Rendering. Instead my actual 3D view is made up of a couple of cameras layered atop of each other to get a very specific effect. Ideally i'd like to use deferred rendering to achieve the visual id i am after but unless I can solve this i will have to fall back to Forward.

    Is this behaviour expected?
    Not really and could be a bug as Kuba says, as I understand it lower depth camera's will render first. Now there is a specific issue that I've come across (I used deferred) which completely seems to ignore what depth you have. With Daikon forge for UI you have to specifically layer the UI or it renders over the main camera even though the depth is higher?

    Not sure how applicable it is to what your trying to do, but I thought it worth a mention.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •