11
\$\begingroup\$

Correct me if I'm wrong, but both the Geometry Shader and the Tessellation Shader jobs are to generate vertices in the Graphic Pipeline. What I would like to know is how they are different and when should I use one over the other?

\$\endgroup\$
  • 6
    \$\begingroup\$ I'm feeling too lazy to write up a full answer, but the gist of it is that Geometry Shader is for a very small, fixed amplification level, where the Tessellation stages are for massive, dynamic polygon amplification \$\endgroup\$ – MickLH May 30 '14 at 18:48
13
\$\begingroup\$

Actually no, the 'job' of the geometry shader (GS) is primative evaluation.

Geometry shaders can tesselate, but they are limited by a) an in-process upper bounds on the number of output elements, and b) execution within a single shader...of course shader instancing aleviates the 2nd issue, but overall geometry shaders are more effective at primative evaluation and/or value interpolation than they are at tessellation.

By comparison, tesselation shaders (TS) were introduced specifically to perform geometry densification so they perform well, are robust to an ever widening array of algorithms, (pun intended) and they are less limited by output bounded buffers.

Daniel Rákos has a good article on the GS/TS evolution: History of hardware tessellation

When to apply each is a case of 'use the right tool for the job' and here is how: Build a rough draft pipeline without a tesselator to get primitives evaluating correctly in the VS/GS/FS. Separately scope the view- or scene-based tessellation, then insert the TS ahead of the GS to densify primitives which are then passed to your already-designed GS. If you want to try a different TS then build an alternative up and swap it into the pipeline...you can even use an instanced GS to dynamically select the right TS based on a primitive's properties!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.