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 );
}