Announcement

Collapse
No announcement yet.

Requesting improvements about planar reflections (4.12)

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

    #16
    After experimenting a few more with these planar reflections, it's obvious : as is (and even with improvements coming with 4.13), it's correct for basic stuff, nothing more. This is due to the way the feature is designed, to give out of the box results.
    Last edited by EdWasHere; 05-14-2016, 12:38 PM.
    GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

    Comment


      #17
      Originally posted by EdWasHere View Post
      After experimenting a few more with these planar reflections, it's obvious : as is (and even with improvements coming with 4.13), it's correct for basic stuff, nothing more. This is due to the way the feature is designed, to give out of the box results.
      Agreed.. unfortunately I can not personally use it in my projects as is right now, there is too little control.

      Hopefully access to the render target will be possible in the future, or at least implement the clip plane in the scene capture 2d component.

      4.10 Update! -> [Community Project] WIP Weather & Ocean Water Shader
      WIP Interactive Water Shader, WIP 2D Water Sim
      WIP FFT Ocean w/ Foam, Quad-tree Infinite Ocean LOD

      Comment


        #18
        I can not personally use it in my projects as is right now, there is too little control
        I follow your thread about ocean shader and that's what I thought.

        Hopefully access to the render target will be possible in the future, or at least implement the clip plane in the scene capture 2d component.
        Yes, but DanielW's answer about this doesn't make me feel optimist.
        Just as if you put a question to someone who answers: "Very good question! Thanks a lot!" and leaves.
        That's what's called: "Communication".
        Last edited by EdWasHere; 05-16-2016, 05:43 PM.
        GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

        Comment


          #19
          Clipping distance is already implemented for Scene Capture 2D's isn't it?

          Either way, I imagine the reason you need the main camera to make them work is because of an optimization you can make, whereby you can skip rendering the plane if it's bounds are not currently in the View Frustrum. The same way we do it for these: https://www.youtube.com/watch?v=y2b0evmnBCE

          Comment


            #20
            Clipping distance is already implemented for Scene Capture 2D's isn't it?
            What do you mean? There is no "Clipping plane" option in the scenecapture2D actor, which is what was requested here.

            Anyway, that was an occasion to discover the very interesting work you linked with your answer.
            Looking at this video, I couldn't really say: what's the difference between this portal functionnality and the one
            released by FreetimeCoder in his Adventure Kit?
            Last edited by EdWasHere; 05-25-2016, 02:46 PM.
            GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

            Comment


              #21
              This is a shot from inside a ship above the ocean surface. The material applied to the wall is the same one applied to the floor, with the planar reflections turned on it causes the floor to look glossy and reflective.
              Thanks for demonstrating it so clearly. I think the root cause here is that planar reflections don't handle roughness correctly. The floor of the ship should have specular, it's just so rough that it looks like diffuse. I'll probably fade out planar reflections based on roughness.

              2) This might not be possible due to the way the planar system works, but is there a way to include some surface displacement into the normal distortion?
              It's probably possible to do something like that, which converts the receiver point's distance from the reflection plane into an offset into the planar reflection texture. The whole determination of how normals distort the planar reflection lookup is just a heuristic based on where the reflection ray intersects a virtual sphere centered at the receiver point. I'll investigate this further next time I'm working on ocean reflections.

              Just entered a bug report for the Blueprint based PlanarReflection component causing massive memory/performance issues in editor when adjusting a slider variable value for the blueprint. A video is included as it is difficult to fully explain, along with steps to reproduce in a new project. Thanks.
              Thanks for the detailed report. It's actually not a planar reflection bug as memory climbs even without a planar reflection, although the planar reflection makes it much worse. Hopefully something we can fix for 4.13.

              Comment


                #22
                On having explicit control over what receives the planar reflection - In a deferred renderer like UE4 you have to fit data like this into the GBuffer, which is pretty much full. Reflections are done in a deferred pass long after materials and components are rendered. The nice thing about this approach is that you can layer different reflection methods easily, each one is just a different pass that blends into the reflection buffer mapped onto the screen. For example if the planar reflection is faded out, SSR kicks in, and if SSR is faded out, reflection captures cover the reflection, and they are blended between.

                So I don't intend to add direct control for what receives planar reflections at this point. In theory, planar reflections are accurate for a slab of positions near the plane, there's no reason you should have to mask them to certain objects. Same reason we don't have flags for each reflection method (SSR, reflection captures) on receiving components / materials. Instead I want to improve the heuristics for when the planar reflection is valid or not, so that it 'just works'.

                Comment


                  #23
                  On giving direct access to the render target like scene captures do - it's possible but a decent amount of work. It can't just be a UTextureRenderTarget2D because the size of the planar reflection texture comes from the screen size.

                  Comment


                    #24
                    Originally posted by DanielW View Post
                    In theory, planar reflections are accurate for a slab of positions near the plane, there's no reason you should have to mask them to certain objects. Same reason we don't have flags for each reflection method (SSR, reflection captures) on receiving components / materials.
                    I have to disagree with that, you don't necessarily need to have flags for what is effected by SSR or reflection captures (well there is SSR flag for translucent materials) but that's very different from planar reflections if you ask me!

                    SSR is fairly accurate regardless of position and reflection captures are never accurate anyway (they are there to pretty much fill the empty space with something, ideally you would never want to use those ) but planar reflections on the other hand are only relevant and accurate for a surface aligned and as close to the planar capture actor.. every object that is too far above or below the plane has no good reason to receive planar reflections, it just looks too inaccurate and out of place and pretty much ruins it in my opinion, better accounting for roughness is not going to always help.

                    What if you have a fairly reflective box above a reflective floor but you only want the floor to receive the reflections from the planar capture actor? the box is simply going to look wrong reflecting things it should never be able to .

                    Anyways if render target access cannot be done very easily then what about implementing the clip plane in the regular scene capture 2d component? is that possible?

                    4.10 Update! -> [Community Project] WIP Weather & Ocean Water Shader
                    WIP Interactive Water Shader, WIP 2D Water Sim
                    WIP FFT Ocean w/ Foam, Quad-tree Infinite Ocean LOD

                    Comment


                      #25
                      Originally posted by DanielW View Post
                      Thanks for demonstrating it so clearly. I think the root cause here is that planar reflections don't handle roughness correctly. The floor of the ship should have specular, it's just so rough that it looks like diffuse. I'll probably fade out planar reflections based on roughness.
                      Have you considered pre blurring planar reflection texture with varying roughness values to mipmaps? This work well for cubemap and should work for planar reflections too. Memory increase is only minimal(under +33%). Just couple mips should be fine with trilinear filtering.

                      Comment


                        #26
                        [MENTION=404]DanielW[/MENTION]:
                        TK-Master wrote: "Anyways if render target access cannot be done very easily then what about implementing the clip plane in the regular scene capture 2d component? is that possible?"
                        In fact, that's all you need to make planar reflections:

                        - adding a "clipping plane" option with a few parameters (center of the plane, right vector of the plane) to the scenecapture 2D actor. Then you could display these reflections in any mesh you want by plugging the render target (with screenposition in uv's) to the emissive channel of it's material.

                        - adding a optionnal "mirroring location" flag so that the scenecapture position mirrors the camera position, so you don't need blueprint stuff to get this result (optionnal only so that you could also use the clipping plane option to make portals effects much easier).

                        About the rendertarget size: it could however been defined manually according to the choosen game resolution.

                        This way, it wouldn't "just work", you would have to edit emissive channels manually to make it work (which is trivial) but you would have all possible controls over the reflections (those given by the scenecapture showflags and postprocess tweakings).

                        That's what I thought planar reflections would be (as an extended version of scenecapture2D actor - because that's how Ryan Bruck's described this feature in an other pot) and that's why I was surprised when I saw how it was implemented.
                        Last edited by EdWasHere; 05-25-2016, 02:48 PM.
                        GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

                        Comment


                          #27
                          Originally posted by DanielW View Post
                          In theory, planar reflections are accurate for a slab of positions near the plane, there's no reason you should have to mask them to certain objects. Same reason we don't have flags for each reflection method (SSR, reflection captures) on receiving components / materials. Instead I want to improve the heuristics for when the planar reflection is valid or not, so that it 'just works'.
                          There are many reasons to mask out certain objects; if you have special meshes in first person (common in first person shooters) they'll show up when you look at the surface which is reflecting, which ruins the effect.

                          Comment


                            #28
                            Originally posted by Kalle_H View Post
                            Have you considered pre blurring planar reflection texture with varying roughness values to mipmaps? This work well for cubemap and should work for planar reflections too. Memory increase is only minimal(under +33%). Just couple mips should be fine with trilinear filtering.
                            You can't "pre-blur" the textures, planar reflections are done in realtime. Best that can be hoped for is multiple importance sampling, which needs enough resolution.

                            Comment


                              #29
                              Originally posted by Frenetic Pony View Post
                              You can't "pre-blur" the textures, planar reflections are done in realtime. Best that can be hoped for is multiple importance sampling, which needs enough resolution.
                              I mean blur it right after reflection pass. It's quite cheap blur to smaller render targets like mipmaps. Just like this is done for effects like bloom.

                              Comment


                                #30
                                Originally posted by Kalle_H View Post
                                I mean blur it right after reflection pass. It's quite cheap blur to smaller render targets like mipmaps. Just like this is done for effects like bloom.
                                This is what I meant to, but you can't just blur it cheaply (like a guassian blur or something) and get it to look right.

                                Comment

                                Working...
                                X