Original Post
Hi, I'm currently trying to impelemnt a grass system in my engine on the terrain, and right now I'm struggling with finding a good way to place grass in the right places. I've read a lot of papers and looked in the forums, and the best thing I came up with is to use a coverage map to decide where the grass will appear. What I don't understand is how I can place the grass billboards based on the coverage map? I know I can read the file into an array and find out the positions I need, but I want to do it on the GPU using shaders. The only idea I thought about was to read the value from the coverage map in the pixel shader and use that to determine whether or not the currently rendered billboard is visible. But it seems a waste since I'm sending a lot of grass billboards in advanced that might not be rendered anyway. I looked at NVIDIA's Nature Scene demo and Anti-Aliasing with Transparency(which renders grass too) and I didn't understand how they used the coverage map to decide where the grass is rendered (I think they used the stencil buffer, though I'm not sure). Any ideas? Thanks!