Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uniform sampler2D mpass_texture;
- uniform vec2 screen_texture_pow2_sz; // pow2 tex size
- #define lutTex2D(v) pow(texture2D(mpass_texture, (v)),2.2)
- void main()
- {
- vec4 sum = vec4(0.0);
- float wid=2.0;
- float c1 = exp(-1.0/wid/wid);
- float c2 = exp(-4.0/wid/wid);
- float c3 = exp(-9.0/wid/wid);
- float c4 = exp(-16.0/wid/wid);
- sum += lutTex2D(gl_TexCoord[0].st + vec2(-4.0, 0.0)/screen_texture_pow2_sz) * c4;
- sum += lutTex2D(gl_TexCoord[0].st + vec2(-3.0, 0.0)/screen_texture_pow2_sz) * c3;
- sum += lutTex2D(gl_TexCoord[0].st + vec2(-2.0, 0.0)/screen_texture_pow2_sz) * c2;
- sum += lutTex2D(gl_TexCoord[0].st + vec2(-1.0, 0.0)/screen_texture_pow2_sz) * c1;
- sum += lutTex2D(gl_TexCoord[0].st + vec2( 0.0, 0.0)/screen_texture_pow2_sz);
- sum += lutTex2D(gl_TexCoord[0].st + vec2(+1.0, 0.0)/screen_texture_pow2_sz) * c1;
- sum += lutTex2D(gl_TexCoord[0].st + vec2(+2.0, 0.0)/screen_texture_pow2_sz) * c2;
- sum += lutTex2D(gl_TexCoord[0].st + vec2(+3.0, 0.0)/screen_texture_pow2_sz) * c3;
- sum += lutTex2D(gl_TexCoord[0].st + vec2(+4.0, 0.0)/screen_texture_pow2_sz) * c4;
- gl_FragColor = pow(sum/(1+2*(c1+c2+c3+c4)),1.0/2.2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement