Hi
I use the lightshaft shader from probesys's blog, and rewrite the HDR pipeline 

  but i didn't getting the exact result 

 here how i setup the shader on HDR pipeline....
Quote:
hdr.pipeline.xml
Code:
<!-- High Dynamic Range (HDR) Forward Shading Pipeline -->
<Pipeline>
   <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" />
      <RenderTarget id="GODRAY" depthBuf="false" numColBufs="1" format="RGBA16F" scale="1.0" />
   </Setup>
   
   <CommandQueue>
      <Stage id="Ambient" link="pipelines/globalSettings.material.xml">
         <SwitchTarget target="HDRBUF" />
         <ClearTarget depthBuf="true" colBuf0="true" />
         <DrawGeometry context="AMBIENT" class="~Translucent" />
      </Stage>
      
      <Stage id="Lighting">
         <DoForwardLightLoop class="~Translucent" />
      </Stage>
      
      <Stage id="Translucent">
         <DrawGeometry context="TRANSLUCENT" class="Translucent" order="BACK_TO_FRONT" />
      </Stage>
      
      <!-- 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>
      
      <Stage id="Bloom">
         <SwitchTarget target="BLURBUF2" />
         <BindBuffer sampler="buf0" sourceRT="BLURBUF1" bufIndex="0" />
         <SetUniform material="pipelines/postHDR.material.xml" uniform="blurParams" a="0.0" />
         <DrawQuad material="pipelines/postHDR.material.xml" context="BLUR" />
         <SwitchTarget target="BLURBUF1" />
         <BindBuffer sampler="buf0" sourceRT="BLURBUF2" bufIndex="0" />
         <SetUniform material="pipelines/postHDR.material.xml" uniform="blurParams" a="1.0" />
         <DrawQuad material="pipelines/postHDR.material.xml" context="BLUR" />
         <SwitchTarget target="BLURBUF2" />
         <BindBuffer sampler="buf0" sourceRT="BLURBUF1" bufIndex="0" />
         <SetUniform material="pipelines/postHDR.material.xml" uniform="blurParams" a="2.0" />
         <DrawQuad material="pipelines/postHDR.material.xml" context="BLUR" />
         <SwitchTarget target="BLURBUF1" />
         <BindBuffer sampler="buf0" sourceRT="BLURBUF2" bufIndex="0" />
         <SetUniform material="pipelines/postHDR.material.xml" uniform="blurParams" a="3.0" />
         <DrawQuad material="pipelines/postHDR.material.xml" context="BLUR" />
         <UnbindBuffers />
      </Stage>
      <Stage id="GodRayStage">
         <!--Volumetric Light PostProcess-->
         <SwitchTarget target="GODRAY" />
         <ClearTarget colBuf0="true" />
         <BindBuffer sampler="sceneTex" sourceRT="HDRBUF" bufIndex="0" />
         <DrawQuad material="pipelines/postHDR.material.xml" context="LIGHTSHAFT" />
         <!--Volumetric Light PostProcess End-->
         <UnbindBuffers />
      </Stage>
      
      <Stage id="Combination">
         <SwitchTarget target="" />
         <BindBuffer sampler="buf0" sourceRT="HDRBUF" bufIndex="0" />
         <BindBuffer sampler="buf1" sourceRT="BLURBUF1" bufIndex="0" />
         <BindBuffer sampler="GodRayBuff" sourceRT="GODRAY" bufIndex="0" />
         <DrawQuad material="pipelines/postHDR.material.xml" context="FINALPASS" />
         <UnbindBuffers />
      </Stage>
      
      <!-- Overlays -->
      <Stage id="Overlays">
         <DrawOverlays context="OVERLAY" />
      </Stage>
   </CommandQueue>
</Pipeline>
and i put the shader in postHDR.shader.SHADER file
Quote:
postHDR.shader.SHADER
Code:
[[FX]]
// Samplers
sampler2D buf0 = sampler_state
{
   Address = Clamp;
};
sampler2D buf1 = sampler_state
{
   Address = Clamp;
};
sampler2D sceneTex = sampler_state
{
   Address = Clamp;
};
sampler2D GodRayBuff = sampler_state
{
   Address = Clamp;
};
// Uniforms
float hdrExposure = 2.0;       // Exposure (higher values make scene brighter)
float hdrBrightThres = 0.6;    // Brightpass threshold (intensity where blooming begins)
float hdrBrightOffset = 0.06;  // Brightpass offset (smaller values produce stronger blooming)
float4 blurParams = {0, 0, 0, 0};
// Contexts
context BRIGHTPASS
{
   VertexShader = compile GLSL VS_FSQUAD;
   PixelShader = compile GLSL FS_BRIGHTPASS;
   
   ZWriteEnable = false;
}
context BLUR
{
   VertexShader = compile GLSL VS_FSQUAD;
   PixelShader = compile GLSL FS_BLUR;
   
   ZWriteEnable = false;
}
context FINALPASS
{
   VertexShader = compile GLSL VS_FSQUAD;
   PixelShader = compile GLSL FS_FINALPASS;
   
   ZWriteEnable = false;
}
context LIGHTSHAFT
{
   VertexShader = compile GLSL VS_LIGHTSHAFT;
   PixelShader = compile GLSL FS_LIGHTSHAFT;
}
[[VS_FSQUAD]]
// =================================================================================================
uniform mat4 projMat;
attribute vec3 vertPos;
varying vec2 texCoords;
            
