Requesting improvements about planar reflections (4.12)

Hello Epic,

First of all let me thank you for (finally) implementing planar reflections :slight_smile: we have been asking that for ages.

Secondly it would be great if the following could be implemented:

1) Be able to manually update the planar reflection captures rather than every frame.

Setting bool CaptureEveryFrame to false doesn’t have any effect (is this a bug in Preview1?).
We should have the option to do this via blueprints.
I have seen games (like GTA V for instance) that update reflections in half the framerate in some cases which greatly helps with performance.
You may get slightly unaligned reflections if the camera moves quickly but it’s certainly a good option to have.

2) Allow us to (optionally) set a render target manually so we can use it in the material as we like.

I can somewhat understand why this is not done by default (ease of use and all that) but I’m sure many artists would appreciate having some actual control over the reflections.
As it is right now (in Prev1) a planar reflection actor seems to effect every object in the scene! which results in incorrect/weird reflections. What if I want it effecting only 1 wall or floor for example?

3) Enable optional use of the clip plane in the regular scene capture 2d component so we can make our own custom planar reflections.
Again, this would give us more control (which is basically what I’m asking for :p).

Thanks in advance and keep up the greatness!

  1. The planar reflection texture is dependent on the main camera so you really can’t ever skip updating it, or artifacts show on the edges as you are reading outside of the rendered region of the texture, depending on how fast you are rotating the camera. bCaptureEveryFrame is forced on under the hood. This is different from the way regular SceneCapture2D works.

2 & 3 - thanks for your feedback

Hmm weird, I guess I will have to explore the source code.
If you have some spare time, could you explain how does the planar reflection actor work?

I can’t say I understand why it needs to update every frame :p… what if the camera is stationary? there is that scenario too (we could render at half framerate when the camera isn’t moving).
And as I understand it, it doesn’t need to read outside the rendered region either but instead use the camera position/rotation that it was rendered at (like I said, this can result in slightly unaligned reflections but it works fairly well in GTAV).

Thanks for the reply!

Sounds like you need to let the shader compile finish.

^ Yup. Wait a few minutes (can take a while) for shaders to compile at it’ll be fine. Probably compiling all the engine shaders too.

Hi,

Could someone please explain how the planar reflection actor is meant to work? I thought I could use these actors as mirror panels as this is how it appeared to work in the editor, however, when running the game it appeared that the actor only influenced the reflections in the nearby reflective materials.

How would one go about creating a full mirror using this ?

Thanks

The reflective plane you see when placing a PlanarReflection in the world is just an editor-only preview. Press G in the editor viewport to see what it will look like in game - that plane will disappear. You can make your own perfect mirror by placing a plane mesh in the same spot, with a material that has values of 1 hooked up to Metallic and BaseColor.

Hi ,

Thank you so much for adding this to the engine, it is already working very well. I have a couple of questions (or requests if not possible) regarding the implementation.

  1. As @ mentioned (we’re working on the same project), the reflections are being cast on everything when used on an ocean surface. For testing I currently have it set up as a component to the Ocean mesh blueprint, however it applies the reflections even to rough/opaque materials on other actors along the same plane. For example:

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. Perhaps I misunderstood how the planar reflections were supposed to work, but I thought it would be something that needed to be enabled in the material itself, allowing us to opt in for certain surfaces (such as the water surface only). Is this something that can be done currently or might be possible later on?

  1. 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? Reason I ask is the ocean material we are using produces waves through surface displacement, along with surface normals, but only the surface normals affect the reflection. To get around this I have to crank up the normal displacement pretty high to distort the “flatness” of the reflection enough for it to look believable. Even without this the reflections look 100x better than SSR, but it would add just a little bit more to the scene. Here’s an example shot:

Overall I am really happy with this system so far, it is producing much more realistic surfaces than SSR ever could, so once again thank you for finding the time to get it implemented, much appreciated!

EDIT: btw this is for 4.12p2

@: the features requested by are exactly what is needed and what I expected from this planar reflection .
So, when you say:

Could you please elaborate a little bit?

Just grabbed 4.12 as we are trying to compare various reflection based rendering and compare costs. Really eager to give the planar reflections a try. I still don’t get how to hook these up in the editor? New to Unreal, but assuming the planar reflection entity should be able to write to a render target similar to the cubic reflection actor? However, I don’t see a “render target / scene capture” anywhere within the planar reflection actor? How do I generate the reflection texture and apply it to the “mirror mesh”? Thanks in advance.

It is generated by the engine which applies it to the mirror mesh. For now, you don’t have direct access to the render target.

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,

Adding to my last post.

I do see that the “PlanarReflection” actor does come with a bunch of sliders that control various reflection attributes. So, guess it’s safe to say that we need to keep the PlanarReflection actor saved into the scene with these values tuned. Probably why it doesn’t render when running the game.

thx

@blizzzz1: Yes you need to have the actor in your scene, scaled large enough to cover the surface you want to have reflections on. Alternatively if the object you want reflections for is a blueprint, you can simply add a PlanarReflection component to the BP, and adjust the values there (it should scale to the object size automatically). When you hit Play, the PlanarReflection actor will disappear and leave a reflection on the surface the size of the actor.


@ - 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 details.

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 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.

I follow your thread about ocean shader and that’s what I thought.

Yes, but '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”.

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: Unreal Engine 4 - Seamless Portals - YouTube

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?