Just in case you haven't found it, the pipeline documentation can be found in the manual
here It answers your lightning materials question:
Manual wrote:
For deferred shading you also need to specify a material for the light source. The shader defined in that material is used to draw the screen-space quads where the light's lightingContext attribute specifies the shader context which is used.
If you don't use the deferred sample pipeline, you don't need to worry about them. If you want to use it, wikipedia should be your first stop reading about deferred shading.
Your other questions can be answered by having a look at the
sample HDR pipeline.
Code:
<Setup>
<RenderTarget id="HDRBUF" depthBuf="true" numColBufs="1" format="RGBA16F" scale="1.0" maxSamples="16" />
<RenderTarget id="BLURBUF1" depthBuf="false" numColBufs="1" format="RGBA8" scale="0.25" />
<RenderTarget id="BLURBUF2" depthBuf="false" numColBufs="1" format="RGBA8" scale="0.25" />
</Setup>
We set up three Rendertargets. The used rendertarget attributes are documented in manual.
First stage in our command queue:
Code:
<Stage id="Ambient" link="pipelines/globalSettings.material.xml">
<SwitchTarget target="HDRBUF" />
<ClearTarget depthBuf="true" colBuf0="true" />
<DrawGeometry context="AMBIENT" class="~Translucent" />
</Stage>
Basically says: Render my geometry (except the translucent stuff) to the rendertarget "HDRBUF".
The next two stages should be clear.
Then the rendertarget gets switched:
Code:
<!-- HDR post processing -->
<Stage id="BrightPass">
<SwitchTarget target="BLURBUF1" />
<BindBuffer sampler="buf0" sourceRT="HDRBUF" bufIndex="0" />
<DrawQuad material="pipelines/postHDR.material.xml" context="BRIGHTPASS" />
<UnbindBuffers />
</Stage>
Basically says: Give me the rendertarget "HDRBUF" we rendered to before, do something with it (what to do is specified in the material/shader of the <DrawQuad> command), and render the result to BLURBUF1.
The "Bloom" stage works in a similar way and just adds a <SetUniform> command (which sets a uniform
)
In the last stage the rendertarget gets switched to an empty string (<SwitchTarget target="" /> ) which means the output buffer.
Thats it.
IMHO the best way to understand the pipelines is to play around with the existing ones using the HordeEditor. You can switch of stages, edit rendertargets configurations and see immediate results. And you can have a look at the each target on its own.