Jump to content

  • Log In with Google      Sign In   
  • Create Account

Two rendering passes with different shaders in DirectX11?


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
3 replies to this topic

#1 BlurEffect   Members   -  Reputation: 163

Like
0Likes
Like

Posted 14 March 2014 - 06:24 AM

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



Sponsor:

#2 L. Spiro   Crossbones+   -  Reputation: 13574

Like
0Likes
Like

Posted 14 March 2014 - 07:47 AM

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
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#3 Ashaman73   Crossbones+   -  Reputation: 7416

Like
0Likes
Like

Posted 14 March 2014 - 08:00 AM

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, 14 March 2014 - 08:04 AM.


#4 BlurEffect   Members   -  Reputation: 163

Like
0Likes
Like

Posted 14 March 2014 - 10:06 AM

Alright guys. Thanks for clarifying that!






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