0
\$\begingroup\$

Is there a way to for example in vertex shader cull current vertex? I have my own grass system and I would like to cull straws that are further away than some distance but I can't use camera culling because grass is drawn in chunks and it hides a whole chunk.

\$\endgroup\$
1
  • \$\begingroup\$ You could use a Stencil shader, although I'm not sure if it'll improve performance. \$\endgroup\$ Commented Mar 10, 2017 at 13:07

1 Answer 1

1
\$\begingroup\$

You cannot discard a vertex. You can discard a fragment but at that point in the pipeline you would get little to no performance benefit for discarding pixels.

You will likely need to use some sort of level of detail system for your grass. Far away grass is drawn in larger and less detailed patches with near grass being drawn in smaller more detailed patches.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Technically he didn't say he wants to discard them for a performance improvement, although that's probably a good assumption. \$\endgroup\$
    – jhocking
    Commented Mar 8, 2017 at 21:17

You must log in to answer this question.

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