Jump to content

  • Log In with Google      Sign In   
  • Create Account


Tesselation pipeline (to separate or not?)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 lipsryme   Members   -  Reputation: 1005

Like
0Likes
Like

Posted 11 November 2012 - 06:24 AM

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 ?

Edited by lipsryme, 11 November 2012 - 06:27 AM.


Sponsor:

#2 MJP   Moderators   -  Reputation: 10950

Like
2Likes
Like

Posted 11 November 2012 - 01:06 PM

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.

#3 lipsryme   Members   -  Reputation: 1005

Like
0Likes
Like

Posted 11 November 2012 - 04:26 PM

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)

Edited by lipsryme, 11 November 2012 - 04:36 PM.


#4 MJP   Moderators   -  Reputation: 10950

Like
1Likes
Like

Posted 11 November 2012 - 09:30 PM

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.

#5 lipsryme   Members   -  Reputation: 1005

Like
0Likes
Like

Posted 12 November 2012 - 05:44 AM

I see, thanks a lot.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS