Originally posted by Frenetic Pony
View Post
Announcement
Collapse
No announcement yet.
Requesting improvements about planar reflections (4.12)
Collapse
X
-
-
Originally posted by blizzzz1 View PostPlease 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,
Comment
-
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
-
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;
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 notlol) 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
-
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.
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
Comment
-
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
-
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?
Comment
-
Originally posted by DanielW View PostLooks like you've got it under control =)
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
-
Originally posted by DanielW View PostSome 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
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
-
Is there any chance this is added in 4.12.x if I submit the pr?
if I submit the pr? or 4.13 at best?
Btw, is it a good idea to change the render target size at runtime?
Comment
-
Does atmospheric fog work right? Does occlusion culling work with reflection pass?
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.
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.
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.
Comment
-
Originally posted by DanielW View PostThere 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
Comment