Its pretty easy to use the pp collection, here's what I did:
Code:
VIEW* view_bloom_blur = { material = mtl_bloom_blur; flags = CHILD | PROCESS_TARGET; } // a postprocessing view
make a view
Code:
MATERIAL* mtl_bloom_blur =
{
effect = "
Texture TargetMap;
sampler2D g_samSrcColor = sampler_state { texture = <TargetMap>; MipFilter = Linear; };
float4 vecViewPort;
float4 vecSkill1;
float4 postprocessing_bloomblur( float2 Tex : TEXCOORD0 ) : COLOR0
{
float facBlur = 3/20.;
float4 Color = tex2D( g_samSrcColor, Tex.xy);
Color += tex2D( g_samSrcColor, Tex.xy+vecViewPort.zw*facBlur);
Color += tex2D( g_samSrcColor, Tex.xy+vecViewPort.zw*facBlur*2);
Color += tex2D( g_samSrcColor, Tex.xy+vecViewPort.zw*facBlur*3);
return Color / 3.3;
}
technique PostProcess
{
pass p1
{
AlphaBlendEnable = false;
VertexShader = null;
PixelShader = compile ps_2_0 postprocessing_bloomblur();
}
}
";
make the material, i just copy and paste the ppblurbloom into the material
add camera.stage = view_bloom_blur; to your camera function