0
\$\begingroup\$

So I was follow the roystan grass shader tutourial and although it works well I don't understand the use for it. From what I understand the shader is basically just a flat plane that calculates grass on top of it. If I wanted to apply this grass to a terrain and place it on uneven ground would I have to manually add in a "grass plane" all over the environment and at different angles or am I missing something? Thanks.

\$\endgroup\$
2
  • \$\begingroup\$ Did you try applying this to a terrain shader? Where did you get stuck, or get an unwanted result? \$\endgroup\$
    – DMGregory
    Aug 31, 2020 at 21:52
  • \$\begingroup\$ Sorry, what do you mean by applying it to a terrain shader? Isn't this meant to be used on it's own. I'm kinda a beginner into this stuff. Thanks! \$\endgroup\$
    – Bobby B
    Aug 31, 2020 at 23:06

1 Answer 1

1
\$\begingroup\$

The tutorial demonstrates the concept on a flat plane to make it easier to understand. The actual shape of the mesh is arbitrary, so long as it is made of triangles. Each triangle will be broken up into more triangles by the tessellation stage and grass will be created relative to the normal vector of the current triangle. If you fed your terrain mesh into it, it should produce grass blades on it.

\$\endgroup\$
3
  • \$\begingroup\$ Oh I see, but since it's procedural there would be no way to edit it like regular grass painting correct? \$\endgroup\$
    – Bobby B
    Aug 31, 2020 at 23:05
  • \$\begingroup\$ Make your procedural effect read the painting mask to vary its output. Ask a new question if you need help doing that. \$\endgroup\$
    – DMGregory
    Aug 31, 2020 at 23:10
  • \$\begingroup\$ Thank you I will do that, your solution makes a lot of sense. Would you know how to have the geometry shader read my terrain? The only way I could think of would be to convert it to a mesh using a tool and use that. \$\endgroup\$
    – Bobby B
    Aug 31, 2020 at 23:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .