Terrain Engine: Shader for groundplants supporting wind

hi there,

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:

webplayer: http://bit.ly/lDoB7R

it would be great to get some feedback before i release the final version.

lars

or look here to see the shader at work in a full landcape: http://bit.ly/jQBd7I

looking for public release… :slight_smile: you can pm me if you release this public if I overlook this somehow.

webplayer updated as i have seen that lighting on the terrain is totally corrupted. sorry about that.

lars

Hey lars, that looks great :slight_smile:

(too bad I only got unity free, I don’t think the nice shadows would work for me :frowning: )

Looking good

hi there,

the package is ready to download:
http://bit.ly/iUzbnw

please let me know if you have any problems and give me your feedback.

lars

thank you I will test it. are there some restrictions for using this?

what kind of restriction do you mean?

If this is free to use, modify, build on or redistribute… Is there licence included? I din’t opened it yet. Doing other things right now :slight_smile:

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.

lars

Hey lars,

Are those plants detail meshes that are also accepting normal and specular textures?

@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.

lars

Great. Thanks a lot!
In the webplayer, why is the manually placed plants deforming more than the ones planted as detail mesh?

@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!

let us hope for an update on the terrain engine as it has been announced.

As the as i import your package, the occlusion culling doesn’t work any more.

@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

lars

Hi larsbertram,

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.

Strange isn’t it ?