Indirect lighting normal maps

I’ve recently started a top down project to work in my spare time and I’ve run into my first challenge. Normally I don’t do a lot of lighting but as far as I can remember Unity only shows highlights and normalmaps when a surface is in direct light.

A lot of my scenes will take place outside on the street, which will probably mean 1 directional light, leaving a lot of the street in shadow, meaning that basically only the diffuse map information is seen, leaving the surface flat and boring to look at. Obviously highlights should (at best) be very weak i indirect lighting, but you’d expect the depth of the tiles to be visible in shadow.

Does anyone have a good solution for this? I’m planning to bake lighting on the vast majority assets in any given scene.

I’d love some thoughts on this issue of mine.

To expound on the above link:
Unity offers two “directional” types of light map encoding, non-directional and directional, the later of which allows for baked ambient & diffuse lighting to use normal maps. For specular highlights, Unity used to provide a third “directional specular” option which would also do specular lighting from the baked directional data, but this has been removed in the latest versions. Instead there’s the shadow mask option which allows accurate per pixel specular lighting from up to 4 baked lights per object. This is more expensive than the old directional specular option, but allows for specular highlights from more than one light at a time which the old technique did not. The side effect is purely ambient lit surfaces with no direct lighting, baked or otherwise, still don’t have any specular highlights which the old technique would have had.

The usual solution to this is to put reflection probes in your scene, as these can be thought of as ambient specular probes as much reflection probes (indeed, ambient specular are just reflections anyway).

You can also take a look at the Bakery GPU lightmapper. It supports specular with dominant direction, and also a couple modes Unity doesn’t like “Radiosity Normal Maps” and spherical harmonic lightmaps. It’s a paid asset but might be worth picking up if you are relying heavily on lightmaps.

The bump contrast on dominant directional lightmaps is mediocre but passable if you want to stick with vanilla Unity. RNMs and SHs are both higher constrast and can give you different light colors from different directions. RNMs use more memory but SHs use more shader instructions. Specular is never particularly accurate from any baked lightmap (until you get into baking out 9+ lobe spherical gaussians) so you are better off relying on reflection probes.

Thank you for your replies.

@bgolus
As far as I can tell, you’re advicing to simply use directional lightmapping and reflection probes? Sadly I don’t tihnk that’d improve my situation much :confused: It appears to be already set to directional by default and I do have reflection probes in the scene aswell.

I’m sorry if I misunderstood you…

@Shane_Michael
We’ve talked about bakery at work before but I’ve never had a real look at it, it doesn’t look too expensive so if it delivers better results I may well give it a shot.
Gotta be honest, had to re-read your explanation a few times I understand what you were talking about. But I think I got the right idea.

However, like bgolus you advice reflection probes for the highlight issue. I don’t know what number of reflection probes you imagine but with the amount I have the scene already there doesn’t seem to be any reflection on the shadowed surfaces. I don’t remmeber the exact number at the moment, but I believe I have something like 8 in the scene currently

The number of reflection probes you should use depends on your scene and your use cases. For something like streets, you may want one, or several, on every streets. If you’re using box projection, place the bounds just below the street surface and extend just past the walls of the buildings along it. This really only works well if you’ve got everything nicely aligned to the world axis though. Otherwise have the default spherical reflection probes placed in the middle of the street and large enough to encompass the building walls. If a reflection probe’s bounds don’t completely cover a mesh renderer’s bounds, Unity may choose to use the scene’s default probe which is just the skybox. You may also want to override some mesh renderers’ anchors to point to a reflection probe itself to ensure they’re using the correct probe.

Even then you may not get a lot of obvious reflections, because unless there is some thing bright in the reflection probe’s view, it won’t be obvious. Also unless you have those nice axis aligned streets and similarly well aligned box projected reflection probes, the things being reflected will have almost nothing to do with the objects around the surface. It’s all various levels of hacks to get “something” in the reflections.

Directional light mapping only stores a single dominant direction. If the ambient lighting is very diffuse, then the affect won’t be very strong. It’s better than nothing, but may not be enough. That’s also why I mentioned using the shadow mask option.

Bakery has some excellent options for different baked specular highlights which go well beyond those offered by Unity’s built in light mapper, and re-adds the directional specular option that works similar to the original one offered by Unity. I think this image gives a good visual example of what it can do:

https://geom.io/bakery/wiki/index.php?title=Manual#Directional_mode

1 Like

@Shane_Michael Gotta be honest, had to re-read your explanation a few times I understand what you were talking about. But I think I got the right idea.[/QUOTE]

You can read the manual of bakery to get the details, but both radiosity normal maps and spherical harmonics can separate light coming in from different directions so you can retain more contrast in those areas light mostly by indirect light.

Areas lit mostly by indirect light, won’t tend to have a really strong dominant direction so the lighting will get averaged out and end up mostly flat. It does add some

Your reflection probes should be picking up light from your scene and using it for ambient specular, but if you don’t have any bright environmental light sources then it may simply not be having a big visible impact–particularly on rough surfaces like brick. The solution may be to look at the lighting design of your level and add a greater variety of smaller light sources in the right places so you can pick up some specular highlights where you want them.