Is it possible to have a map bake lighting when it loads?
I would like to create a procedural map where each piece has baked lighting, as dynamic lighting for the entire map is far too expensive. I’m hoping I can have an “upon load, generate map, then bake lighting”.
This is just a shot in the dark, I’m not surprised if this is not possible.
you can fake lighting on the surface of a mesh by using the dot product of the light direction vector and the pixel normal. You can often use the unlit version of the material if you use this method.
here’s an example of what the rock from the starter content would look like.
the rock and sphere on the right use the fake lighting.
the material is unlit so it won’t receive any shadows from other meshes, and the fake shadow only effects the surface of the mesh not the shadow the mesh casts.
I’m not sure if the ambient occlusion is mixed in the best way, maybe multiplying it with the bias value would be better.
not sure if the fresnel adds much to the material, if I was making the game I would experiment with it so I left it in.
This method looks ok on realistic games, but looks really good with toony style looking games and some vfx.