- Home /
How to have a static, baked lightmap object cast shadows on non-lightmapped terrain
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: http://answers.unity3d.com/questions/806656/can-lightmapped-objects-still-cast-dynamic-shadows.html
I can fix the issue using Deferred Lighting, but then I can't cast shadows on static objects, so this isn't really my solution.
Answer by pietwelve2 · Jun 26, 2016 at 06:01 AM
Hi, I have the same issue. I'd be very interested to read a solution ! Thanks
Your answer
Follow this Question
Related Questions
why shadows dont appear until i get close to them with the camera? 1 Answer
Why are tree shadows from a directional light blocky with unity pro? 1 Answer
Turning off realtime shadows for terrain trees 0 Answers
Terrain Details dont receive shadows; tree branch textures gone insane 0 Answers
No tree shadows in 5.6 3 Answers