• Advertisement
Sign in to follow this  

Two rendering passes with different shaders in DirectX11?

This topic is 1410 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

Hey guys,

 

This question is probably kind of stupid or simple but I'm having a bit of a hard time to decide how to have two rendering passes to draw my geometry. I'm creating a cel-shaded environment and I have a vertex/pixel shader for the colouring and a second pair of shaders for the rendering of black outlines. In my renderer class, I'm looping through the scene objects and draw them.

What I don't really get is the following: Some shaders I found declare a technique containing several passes in the HLSL file, is it possible to call such a technique from c++ code without using the effects framework (I read some posts discouraging people from using it). And how would I achieve the same effect without declaring a technique at all? Should I simply loop through all objects twice and switch the shader in between? Thank you very much in advance. Any advice is appreciated.

 

Cheers

Share this post


Link to post
Share on other sites
Advertisement

is it possible to call such a technique from c++ code without using the effects framework

No. “Passes” in this context is part of the syntax of the effects framework.

And how would I achieve the same effect without declaring a technique at all? Should I simply loop through all objects twice and switch the shader in between?

If every single object is going to have this (cel-shading) done to them, then yes.
If not, there is no need to draw a second time anything that will not be cel-shaded or does not need a second pass.
Draw them once, then change shaders and draw them again.


L. Spiro

Share this post


Link to post
Share on other sites

Although consider a post-processing pass instead of a geometry pass (the first one often only needs a fullscreen quad to be rendered). I use a cel-shader in my game without a second geometry pass, though I use a deferred render engine to accomplish it. With a forward render engine it might be more difficult.

 


Should I simply loop through all objects twice and switch the shader in between?

Yes, this would be the way to go. Eg OpenGL don't have effect files, there you need to mange it by yourself.

Edited by Ashaman73

Share this post


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

  • Advertisement