Specular Lighting with Baked GI?

Unity 2021.3.19f1
URP 12.1.10

Targeting a VR headset (Oculus Quest/Quest 2).

I have a wall with a painting and a single (Mixed) Point Light.The wall’s shader is set to URP/Baked Lit. The painting is a static object. What I would like is specular lighting on the frame and shadows of the painting on the wall. Apparently, this is a lot harder than it seems.

The only way I have been able to accomplish this, is by setting the painting as a Static object, and setting the scene’s lighting mode to Baked Indirect. Problem is that performance takes a huge hit. If I use Subtractive for the scene’s lighting mode, Performance is good, but I either get no shadows, or no specular lighting:


Scene lighting: Baked Indirect. Painting: Static. FPS: 22. Result: Shadows & Specular

Scene Lighting: Subtractive. Painting: Static. FPS: 35. Result: Shadows but no Specular


Scene Lighting: Subtractive. Painting: Dynamic. FPS: 35. Result: Specular but no Shadows

Is there a way to achieve what I want without it taking a huge performance hit?

Ok, found it. Just set the object as Static, then set Scale In Lightmap to 0.

8877246--1212606--upload_2023-3-15_7-43-44.png

Well, I spoke too soon. Even though I now get specular lighting and shadows, the rest of the object has become much darker.

8877351--1212663--problem.gif

I’d recommend you’d read the following chapter in the troubleshooting guide:

I’m already using mixed lights.

In Subtractive lighting mode, only mixed directional lights provide realtime specular response. All other light types are baked. You can read more about it in the Unity Manual.

If that’s the case, something weird is happening because I’m (only) using mixed point lights and I’m getting specular response on all dynamic objects, and all static objects with Scale In Lightmap set to 0.

There are no directional lights in the scene.

It’s correct, since if an object is dynamic it’s not using lightmaps so it’s receiving realtime light from point lights in your case. This is probably the same if you set Lightmap scale to 0, but it makes little sense to do that (just mark the objct as static but use probes instead of lightmaps).