- Home /
Why doesn't built-in Nature->SoftOcclusion->Leaves/Bark support spot lighting?
Using a spotlight with the built-in soft occlusion leaves/bark shaders gives very problematic results which basically make it impossible to do night scenery with these built-in shaders in case you want to use spot lighting (for stuff like car headlights or flashlight etc).
This question has been asked several times in the past, I think the earliest I found was back from 2013 but NO ONE has had any sensible reply for this and seemingly Unity dev completely ignores this whole problem which seems weird to me seeing as it pretty much invalidates one major portion of game design altogether. (Night time nature scenery, hello?)
I've spent literally around 12 hours of active development time just trying to work a solution for this. I've tried using different shaders but couldn't live with the drawbacks of losing bending and dynamic billboarding, asking for help from people who know shaders better than me but getting 0 replies from 0 people, digging through the internet only to find the question asked several times with no one explaining why it's so, modifying the existing shaders without having enough proficiency to get to a proper end result, nothing has solved the problem and I am getting pretty frustrated by now (12 hours is a very long time trying to battle with 1 technical issue).
I just really need (like... The whole game depends on them) those damn spotlights for my scene because I need both, car headlights and a flashlight to function with the forest scenery. Please help me figure this thing out, either find a workaround where I can reach similar end results as with the built-in nature shaders or to fix the built-in shaders so they start getting properly illuminated by the spotlight cookie only.
This is a .gifv of how the trees/stones act when using a spotlight. Absolutely horrible! https://i.imgur.com/IWWXXcM.gifv
The trees are single mesh with 2 materials (bark and leaves) like they are supposed to be.
They are in a folder called Ambient-Occlusion like they are supposed to be.
I get no compiler errors or notifications regarding the trees or anything related to them or the terrain, everything compiles perfectly.
The bilboarding works flawlessly, you cannot notice with a naked eye the transition from mesh to 2D billboard.
The shader inspector parameters are all tuned so the trees react to any other kind of lighting (even point lights) properly, only the spot light works erronously.
PS. The shader itself seems to support spotlight because when used on any normal gameobjects the light works properly but once you apply the shaders to actual Terrain-> Trees (which they are meant for, ironically) they start acting really weird.