Procedural Grass in BGE

Currently i’m trying different ways to make procedural generation of the grass on the terrain. Terrain itself is just a mesh. I’ve been thinking about just randomly placing grass meshes around the player and about making a place with grass which repeats itself in 4 directions around player and disabling these repeats as the player getting away and creating new. With the first case problem is that I dont know how to get the height and the normal of certain points of my terrain mesh, and with second one I dont know how to get geometry of the terrain and deform the grass plane according to it. I’m a BGE and python beginner and would appreciate any help and links to other effective ways of creating grass on the levels.

Yes, I’ve seen both of this. Unfortunately, your shader doesnt work in my project (not sure why, sometimes the shader compile, and terminal shows no errors, but the grass is completely black, sometimes it doesnt compile, although I dont change the code at all). I also tried to use Benj’s grass shader, but couldnt figure out how to make it use the real terrain mesh, not the heightmap.