Fast 8-Bit channel pseudo HDR
http://bbs.gameres.com/showthread.asp?threadid=23298
After reading the article of Hugo, I tried it.
Written a Fragment Shader with shaderdesigner.
Fakehdr.frag
//http://freespace.virgin.net/hu.elias/graphics/x_posure.htm
Teacher // Hugo pointed out that the exposure is determined according to the light entering the lens.
// After we render an image, you should use float16 format to save.
/ / But if we can take the rendertarget for a float16 format
The color of the surroundings is the factor that determines the exposure.
// The following shader code should be said to be very stealing. But the effect is ok.
Uniform Sampler2d Texture; Const float blurfactor = 12.5; // BLUR, is to take multi-far pixels to const float expFactor = 0.8; // Exposure const float cdelp = 0.0009765625; // A pixel corresponds to the FLOAT size. I use the texture is 1024, and I will count the const float sharpness = 0.8; // look at the code. . . . VEC4 XPOSURE (VEC4 CL, FLOAT E) {RETURN (Exp Factor) - Exp (ExpFactor-E)) * cl;} void main () {float delp = blurfactor * cdelp; vec4 texcolor = texture2d (Texture, VEC2 (GL_TEXCOORD) [0] .S, GL_TEXCOORD [0] .t)); // When the color of the current location and the surroundings, the weight is different when the exposure is exposed, and the weight is different, // The final color is . . . . . VEC4 color = texcolor * 2.0 / 22.0; color = texture2d (Texture, Vec2 (GL_TEXCOORD [0]. S DELP, GL_TEXCOORD [0] .t DELP)) * 5.0 /22.0; Color = Texture2D (Texture, VEC2 (GL_TEXCOORD [0] .s DELP, GL_TEXCOORD [0] .t-DELP) * 5.0 /22.0; Color = Texture2D (Texture, VEC2 (GL_TEXCOORD [0] .s-Delp, GL_TEXCOORD [0] .t- DELP) * 5.0 /22.0; Color = Texture2D (Texture, VEC2 (GL_TEXCOORD [0] .s-Delp, GL_TEXCOORD [0] .t DELP)) * 5.0 /22.0; float e = color.r * 0.3 Color.g * 0.59 color.b * 11; // Calculate brightness information, gl_fragcolor = xposure (TexColor * Sharpness Color * (1-Sharpness), E);} I don't know how to map on Blog, see HTTP: //bbs.chinagamedev.net/showthread.php?t=9679