Object placement dependant on terrain


Im trying to figure out a way to automatically plant trees into the terrain, because terrains can use splat images i was hoping i could use that as a region guide for placing trees, like for instance palm trees on sand, etc etc

I tried looking at terrain patches, but the material is generic to the entire terrain, so how can i tell what texture a terrain patch uses ? or is it possible to find the scale it uses (i.e the scale we use to define the seperate textures in Terrain j3md)

i believe @canis85 did something similar to this in his shader-based grass code. it required a user-provided alphamap which not only defines where the grass is applied to the terrain, but also how tall it is. im sure you could add other properties such as grass/bush/tree/rock variables, etc.

check this post for further details, i believe his source is available for download.