http://yfrog.com/htmgescreenshot27p
Are there any good alternatives or some way to control the brightness?
//Polik GroNak Blurry HDR Bloomtexture lastpass;texture lastshader;texture lastframe;sampler s0 = sampler_state { magfilter=linear; AddressU=Clamp; AddressV=Clamp;};sampler s1 = sampler_state { texture = <lastpass>; magfilter=linear; AddressU=Clamp; AddressV=Clamp; };sampler s2 = sampler_state { texture=<lastshader>; magfilter=linear; AddressU=Clamp; AddressV=Clamp;};const static float scale = 4.5f;//spread of bloomconst static float BloomBoost = 1.50f;//brightness of bloomfloat4 HDR = 0;//float4(0.5,0.5,0.5,0.1);const static int kernelsize = 9;const float1 blurPixs[kernelsize] = { {-4.00}, {-3.00}, {-2.00}, {-1.00}, {0.0}, {1.000}, {2.00}, {3.00}, {4.00}};const float1 blurMags[kernelsize] = { {0.55}, {0.70}, {0.85}, {0.95}, {1.00}, {0.95}, {0.85}, {0.70}, {0.55}};float2 rcpres;//31float4 DownScaleBloomV( float2 Tex : TEXCOORD0 ) : COLOR0{ float3 color = 0; float3 color2 = 0; if (Tex.x < 1.02/scale && Tex.y < 1.02/scale){ for (int i=0; i<kernelsize; i++){ color2 = tex2D( s0, (Tex + float2(0,blurPixs[i])*rcpres)*scale ); color += color2*float3(blurMags[i],blurMags[i],blurMags[i]); } color = pow(color, HDR.r*2+1)/(HDR.r*7+1); } return float4(BloomBoost*color/kernelsize, 1);}float4 DownScaleBloomH( float2 Tex : TEXCOORD0 ) : COLOR0{ float3 color = 0; float3 color2 = 0; if (Tex.x < 1.02/scale && Tex.y < 1.02/scale){ for (int i=0; i<kernelsize; i++){ color2 = tex2D( s1, Tex + float2(blurPixs[i],0)*rcpres ); color += color2*float3(blurMags[i],blurMags[i],blurMags[i]); } color = pow(color, HDR.r*2+1)/(HDR.r*7+1); } return float4(BloomBoost*color/kernelsize, 1);}float4 UpScaleCombine( float2 Tex : TEXCOORD0 ) : COLOR0{ float3 color = tex2D( s1, Tex/scale ); float3 color2 = tex2D( s2, Tex ); return float4(color*1*clamp((1.5-HDR.r*2)+abs(HDR.a-HDR.r),0,2)+pow(color2*1, 3-clamp((2.4-HDR.r*1.4)-abs(HDR.a-HDR.r),0,2.4)) , 1);}technique T0{ pass p1{PixelShader = compile ps_2_0 DownScaleBloomV();} pass p1{PixelShader = compile ps_2_0 DownScaleBloomH();} pass p1{PixelShader = compile ps_2_0 UpScaleCombine();}}
float4 UpScaleCombine( float2 Tex : TEXCOORD0 ) : COLOR0{ float3 color = tex2D( s1, Tex/scale ); float3 color2 = tex2D( s2, Tex ); return float4(color*1*clamp((1.5-HDR.r*2)+abs(HDR.a-HDR.r),0,2)+pow(color2*1, 3-clamp((2.4-HDR.r*1.4)-abs(HDR.a-HDR.r),0,2.4)) , 1);}
float4 UpScaleCombine( float2 Tex : TEXCOORD0 ) : COLOR0{ float3 color = tex2D( s1, Tex/scale ) * 0.25; // THIS IS THE LINE THAT WILL DECREASE THE BLOOM float3 color2 = tex2D( s2, Tex ); return float4(color*1*clamp((1.5-HDR.r*2)+abs(HDR.a-HDR.r),0,2)+pow(color2*1, 3-clamp((2.4-HDR.r*1.4)-abs(HDR.a-HDR.r),0,2.4)) , 1);}
float4 UpScaleCombine( float2 Tex : TEXCOORD0 ) : COLOR0{ float3 color = tex2D( s1, Tex/scale ); float3 color2 = tex2D( s2, Tex ); return float4(color*1*clamp((1.5-HDR.r*2)+abs(HDR.a-HDR.r),0,2)+pow(color2*1, 3-clamp((2.4-HDR.r*1.4)-abs(HDR.a-HDR.r),0,2.4)) , 1);}
float4 UpScaleCombine( float2 Tex : TEXCOORD0 ) : COLOR0{ float3 color = tex2D( s1, Tex/scale ) * 0.25; // THIS IS THE LINE THAT WILL DECREASE THE BLOOM float3 color2 = tex2D( s2, Tex ); return float4(color*1*clamp((1.5-HDR.r*2)+abs(HDR.a-HDR.r),0,2)+pow(color2*1, 3-clamp((2.4-HDR.r*1.4)-abs(HDR.a-HDR.r),0,2.4)) , 1);}