after having been asked several times for the shader i usually use on my terrain groundplants i have started to clean it up and prepare it for publishing.
it replaces the built in vertexLit shader for detail meshes used within the terrain engine but also can be used on manually placed game objects.
it supports “wind” – at least bending as it neither takes any wind zone nor the terrain’s wind settings into account, but can be fully controlled via the mesh main color or the dry and healthy color values.
features
terrain engine:
bending controlled individualy for each different mesh model via terrain engine → dry and healthy color
receive shadows
some “basic” translucency [forward rendering only]
low cost rendering due to the terrain engine
game objects:
bending controlled individualy for each different mesh model via material → color
receive shadows
cast shadows
some “basic” translucency [forward rendering only]
low cost rendering due to the ability of beeing batched as static object
my lighting models for forward rendering and deferred rendering are pretty much different from each other as deferred rendering doesn’t support “wrap around diffuse” lighting. so have tried to mimic this as good as i could. but just have a look:
it is free to use. but of course it would be nice if you shared your modifications/improvements with the community…
and you may redistribute it with your models as long as it is clear that your customers pay for the models not for the shader. may be you icould nclude some credits.
@janpec: it is not possible to pass more than just one texture to the terrain engine which is diffuse. but if you just use the shader on manually placed models it is pretty easy to add support for normal and spec textures. the modified shader should also work with the terrain engine but won’t show up any normal/spec textures one plants within the terrain engine.
@pixero: bending looks different because i did not spend enough time on adjusting the dry and healthy colors. it is a bit tricky as i have written in the documentation.
Ah i thougt that your version is supporting normals on details meshes for terrain. I really hate that Unity engine doesnt handle that. Dammit its 2011 UT not 90s!
@xoart: wow, it is just a shader and a pretty simple script! i can’t imagine that this would stop the occlusion culling from working correctly.
may be getting the official package from the asset store will solve your problem… (btw it comes with some more features)
just get it here for free: Advanced Terrain Shaders | VFX Shaders | Unity Asset Store
Yes it impress me too ! I use the official pakage. I made 2 tests, new project, i import your package and the a made an occlusion culling on a new scene with a new default terrain. In the second i do the same without import your package.
The first scene says “error PVS compilation”.
The second works.