Horde3D

Next-Generation Graphics Engine
It is currently 16.05.2024, 00:23

All times are UTC + 1 hour




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: 02.03.2010, 00:08 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Hmm, why don't you use the HDR pipeline as a starting point?


Top
 Profile  
Reply with quote  
PostPosted: 04.03.2010, 14:47 
Offline

Joined: 17.11.2009, 17:00
Posts: 205
Location: Russia, Moscow
Well, I copied all the steps till post-processing from hdr pipeline to forward, like was shown in the code I posted. But it seems that I still need some post-processing steps in order to make this pipeline work (forward pipeline with antialiasing). Right now, if you use this pipeline, you won't get anything on the screen and no errors on the screen. Tried with my project and horde samples.


Top
 Profile  
Reply with quote  
PostPosted: 05.03.2010, 02:13 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
In the pipeline you posted earlier, nothing is ever drawn to the screen. You render everything to "buffer", but this buffer is never displayed. The SwitchTarget command chooses where you're rendering to. At some point you need to switch target to "", which means you're actually drawing to the screen (not to some buffer somewhere). Here's an example of how you could go about copying your buffer to the screen:
Code:
<Pipeline>
   <Setup>
      <RenderTarget id="buffer" depthBuf="true" numColBufs="1" format="RGBA8F" scale="1.0" maxSamples="16" />
   </Setup>
   <CommandQueue>
      <Stage id="Geometry" link="pipelines/globalSettings.material.xml">
....
      </Stage>

   <Stage id="Display">
      <SwitchTarget target="" />
      <BindBuffer sampler="buf0" sourceRT="buffer" bufIndex="0" />
      <DrawQuad material="pipelines/postHDR.material.xml" context="COPY_RGBA" />
      <UnbindBuffers />
   </Stage>
     
      <Stage id="Overlays">
....
      </Stage>
   </CommandQueue>
</Pipeline>

Then in postHDR.shader, add a new context to the [[FX]] section:
Code:
context COPY_RGBA
{
   VertexShader = compile GLSL VS_QUAD;
   PixelShader = compile GLSL FS_COPY_RGBA;
}
And a new code section below:
Code:
[[FS_COPY_RGBA]]

uniform sampler2D buf0;
varying vec2 texCoords;

void main( void )
{
   gl_FragColor = texture2D( buf0, texCoords );
}


Top
 Profile  
Reply with quote  
PostPosted: 05.03.2010, 12:03 
Offline

Joined: 17.11.2009, 17:00
Posts: 205
Location: Russia, Moscow
Thanks a lot, DarkAngel. It works great. Though it was GLSL VS_FSQUAD, and not GLSL VS_QUAD in the shader :D


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 9 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:  
Powered by phpBB® Forum Software © phpBB Group