Does unity have a magical way of providing terrain height data for a shader? Or do i have to use a seperate heightmap for it?
You mean the vertex positions? In the vertex program, same as every other shader.
Oh, sorry i wasnt clear enough.
I am on my way for converting a water shader, and a part of the final color is calculated depending on the depth of water.
So far so good, i am currently getting depth information from a heightmap of my current terrain. But is there any easier and better way of fetching this data i ask?
Sorry to revive an old thread, but I kinda have the same problem, as in I need the terrainHeight in a shader, in order to align large clumps of grass (detail meshes) to the terrain.
The problem lies when painting grass on slopes, some of it will fly and others will be buried in the ground. this should be possible in some way. (it is in other games like Arma2 which has thick folliage cover)
Does anyone have an idea?