Horde3D

Next-Generation Graphics Engine
It is currently 28.03.2024, 10:26

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 22.07.2008, 16:12 
Offline

Joined: 09.05.2008, 19:02
Posts: 18
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


Top
 Profile  
Reply with quote  
PostPosted: 23.07.2008, 22:24 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group