• Advertisement
Sign in to follow this  

Blur/Bloom in pixel shaders

This topic is 4840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been playing around with FarCry's postprocessing shader and wanted to creat a better bloom effect, but it seems my noobishness is getting in the way... Can't get the blur to work. I've removed the code for OGL pathway (and my foolish code)... but the code is still copyrighted by Crytek! // Coder: Tiago Sousa (c) Crytek! #include "../CGVPMacro.csi" MainInput { #ifdef D3D uniform sampler2D ScreenTex : texunit0, uniform sampler2D ScreenBluredTex : texunit1 #endif } DeclarationsScript { struct vertout { OUT_T0 OUT_T1 }; FOUT } CoreScript { #ifdef D3D // get screen float4 fScreenColor = tex2D(ScreenTex, IN.Tex0.xy); // get screen blured map float4 fScreenColorBlured = tex2D(ScreenBluredTex, IN.Tex1.xy); #endif float3 vUnsharpMask=(fScreenColor.xyz+fScreenColorBlured.xyz); OUT.Color.xyz = vUnsharpMask.xyz; OUT.Color.a = 1; } "ScreenBluredTex" is really too pixelated and i wanted to do a horizontal guass filter on it, but how?

Share this post


Link to post
Share on other sites
Advertisement
Something Like this:

for( int i = 0; i < 8; ++i )
{
float4 fScreenColor += tex2D(ScreenTex, IN.Tex0.x+i*0.001);
}

It doesn't work, won't even compile. Isn't tex coordinate a value between -1 and 1?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement