Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just curious, what's a practical application of geometry shaders?


Geometry Shaders allows you to generate a variable number of vertices based on an input vertex. This is necessary in some cases where you generate models procedurally (e.g. particle animations, terrain generation).

It's possible in theory to allocate a lot of vertices up front (up to the maximum that could be generated). If, for example, an input vertex can generate up to 15 vertices (as is the case of the marching cubes algorithm), you could just create those 15 vertices upfront and set the values of the one you don't need to something that will make it not render (e.g. degenerate triangle). But then your actual vertices become a lot more sparse and performance drops because of all the wasted work done on the throwaway vertices.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: