Lumen Metals in Reflections

I took a peek but was having lots of unrelated issues with the project. I did render out a cubemap though and the dull metal doors looked great in the cube map. I’m pretty confident the technique would solve issues handily.

Definitely. For movie renders, archvis and who knows, maybe even some real time cases having to jump through 100 hoops just to get an approximation of a second bounce is really pretty wild. Hopefully we get a bounce counter like in true RT. And also hopefully we can eventually get a checkbox to automatically fallback to environment captures for reflective objects in reflections :slight_smile: haha

As far as masking goes, here’s a full breakdown. The first and most important is masking out raster/hit trace vs raytracing. This is achieved with the Ray Tracing Quality Switch Node.
Here we can see Green in the “Normal” input and red in the “Raytraced” input.


This essentially allows us to have a completely different material in reflections. At it’s simplest, this can allow us to disable metallic, and enable base color in reflections so we can get rid of the black spots when using hit lighting.
This already represents a pretty big improvement in many cases.

We get even better results by using a cubemap (multiplied by basecolor). Honestly for the vast majority of cases this is plenty good enough. Most sane people could probably stop here.
But we can notice that the reflected sky is too dark if we simply plug the cubemap into the basecolor,

If we plug our cubemap into the emissive instead, we get much brighter reflections. But we also introduce a few other problems.

First, lumen projects emissive into the scene as ambient light. Mirrors are not projector screens, so we probably don’t want it to cast light.
If we use the following custom node text, we can control this.

#if LUMEN_CARD_CAPTURE
return InputA; 
#else
return InputB;
#endif

This is what I mean by masking out the lumen emissive. The left image is without the custom node, where an emissive cubemap might improperly illuminate the scene. The right image has the custom node, which makes the reflections appear emissive, without actually adding any light into the scene. Non-reflections are non emissive.

Note that I’m not using lumen in my scene captures for this particular demo, so the ground color/lighting doesn’t match perfectly.

The next issue we introduce by using emissive is overbrightening of dark areas, which can make the mesh glow unnaturally. We managed to brighten up the sky, but we made the underside brighter than we really intended to. These is where occlusion masking comes in.


The idea here is to try to reduce the strength of the emissive in areas that would be occluded. You can see on the left, the underside of the torus is unnaturally bright. In this case I’m simply using a gradient to shade the underside until it looks more natural. You could also try baking occlusion into vertex colors.

At this point we’ve pretty much got it where we want it. But there are a few more places that need work.

One case is if lighting conditions are dynamic such as day/night cycles. The simplest and most convincing approach is probably to capture a new cubemap every now and then or when a change is detected, but this would probably cause a hitch for a frame or two when capturing. Another option might be to lerp between cubemaps at the cost of an extra texture sample, or simply adjust the overall emissive value. Maybe even a cubemap flipbook, if we’re feeling really weird.

Again, perfection isn’t really the goal. Its just a matter of believability. 99% of the time, especially in real-time, players aren’t going to be willing or able to scrutinize the details enough.

As a final note, this can be used on non-metallic shiny objects too. Like glossy surfaces or even water.