Horde3D http://horde3d.org/forums/ |
|
Particles and defered shading http://horde3d.org/forums/viewtopic.php?f=7&t=442 |
Page 1 of 1 |
Author: | lachlanmcdowall [ 22.07.2008, 16:12 ] |
Post subject: | Particles and defered shading |
I have managed to get this to work, finnally! Thanks to everyone who tried to help me This tecnique might not be very efficient but does appear to work, to render particles with the defered shading pipeline I added the following Code: <Stage id="Attribpass"> <SwitchTarget target="GBUFFER" /> <ClearTarget depthBuf="true" colBuf0="true" /> <DrawGeometry context="ATTRIBPASS" /> </Stage> <!-- Apply lighting and shadows --> <Stage id="Lighting" link="globalSettings.material.xml"> <SwitchTarget target="" /> <ClearTarget colBuf0="true" /> <BindBuffer texUnit="8" target="GBUFFER" bufIndex="0" /> <BindBuffer texUnit="9" target="GBUFFER" bufIndex="1" /> <BindBuffer texUnit="10" target="GBUFFER" bufIndex="2" /> <DrawQuad material="light.material.xml" context="AMBIENT" /> <DoDeferredLightLoop /> </Stage> <!-- Render particles and other translucent objects --> <Stage id="Translucent"> <SwitchTarget target="GBUFFER" /> <ClearTarget depthBuf="false" colBuf0="true" /> <DrawGeometry context="TRANSLUCENT" class="Translucent"/> <SwitchTarget target="" /> <BindBuffer texUnit="0" target="GBUFFER" bufIndex="0" /> <DrawQuad material="util.material.xml" context="DO_COLOUR" /> </Stage> The shader for DO_COLOUR simply copys over the fragments using ADD_BLENDED to blend them to whats already rendered. If anyone can offer any advice on optimising this I would be very very happy, Thanks again |
Author: | marciano [ 23.07.2008, 22:24 ] |
Post subject: | Re: Particles and defered shading |
As DarkAngel states here, it should just be enough to disable depth writing when rendering the particles (this is done in the shader context with the RenderConfig element). By the way, the default deferred shading implementation is not optimal but rather written for easy readability. You could use 8 bit instead of 16 bit buffers (less bandwidth) as done by Killzone 2. Furthermore, it is wasteful to write the fragment position to a separate buffer since you can recunstruct it from the depth buffer. Another very interesting deferred technique that I would try out in the future is presented here (the second one): http://www.horde3d.org/forums/viewtopic.php?f=7&t=232. It should work better with FSAA. |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |