How to add grass on a procedural mesh in Unity

I was unable to find a good tutorial to help me in my situation :

I created a procedural mesh looking like an island in unity and I want to cover this mesh of grass but after a certain height (it’s an island so I don’t want grass on the beach…).

I think that I need to procedurally generate the grass when I generate the mesh but I didn’t find anything that could help me.

I tried many ways like GPU instancing (i didn’t understand well what it was doing), URP shader and more…

Please help me I have been stuck on it for 2 weeks !

Thanks for reply.

you can access mesh vertex positions, calculate triangle face center (or positions on it),
then you can spawn something on that point.

or just collect those positions into geometry shader,
or mesh instancing script, where it then draws grass blades there.

google for: unity procedural grass, seems to have some tutorials and options, even for URP

You can access or render a heightmap, then use mesh with grass at regular intervals such as their vertex are contained within the grid space, and, in the vertex shader, read the world space grid hash of the vertex, but also generate a seed for a rng function to output a random 2d displacement, use that to query the heightmap, displace the vertex vertically, eventually add a distance function that fade and or scale the mesh past a distance. Attach the grass mesh to the camera, when the camera move the seed and make sure all grass position stay consistant. Using multiple mesh for density of various scale help, but this can be roll out within a single mesh anyway. No need for batching because it’s a form of batching, it self update.

Sorry but can you make it more clear ??? ^^’