Jump to content
  • Advertisement
Sign in to follow this  
assainator

DirectX Shaders

This topic is 2631 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

I have looked around on the internet but I propably used the wrong keywords as I couldn't find anything.

So the question:
Is (any version of) DirectX capable of running multiple (types (vertex, fragment, etc.) of) shaders sequentially?

I thank you in advance.

Share this post


Link to post
Share on other sites
Advertisement
Define 'sequentially' here. Do you want to 'stack' the results? Run vertex shaders on a mesh, rasterize the results, and execute the pixel shader for each covered sample? If it's the latter then, yes, that's how the pipeline works. If your learning resources made this ambiguous somehow you may wish to get some new ones, it's that fundamental ;)

'Stacking' the results is a little more complex, and is mostly dependent on what you're trying to do as an end result. There's some dedicated blending H/W (though I think some fancier boards actually just repurpose the shader units) available for you to merge the results of successive pixel shader passes in a few preset ways. Direct3D10/GL3 introduced the stream-out phase, which lets you save the results of a vertex shader invocation and potentially feed that to a separate vertex shader, but whether or not that's useful depends again on what you're trying to achieve as an end result.

Share this post


Link to post
Share on other sites
I mean first running vertex shader 1, which does a few things to all the vertices, then run vertex shader 2, which does a few things with the already modified vertices.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!