Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


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: 20320

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

#3 Ashaman73   Crossbones+   -  Reputation: 11468

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.

Ashaman

 

Gnoblins: Website - Facebook - Twitter - Youtube - Steam Greenlit - IndieDB - Gamedev Log


#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