Search Unity

Reflection probes: Metallic reflections without lightening everything else?

Discussion in 'General Graphics' started by dgoyette, May 18, 2019.

  1. dgoyette


    Jul 1, 2016
    Short version: How can I get metallic objects to look good (by reflecting light) without brightening everything else near the reflection probe?

    As soon as I started creating textures for my objects, I noticed that metallic objects looked good in Substance Painter, but looked bad in Unity. Everything metallic was just black. I learned that I needed reflection probes around the metallic objects for the metal too look correct. But this resulted in the reflection probe contributing a lot of light to the rest of the stuff around it. For example, here's a room with a relatively small reflection probe in it. It's nicely reflecting blue light (from behind the camera) on the reflective surfaces, but it's also brightening the floor. You can see the square of brighter floor representing the probe's volume:


    So I'm wondering how people actually use reflection probes, and what I can do to get metal looking good, without making everything else so bright. I'll list the approaches I'm aware of:
    • Using layers to limit the probe's effect: I know I can make the probe only affect certain layers. But with as few layers as I have available, I don't think it's feasible if I need a Reflective and Non-Reflection version of each of my existing layers just to control whether a given object will reflect. I already use layers to control a lot of the physics behavior, so I don't have a lot of extra layers to spare controlling reflectivity.
    • Making very large reflection probes: I could make one very large reflection probe, such that its lighting impact on the whole scene is consistent, and I won't have weird boundaries like the one I've shown in the screenshot. The downside is that the reflection will no longer be very accurate. It'll look a bit more like how a skybox tends to reflect uniformly throughout a level, rather than having the reflections actually reflect objects next to the reflective object.
    Are there any other options? What does everyone else do with respect to reflection probes? One big one to wrap each scene? Lots of little ones? How do you deal with their lighting causing weird brightening like in my screenshot?

  2. bgolus


    Dec 7, 2012
    It depends on the content. Most of the time it’s “as few as possible”.

    If a large, mostly outdoor area has a relatively similar visual appearance, and no objects that are significantly reflective (metallic & high smoothness), then use one probe for that whole area. If there are static objects in some areas that are highly reflective, then maybe place unique probes in the area so the reflections at least show stuff in the area they’re in.

    For indoor areas with unique per-room visuals (lighting, wall/floor color, major set pieces, etc), then use per room probes that go to the extents of the room. Same for major hallways.

    They key is make sure the probes’ extents go to the walls, floor, and ceiling of the room. Especially with box projection, you want that to line up as close as possible. This gets difficult if you have non-box shaped or non-axis aligned rooms, or thin walls. There are things you can do if you’re using the forward rendering path, but not much for deferred. You either have to find ways to hide the blends, or live with it being a little funny somewhere.
    dgoyette likes this.