Tesselation pipeline (to separate or not?)

Started by
3 comments, last by lipsryme 11 years, 5 months ago
I got a question for people who know about this.
Now when implementing the "entire" dx11 pipeline and using a hull and domain shader the vertex modulation and multiplication (basically most of the regular stuff you'd do in the vertex shader before) is now being done inside the domain shader instead. Having different material that are either tesselated or not means I can't use the same gbuffer shader.(or rather the same VS) Now if I were to use the entire process of going through the HS, tesselator and DS and basically just output the vertex information unchanged (or set tesselation factor to 1?) to the domain shader and then do the stuff there even for regular non-tesselated materials would this be a performance hog ? Or is the graphics card already doing this in the background when defining no HS, DS or setting them to null ?
Advertisement
For most cases, your vertex shader can be mostly the same for the tessellated and non-tessellated case. You still want to do things like transforming position/normal/tangent frame to world/view space or skinning in the vertex shader. The one thing that you'll need to change is that you won't want to apply your projection matrix in the vertex shader, you'll need to wait until the domain shader to do that. All in a all it's a few simple differences that can be handled easily with some #if's.

If you specify NULL Hull and Domain shaders the hardware won't execute those shaders at all, so it would definitely be more expensive if you used pass-through shaders for those stages. It's the same for the geometry shader.
Doesn't the vertex information need to be "untouched" until you get the new vertex data inside the domain shader ? Or is that irrelevant ?
But I'd still have to use 2 separate vertex shaders right ? Because how else would I pass a struct using SV_POSITION (for untesselated directly to the PS) and a regular POSITION semantic for the hull shader input ?
Wait can I use SV_POSITION also as hull shader input ? (don't have time to try right now)
No, the vertex data doesn't need to be "untouched". You can process the data any way you'd like in the vertex shader or the hull shader. Usually you want to do as much work as possible in the vertex shader, since that will execute once per control point instead of once per tessellated vertex (which is what will happen in the domain shader).

You will definitely need two different compiled vertex shaders for tessellated and non-tessellated rendering, I just meant that you can share a lot of the same shader code between those two shaders. You can't output SV_Position from a vertex shader if you're using tessellation, you'll need to wait until your domain shader stage to do that.
I see, thanks a lot.

This topic is closed to new replies.

Advertisement