void main( void )
{
   texCoords = vertPos.xy; 
   gl_Position = projMat * vec4( vertPos, 1 );
}
[[FS_BRIGHTPASS]]
// =================================================================================================
#include "shaders/utilityLib/fragPostProcess.glsl"
uniform sampler2D buf0;
uniform vec2 frameBufSize;
//uniform float hdrExposure;
uniform float hdrBrightThres;
uniform float hdrBrightOffset;
varying vec2 texCoords;
void main( void )
{
   vec2 texSize = frameBufSize * 4.0;
   vec2 coord2 = texCoords + vec2( 2, 2 ) / texSize;
   
   // Average using bilinear filtering
   vec4 sum = getTex2DBilinear( buf0, texCoords, texSize );
   sum += getTex2DBilinear( buf0, coord2, texSize );
   sum += getTex2DBilinear( buf0, vec2( coord2.x, texCoords.y ), texSize );
   sum += getTex2DBilinear( buf0, vec2( texCoords.x, coord2.y ), texSize );
   sum /= 4.0;
   
   // Tonemap
   //sum = 1.0 - exp2( -hdrExposure * sum );
   
   // Extract bright values
   sum = max( sum - hdrBrightThres, 0.0 );
   sum /= hdrBrightOffset + sum;
   
   gl_FragColor = sum;
}
   
[[FS_BLUR]]
// =================================================================================================
#include "shaders/utilityLib/fragPostProcess.glsl"
uniform sampler2D buf0;
uniform vec2 frameBufSize;
uniform vec4 blurParams;
varying vec2 texCoords;
void main( void )
{
   gl_FragColor = blurKawase( buf0, texCoords, frameBufSize, blurParams.x );
}
   
[[FS_FINALPASS]]
// =================================================================================================
uniform sampler2D buf0, buf1,GodRayBuff;
uniform vec2 frameBufSize;
uniform float hdrExposure;
varying vec2 texCoords;
void main( void )
{
   vec4 col0 = texture2D( buf0, texCoords );   // HDR color
   vec4 col1 = texture2D( buf1, texCoords );   // Bloom
   vec4 col2 = texture2D( GodRayBuff, texCoords ); // Godray
   
   // Tonemap (using photographic exposure mapping)
   vec4 col = 1.0 - exp2( -hdrExposure * col0 );
   
   gl_FragColor = col + col1 + col2;
}
[[VS_LIGHTSHAFT]]
// =================================================================================================
varying vec3 lightPos;
void main(void)
{
   vec4 v = (gl_ProjectionMatrix * gl_ModelViewMatrix *  gl_LightSource[0].position);
   lightPos = v.xyz / v.w;
   gl_Position = ftransform();
   gl_TexCoord[0] = gl_MultiTexCoord0;
}
[[FS_LIGHTSHAFT]]
// =================================================================================================
uniform sampler2D sceneTex;
varying vec3 lightPos;
void main()
{ 
   int NUM_SAMPLES = 100;
   float density = 0.9;
   float illuminationDecay = 1.0;
   float weight = 0.010;
   float decay = 0.99;
 
   vec2 uv = gl_TexCoord[0].xy;
   //lightPos.xy = (lightPos.xy + vec2(1.0, 1.0)) / 2.0;
   //vec2 deltaTexCoord = uv - lightPos.xy;
  vec2 deltaTexCoord = uv - ((lightPos.xy + vec2(1.0, 1.0)) / 2.0);
   deltaTexCoord = deltaTexCoord / (float(NUM_SAMPLES) * density);
     
   vec3 color = texture2D(sceneTex, uv).xyz;
 
   for(int i=0; i<NUM_SAMPLES; ++i)
   {
      uv -= deltaTexCoord;
      vec3 sample = texture2D(sceneTex, uv).xyz;
      sample = sample * illuminationDecay * weight;
      color += sample;
      illuminationDecay = illuminationDecay * decay;
   }
   
   gl_FragColor = vec4(color, 1.0);
}
can anybody please tell me the correct way to setup this shader to pipeline....
Thanks  
