![Image](http://i51.tinypic.com/21nk5zc.png)
maybe the shadercode is not the best. It was my bumbling trial to translate the shader to glsl found on http://www.talula.demon.co.uk/postproce ... ssing.html
Code: Select all
if (strDummy.emtpty())
Code: Select all
if (strDummy == "")
Code: Select all
<!-- EPPE_FAKESSAO = 25 -->
<Effect id="24" name="FakeSSAO">
<ShaderPostProcess name="Fakessao" vsFile="vertex.fx" vsType="0" psFile="SSAOish v2.fx" psType="4" >
<PixelShaderConstant name="curve_base" value="-6" />
<Texture index="0" textureClamp="1" />
<RenderSource path="auxIn" />
<RenderTarget path="auxOut" />
</ShaderPostProcess>
</Effect>
Code: Select all
EPPE_DEPTH_OF_FIELD,
EPPE_VIGNETTE,
EPPE_FAKESSAO,
EPPE_COUNT
};
Code: Select all
uniform sampler2D SceneBuffer : register(s0);
uniform int curve_base;
float4 main( float2 texCoord : TEXCOORD0 ) : COLOR
{
float4 Color, Mask, Final;
float lum,dev,curve;
Color = tex2D( SceneBuffer, texCoord );
//calc the luminosity of each pixel, channel independent (gives a grayscale)
lum = ( Color.r + Color.g + Color.b ) / 3;
//curve the colors (use the lum map)
lum = 4 - ( lum * ( 1 / pow( lum, 2 ) ) );
lum = smoothstep(curve_base, 3, lum);
curve = (0.15 * pow(lum,3)) + 0.85;
//curve = 1-curve;
curve += 0.075;
Color = Color * curve;
return Color;
//return (255,50,50,255);
}
Code: Select all
<!-- EPPE_FAKESSAO = 25 -->
<Effect id="24" name="FakeSSAO">
<ShaderPostProcess name="Fakessao" vsFile="vertex.fx" vsType="0" psFile="SSAOish v2.fx" psType="4" >
<PixelShaderConstant name="curve_base" value="-6" />
<Texture index="0" textureClamp="1" />
<RenderSource path="auxIn" />
<RenderTarget path="auxOut" />
</ShaderPostProcess>
</Effect>
Code: Select all
<Effect id="24" name="FakeSSAO">
Code: Select all
<Effect id="25" name="FakeSSAO">
Code: Select all
enum E_SHADER_CONSTANT
{
ESC_TIME = 0x1,
ESC_RANDOM = 0x2,
ESC_BUFFERWIDTH = 0x4,
ESC_BUFFERHEIGHT = 0x8,
ESC_PROJECTION = 0x10,
ESC_VIEW = 0x20,
ESC_WORLD = 0x40,
ESC_WORLDVIEW = 0x80,
ESC_WORLDVIEWPROJ = 0x100
};
Code: Select all
<ShaderPostProcess name="Fakessao" vsFile="vertex.fx" vsType="0" psFile="SSAOish v2.fx" psType="4" psUseWorldViewProj="1">
Code: Select all
uniform float4x4 WorldViewProjMatrix;
There might be some faster implementations, though.void CPostProcessManager::removeNodeFromDepthPass(irr::scene::ISceneNode *node)
{
int n=DepthPassNodes.binary_search(node);
if(n!=-1)
DepthPassNodes.erase(n);
};