Creating multiple render passes?
-
- Posts: 51
- Joined: Tue Jan 02, 2007 11:04 pm
- Location: huntington beach
Creating multiple render passes?
Hey guys, I'm trying to implement a bloom shader, but in order to do that I need to do multiple passes. I have the screenquad set up properly and can do basic postprocessing, its just the multiple passes thing I'm confused with. Can anyone help walk me through setting up multiple passes in irrlicht?
Programmers are merely tools to convert caffeine into code.
-
- Posts: 66
- Joined: Sat Sep 29, 2012 11:58 am
Re: Creating multiple render passes?
smgr->beginscene();
// Pass 1
setRenderTarget(textureName); // renders the output of first pass to the texture rather than in Frame Buffrer . optional
set the 1st pass shader material to the node
smgr->drawAll();
// Pass 2
set the 2nd pass shader material to nodes
smgr->drawAll();
// you can continue this to multiple passes
...
smgr->endScene();
// Pass 1
setRenderTarget(textureName); // renders the output of first pass to the texture rather than in Frame Buffrer . optional
set the 1st pass shader material to the node
smgr->drawAll();
// Pass 2
set the 2nd pass shader material to nodes
smgr->drawAll();
// you can continue this to multiple passes
...
smgr->endScene();
Re: Creating multiple render passes?
Create texture
Set texture as render target
Render all
Set render target to frame buffer (null) - releases render target texture
Texture a quad with the texture you rendered to while applying effects
Set texture as render target
Render all
Set render target to frame buffer (null) - releases render target texture
Texture a quad with the texture you rendered to while applying effects
-
- Posts: 51
- Joined: Tue Jan 02, 2007 11:04 pm
- Location: huntington beach
Re: Creating multiple render passes?
Thanks for this, this looks very useful. However, how would I have the second pass only apply its effects to the first render pass so I could merge them with the original scene?vivekSivamRP wrote:smgr->beginscene();
// Pass 1
setRenderTarget(textureName); // renders the output of first pass to the texture rather than in Frame Buffrer . optional
set the 1st pass shader material to the node
smgr->drawAll();
// Pass 2
set the 2nd pass shader material to nodes
smgr->drawAll();
// you can continue this to multiple passes
...
smgr->endScene();
Programmers are merely tools to convert caffeine into code.
-
- Posts: 66
- Joined: Sat Sep 29, 2012 11:58 am
Re: Creating multiple render passes?
Effect/Output of the first pass would be rendered in the texture1(u set as a renderTarget).
Pass the texture1 to the second pass shaders and merge it as u needed.
irrlicht's xEffects has multiple pass examples.
Pass the texture1 to the second pass shaders and merge it as u needed.
irrlicht's xEffects has multiple pass examples.
-
- Posts: 51
- Joined: Tue Jan 02, 2007 11:04 pm
- Location: huntington beach
Re: Creating multiple render passes?
Hmm, I think I'm having a separate issue with my screenquad which is preventing me from getting the effect that I want. If I overload the OnRegisterSceneNode function, some scene nodes are no longer visible on the screen.
Programmers are merely tools to convert caffeine into code.