Announcement

Collapse
No announcement yet.

Render mesh in front of the world ? (sorting order ?)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Render mesh in front of the world ? (sorting order ?)

    Here is what I have - I have a plane with unlit masked material that is a child of the camera and is located really close to it.

    When I run test in the Editor, it renders full screen, no clipping. When I test it on the device (mobile), something clips it to a small square. If I move it far enough, it will cover full screen, but then it will end up inside walls.

    I can't use post process material, since it's for mobile VR. How can I have my plane not to be clipped and not get inside walls (basically it should render in front of everything in the scene) ?

    Thanks
    Last edited by motorsep; 04-20-2016, 01:16 AM.

    #2
    You could try making it translucent as you can disable the depth test on translucent materials to always have them render on top. (Not sure if that is compatible with the mobile renderer though)

    Comment


      #3
      It would probably work, but it's more performance taxing I think than until masked material.

      Isn't there a way to render with custom depth? (can't find some simple examples about how to set it up)

      I also saw 4.11 added "overlays" for VR, but I have a feeling it's for PC only and there aren't any docs :/

      Comment


        #4
        Originally posted by motorsep View Post
        It would probably work, but it's more performance taxing I think than until masked material.

        Isn't there a way to render with custom depth? (can't find some simple examples about how to set it up)

        I also saw 4.11 added "overlays" for VR, but I have a feeling it's for PC only and there aren't any docs :/
        I would expect Custom Depth to only work with the deferred renderer. Additionally translucency is actually relatively less taxing with forward rendering. Although it still might be a quite taxing within the constrains of mobile VR.

        Keep in mind that whatever solution you choose you're probably more fillrate bound than vertex bound. So unless your overlay fills the whole plane it is probably a good idea to create a model that tightly fits around the visible elements.

        Comment


          #5
          Originally posted by Arnage View Post
          I would expect Custom Depth to only work with the deferred renderer. Additionally translucency is actually relatively less taxing with forward rendering. Although it still might be a quite taxing within the constrains of mobile VR.
          Translucency is less taxing than custom depth ?

          Originally posted by Arnage View Post
          Keep in mind that whatever solution you choose you're probably more fillrate bound than vertex bound. So unless your overlay fills the whole plane it is probably a good idea to create a model that tightly fits around the visible elements.
          I am still at it with my full screen fade effect a la Wolf3D

          So basically instead of unlit I should try translucent and the rest of the setup is the same ?

          How to I change sorting order for translucent material ?

          Comment


            #6
            I meant that translucency tends to work better in a forward renderer than a deferred one, not in comparison to custom depth.

            To get a translucent material to draw on on top of everything you simply have to set disable depth test to true in the material.

            Comment


              #7
              That didn't work for me :/

              I ended up messing with near plane of the camera and distance between plane and the camera. Worked out of at the end, but I wouldn't know the full extend of it until I test it in all kind of potential scenarios. For now I call it done and working

              Comment

              Working...
              X