Original Techniques:
Code: Select all
//bloom example 1, draw in single pass, very performance heavy and low blurring range
technique11 SinglePassBloom <string UIName="Single pass bloom";>
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_ExampleBloom1(TextureDownsampled, 1024.0, 1024.0)));
}
}
//bloom example 2, draw using several techniques and several render targets
technique11 MultiPassBloom <string UIName="Multipass bloom"; string RenderTarget="RenderTarget1024";>
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_ResizeFirst(TextureDownsampled, 1024.0, 1024.0)));
}
}
technique11 MultiPassBloom1 <string RenderTarget="RenderTarget512";>
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_ResizeFirst(TextureDownsampled, 1024.0, 512.0)));
}
}
technique11 MultiPassBloom2 <string RenderTarget="RenderTarget256";>
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_Resize(RenderTarget512, 512.0, 256.0)));
}
}
technique11 MultiPassBloom3 <string RenderTarget="RenderTarget128";>
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_Resize(RenderTarget256, 256.0, 128.0)));
}
}
technique11 MultiPassBloom4 <string RenderTarget="RenderTarget64";>
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_Resize(RenderTarget128, 128.0, 64.0)));
}
}
technique11 MultiPassBloom5 <string RenderTarget="RenderTarget32";>
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_Resize(RenderTarget64, 64.0, 32.0)));
}
}
//in last pass output to bloom texture
technique11 MultiPassBloom6
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_BloomMix()));
}
}
Modified techniques:
Code: Select all
//bloom example 1, draw in single pass, very performance heavy and low blurring range
technique11 SinglePassBloom <string UIName="Single pass bloom";>
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_ExampleBloom1(TextureDownsampled, 2048.0, 2048.0)));
}
}
//bloom example 2, draw using several techniques and several render targets
technique11 MultiPassBloom <string UIName="Multipass bloom"; string RenderTarget="RenderTarget1024";>
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_ResizeFirst(TextureDownsampled, 2048.0, 2048.0)));
}
}
technique11 MultiPassBloom1 <string RenderTarget="RenderTarget512";>
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_ResizeFirst(TextureDownsampled, 1024.0, 512.0)));
}
}
technique11 MultiPassBloom2 <string RenderTarget="RenderTarget256";>
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_Resize(RenderTarget512, 512.0, 256.0)));
}
}
technique11 MultiPassBloom3 <string RenderTarget="RenderTarget128";>
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_Resize(RenderTarget256, 256.0, 128.0)));
}
}
technique11 MultiPassBloom4 <string RenderTarget="RenderTarget64";>
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_Resize(RenderTarget128, 128.0, 64.0)));
}
}
technique11 MultiPassBloom5 <string RenderTarget="RenderTarget32";>
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_Resize(RenderTarget64, 32.0, 32.0)));
}
}
//in last pass output to bloom texture
technique11 MultiPassBloom6
{
pass p0
{
SetVertexShader(CompileShader(vs_5_0, VS_Quad()));
SetPixelShader(CompileShader(ps_5_0, PS_BloomMix()));
}
}
EDIT: I always forget that this forum doesn't autohide the code... :V