Announcement

Collapse
No announcement yet.

Transforming vertices into orthographic view space

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

    #16
    This is gold, I've just stumbled on issue that we don't have actual orthographic projection in the engine. One that you can choose on camera seams to be just a perspective with a very narrow FOV.

    So how do you render sphere itself? SceneCapture2d?
    Youtube Channel

    Comment


      #17
      Originally posted by BoredEngineer View Post
      This is gold, I've just stumbled on issue that we don't have actual orthographic projection in the engine. One that you can choose on camera seams to be just a perspective with a very narrow FOV.

      So how do you render sphere itself? SceneCapture2d?
      There is no SceneCapture2D! Thats the reason I did this. I didn't want to use SceneCapture2D. I render the sphere anywhere within the camera so that it doesn't get culled. I'm working on a way to parent the spheres to the camera. Then I turn of 'render in main pass' but turn on 'custom depth'. I am using the sphere rendered into custom depth and then remapping the depth values to get a 0-1 mask that I can use in post process. I project the mask using world XY.

      I'd like to measure the difference between rendering to SceneCapture2D vs custom depth. The docs say that it is more expensive rendering custom depth than not using it but since it is using no materials just depth, then the only cost is draw calls. I'm hoping a few draw calls of spheres isn't going to cost much. I'll experiment with having them all components under one actor as well to see if that is less draw calls too.

      The only drawback I can see with this method is that the resolution of the custom depth is the same as your render resolution. Also it's not square so the res in one dimension is more than the other. But I'm not too fussed really as the goal here is to have a soft sphere falloff that doesn't need high res.
      Visual Effects Artist, Weta Digital, Wellington New Zealand
      BLOG www.danielelliott.co.uk
      @danielelliott3d https://twitter.com/danielelliott3d
      Unreal Engine and VFX Tutorials https://www.youtube.com/user/DokipenTechTutorials
      2015 Showreel: https://vimeo.com/116917817

      Comment


        #18
        Originally posted by dokipen View Post
        There is no SceneCapture2D! Thats the reason I did this. I didn't want to use SceneCapture2D. I render the sphere anywhere within the camera so that it doesn't get culled. I'm working on a way to parent the spheres to the camera. Then I turn of 'render in main pass' but turn on 'custom depth'. I am using the sphere rendered into custom depth and then remapping the depth values to get a 0-1 mask that I can use in post process. I project the mask using world XY.

        I'd like to measure the difference between rendering to SceneCapture2D vs custom depth. The docs say that it is more expensive rendering custom depth than not using it but since it is using no materials just depth, then the only cost is draw calls. I'm hoping a few draw calls of spheres isn't going to cost much. I'll experiment with having them all components under one actor as well to see if that is less draw calls too.

        The only drawback I can see with this method is that the resolution of the custom depth is the same as your render resolution. Also it's not square so the res in one dimension is more than the other. But I'm not too fussed really as the goal here is to have a soft sphere falloff that doesn't need high res.
        Thank you for explanation! I'll give this a try. The reason why I was asking about SceneCapture2D is because I want to render a number of masks, around the camera position, into a texture and then project it on landscape. Still need to figure out how to get proper size of projection but doing it in custom hlsl node, like you show, looks much more sane solution than building a custom RHI pipeline just to get proper orthographic camera.

        Btw, you could add your sphere into the same actor where you have camera, as component and place it in front of the camera, to be sure it's not culled. But I guess I'm missing something as this is too obvious.
        Last edited by BoredEngineer; 06-07-2016, 05:22 AM.
        Youtube Channel

        Comment

        Working...
        X