I just saw the latest trailer for the new Mirror’s Edge and it prompted me to try a few a few ideas I had been kicking around in the back of my head related to glass rendering. This also revealed a few areas where things seem to be deficient with Unreal’s current set of rendering options. I’d recommend briefly watching this part of the trailer (starts at 4:35) for reference.
1. HDR Translucent Reflections
As far as I can tell from all the settings I’ve toyed with, translucent surfaces treat all reflections (even SSR) as LDR, which makes getting realistic glass materials basically impossible. I’m not even looking at the accuracy of the placement of the reflected image - simply the intensity of the reflections and how those should also influence the opacity of the glass surface.
The way it should ideally work is to take the HDR reflection captures and use the luminance of those captures as part of the opacity function. This is currently only possible if you have direct control over the reflection in the material editor (as was the case with UE3/UDK where all reflections were baked into a given material) or if you manually set up a scene capture actor in UE4.
Below is an example from real life illustrating what I’m referring to along with a test I made in UE4 to recreate the effect. Note in the photo how the luminance of the reflection causes the bright parts to remain opaque (100% obscuring the objects behind the glass), while the darker parts of the reflection become transparent.
Here’s the same effect in UE4; however, this was a manually created effect with a special (and expensive) 2D capture actor that was made just for this example. This kind of setup would be impractical in any real production and is only an example of what a real HDR reflection that drives opacity based on luminance could look like. In this example, I basically have the RenderTarget’s color going into an unlit translucent material’s color while its alpha goes into the opacity. I have a few multiply and power nodes affecting the alpha opacity, and I’m not handling fresnel reflections in this example, but it illustrates the reflected luminance opacity adequately.
2. Ability to tag only specific objects to be rendered by Scene Capture Actors (either 2D or Cube)
In the trailer linked above, after the character crashes through the glass, take a look at the white reflective wall to the right. They’re using an interesting trick of compositing accurate 2D Scene Captures (or their equivalent in that engine) of the characters on top of more generalized sphere or box cubemaps.
A few seconds later at the 4:46 mark, they do the same thing with the large glass wall in front of the character (she runs toward it and kicks the goon through it) with the two characters having an accurate 2D capture composited on top of generalized cubemap reflections.
Obviously in both cases, the surfaces (the flat white wall and large glass panel) were given special attention with the 2D capture actors being manually set up. This isn’t an automated effect by any means, but it definitely seems like an efficient one by only having the reflection captures rendering small and important objects accurately while the rest of the reflections can be generalized.
Right now this effect is sort of achievable in UE4, but it would be nice to have a little more specific control. At this point, it’s possible to tell a reflection capture actor what classes of objects to capture (skeletal meshes for instance), but it would far nicer to also have the ability to simply flag specific assets, regardless of class, to be captured or ignored. For example, I may only care about having the player character and a few important meshes captured accurately in a scene, but that small batch of assets may include both skeletal meshes and static meshes, which would then force the capture to render far more objects in an inefficient way.
Also, even if I only need to render skeletal meshes (as an example), the Render Target texture doesn’t currently output a nice alpha to use for compositing. I managed to make one by basically blowing out the levels (multiplying by something absurd like 200) and then clamping the captured image, but that resulted in a 1 pixel halo around the captured elements. This part isn’t all that significant but something worth noting.
3. Return of SceneCaptureReflectActor
I hadn’t really had a need to check for it until now, but I was completely baffled by the fact that the UE3/UDK SceneCaptureReflectActor has completely disappeared. Screen space reflections are great for a lot of things, but they simply aren’t suitable for all scenarios (for instance, actual mirrors that first or third person characters can get close to - especially in small areas where the rendering overhead isn’t an issue).
I’ve done some poking around and found this video by R Villani (who kindly uploaded his scene as well), but these Blueprint methods for matching a SceneCapture2D’s rotation/translation to the player’s own camera only work if there aren’t any objects behind the mirror that would get picked up and rendered by the SceneCapture2D camera. If we had the ability to selectively flag specific objects to be ignored (point #2 above), then this method could possibly work, but otherwise any scene or area that needed a reflected mirror would need an empty void behind the mirror plane.
I guess my question is, are we going to see the old SceneCaptureReflectActor return to UE4 at some point? It seems far too useful a tool for creating certain effects to simply be abandoned.