Hopefully this doesn’t sound as stupid as I feel for not knowing the answer:
Is it possible to have lightmaps that are only visible when realtime lights are used?
Envision a level…a castle lets say…completely lightmapped, but without any realtime lights. It simply looks textured with a base, dark ambient light level (e.g. nighttime); you can see the floors and walls are brick but no other shadow/bounce light detail is apparent. Introduce a torch and now the baked lightmap detail is visible.
This would allow light sources to be turned on/off and still maintain the quality of a lightmap.
This is not to be confused with realtime shadows, just simple illumation of the lightmap of an object.
Here’s my pseudo code attempt:
Final = (Light * Diffuse) + (Lightmap * Diffuse)
Thanks in advance!
-Steve
EDIT: I’m considering using this technique for an iOS game, else I would go with Beast-Lightmaps/Realtime mix.
I’m trying to do a similar thing currently, but i’m getting a really strange problem with the unity_LightmapST when trying to use the lightmap inside a ForwardAdd Pass.
Meaning it changes the .xy and .zw of the unity_LightmapST when moving about in the scene, so if the camera is in a certain area, it looks correct, but moving it around screws up the whole lightmap read. I guess this has to do with the system that is supposed to switch Realtime-Shadowing with Lightmap-Shadowing based on Distance when using Unity Pro ?
But i’m on Unity Indie, and this is really a problem for this type of shader.
Is there maybe some secret #pragma or similar that disables this behaviour ?