Announcement

Collapse
No announcement yet.

Requesting improvements about planar reflections (4.12)

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

    #31
    Originally posted by Frenetic Pony View Post
    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.
    Even simple cheap gaussian blur would fix most of the issues. Better approximation could calculate blend weights using reflection pass depth buffer. There are lot that can be done in realtime. This is nice prensetation for same problem but with SSR context. http://www.frostbite.com/2015/08/sto...e-reflections/

    Comment


      #32
      Originally posted by blizzzz1 View Post
      Please correct me if I have anything wrong. To enable planar reflections in 4.12:
      -Enable global clipping plane found within: project settings > rendering > optimizations "Support global clip plane for Planar Reflections"
      -Setup a simple material using Roughness = 0 / Metallic = 1.0 / Base Color = 1.0
      -Apply material to a quad mesh (mirror)

      Play the game and the quad mesh will now have planar reflections applied.

      So what is the purpose of the "Planar Reflection" actor found within the "Modes" menu? If I drag this into the viewport, I get planar reflections on this mesh, but only in preview mode and not in the runtime game mode. This sent me down a bit of a path questioning how to get planar reflections actually working.

      Just making sure I understand the basics here.

      Thanks in advance,
      Yes. the Same Settings.. runtime game mode .. nothing..

      Comment


        #33
        How to Settings the Planer Reflection ?

        How to use it? have some tutorial ?

        Comment


          #34
          From what I understand you have to have the Planar Reflection actor in the scene as it has attributes to control various parameters of the planar reflection. I just placed both the "mirror mesh" and the "planar reflection" actor in the same place in the scene. The one issue that I found was that I scaled the planar reflection actor to be very thin, to match the "mirror mesh" and I didn't get any results. I changed the scale of the "planar reflection" actor to be 1.0 in the depth plane (thickness of mirror mesh) and that fixed it. I'm guessing that the "planar reflection" actor has to overlap scene in "depth" to determine the extent of what is reflected into the "mirror mesh". Hope that makes sense.
          dave blizard || senior director lighting || baobab vr

          Comment


            #35
            so good ship.hehe

            Comment


              #36
              Okay so it looks like it's simple to enable the clipping plane in the scene capture 2d component.

              All you need to do is add something like this:
              Code:
              		FPlane MirrorPlane = FPlane(FVector(0, 0, 0), FVector(0, 0, 1)); //Plane base, plane normal
              		SceneRenderer->Views[0].GlobalClippingPlane = MirrorPlane;
              		// Jitter can't be removed completely due to the clipping plane
              		// Also, this prevents the prefilter pass, which reads from jittered depth, from having to do special handling of it's depth-dependent input
              		SceneRenderer->Views[0].bAllowTemporalJitter = false;
              In SceneCaptureRendering.cpp after about line 305.

              Obviously a little bit more code would be needed to expose the plane parameters and add an optional boolean but my point is that this could have been added in like 5 minutes by someone who knows what is doing (I'm not lol) so can we please pleasee add this in the next 4.12 update?

              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


                #37
                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.
                You're talking about controlling what objects appear in the reflection, not what receives the reflection. You can already mask out objects from appearing in the reflection using the blueprint function HideComponent. In 4.13 there will be an array in the details panel that you can assign actors to, which is easier to setup.

                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
                You can use the fade distance and normal fade settings on the planar reflection to limit where it's applied to just the floor.

                Comment


                  #38
                  Some improvements to planar reflections that will be in 4.13:

                  Height fog now works properly in planar reflections
                  * The ray used for computing fog is first clipped by the reflection plane

                  Fading out planar reflections based on roughness since they don't have support for variable roughness (fade starts at .2 roughness, ends at .3)

                  Added bRenderSceneTwoSided to planar reflections, which can be useful to limit leaking
                  Added ShowOnlyActors and HiddenActors to SceneCaptureComponent for easy use without having to call BP functions
                  Added bShowPreviewPlane to planar reflection actors
                  The view state is recreated on planar reflection edit, which resets the Temporal AA history, allowing instant previewing of changes

                  Comment


                    #39
                    Obviously a little bit more code would be needed to expose the plane parameters and add an optional boolean but my point is that this could have been added in like 5 minutes by someone who knows what is doing (I'm not lol) so can we please pleasee add this in the next 4.12 update?
                    Looks like you've got it under control =)

                    Comment


                      #40
                      Originally posted by DanielW View Post
                      Looks like you've got it under control =)
                      I guess I will try submitting a pull request.
                      Is there any chance this is added in 4.12.x if I submit the pr? or 4.13 at best? Q_Q

                      Btw, is it a good idea to change the render target size at runtime? (that would only need to happen when changing resolution, not each tick) or is that not recommended?
                      Is this the reason why planar reflections use FPlanarReflectionRenderTarget?

                      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


                        #41
                        Originally posted by DanielW View Post
                        Some improvements to planar reflections that will be in 4.13:

                        Height fog now works properly in planar reflections
                        * The ray used for computing fog is first clipped by the reflection plane

                        Fading out planar reflections based on roughness since they don't have support for variable roughness (fade starts at .2 roughness, ends at .3)

                        Added bRenderSceneTwoSided to planar reflections, which can be useful to limit leaking
                        Added ShowOnlyActors and HiddenActors to SceneCaptureComponent for easy use without having to call BP functions
                        Added bShowPreviewPlane to planar reflection actors
                        The view state is recreated on planar reflection edit, which resets the Temporal AA history, allowing instant previewing of changes
                        Does atmospheric fog work right? Does occlusion culling work with reflection pass?
                        Currently performance hit is unacceptable. Even with 25% screen percentage our reflection cost around 35-40% of frame. Lot of this cost is from dynamic shadows that could be skipped. It would also be neat to allow user to set Material level for reflection pass. I could skip stuff like POM, detail maps, color variations, all under water effects etc.
                        It also seems that reflection pass use a lot more draw calls that normal pass. I don't have exact numbers but it was like 60-65% of all draw calls. Not sure about reason.

                        Another question is how occlusion culling is implemented for planar reflection actor. Sometimes reflection pass is rendered even when I look right to the ground way above reflection plane.



                        Even with some rough edges I really like this feature. Our water is now almost perfect.

                        Comment


                          #42
                          This planar reflection remind me of UDK. very handy stuff.good job epic u guys is the best.! however, When i try it something not right with the reflection. and tips from epic? and how to make the reflection quality better. please see the pic below
                          TQ
                          it affecting other object is bad.
                          Click here to buy ArchViz Essential Series #1
                          Craftmesh UE Forums page
                          Facebook

                          Comment


                            #43
                            Is there any chance this is added in 4.12.x if I submit the pr?
                            No, hotfixes are for critical bug fixes only.

                            if I submit the pr? or 4.13 at best?
                            Depends on whether it is actually approved for integration, and done during that timeframe. My point was that if you want a clip plane in a scene capture 2d, no reason to wait for us to decide to support it, you can modify the source.

                            Btw, is it a good idea to change the render target size at runtime?
                            It's ok to allocate render targets at runtime, but bad to do so every frame. FPlanarReflectionRenderTarget is caching the render target so that it does not get reallocated every frame.

                            Comment


                              #44
                              Does atmospheric fog work right? Does occlusion culling work with reflection pass?
                              Atmospheric fog is not completely correct, because fog will be picked up underneath the water plane. I haven't done enough tests to know how big of an issue this is in practice. It's probably not solveable either, due to the precomputation implementation of atmosphere.

                              Occlusion culling does work with the reflection pass (objects in the reflection pass occlude each other).

                              Currently performance hit is unacceptable. Even with 25% screen percentage our reflection cost around 35-40% of frame.
                              The performance cost of a planar reflection is completely dependent on what's in your scene. In other words - you control it. Scenes with a lot of triangles and meshes in particular will be heavy because those costs are unaffected by the planar reflection's
                              ScreenPercentage.

                              ot of this cost is from dynamic shadows that could be skipped. It would also be neat to allow user to set Material level for reflection pass. I could skip stuff like POM, detail maps, color variations, all under water effects etc.
                              Yep we need controls for what features are rendered. Material quality level is a good idea. LOD controls will be important too.

                              It also seems that reflection pass use a lot more draw calls that normal pass. I don't have exact numbers but it was like 60-65% of all draw calls. Not sure about reason.
                              The planar reflection pass is using a different camera position and angle so you can't compare it directly to the main view - it sees different things.

                              Another question is how occlusion culling is implemented for planar reflection actor. Sometimes reflection pass is rendered even when I look right to the ground way above reflection plane.
                              There is occlusion culling on the planar reflection component - the whole reflection pass is skipped when it is invisible. It really only kicks in for localized components like a mirror. There's a limitation in the occlusion system where if the camera near plane intersects the bounds of a component, that component is always visible. That will cause the planar reflection for water to continue rendering when you are above it and you look up. That's something we could improve.

                              Comment


                                #45
                                Originally posted by DanielW View Post
                                There is occlusion culling on the planar reflection component - the whole reflection pass is skipped when it is invisible. It really only kicks in for localized components like a mirror. There's a limitation in the occlusion system where if the camera near plane intersects the bounds of a component, that component is always visible. That will cause the planar reflection for water to continue rendering when you are above it and you look up. That's something we could improve.
                                In my test near plane didn't clip the component AABB. Does system use bounding box or spheres?

                                Comment

                                Working...
                                X