I’ve decided to sit down and learn lightmapping and I’ve run into an interesting problem. I’ve got a small scene with a bit of terrain, painted trees, grass, etc and some objects laying around. My problem is basically the opposite of the more common “how to cast realtime shadows on lightmapped objects”.
I’d like to have my static geometry cast shadows on non-static objects, chiefly my terrain. I don’t want to bake my terrain into the lightmap because it’s big, the resolution sucks, it takes a long time to bake, etc. Instead I have the terrain marked as static, but not lightmap static. This way it (and the painted trees) receive realtime lighting which is crisp and looks nice. The only problem is now my static geometry doesn’t cast shadows on the terrain.
In all 3 pictures the cube is non-static/non-lightmapped.
The first picture is my hack to get my desired effect. I have my static geometry duplicated, marked as static/non-lightmapped, and the renderer is set to Shadows Only. My terrain is also static/non-lightmapped.
The second picture is what I have without a hack, where my geometry is static/lightmapped but my terrain is static/non-lightmapped.
The third picture is with the terrain as static/lightmapped.
Is there a way to have static lightmapped geometry cast realtime shadows on things that aren’t already lightmapped? I could also settle for a solution where the static/lightmapped terrain lets the trees still receive realtime lighting.
This question seems similar, but I believe they’re talking about Unity 4.x: