Bad quality bloom

Hey guys,

Is there a way to make a good quality bloom ?

I have increased the bloom samples because it left trails (interlaced) before with radius 13.37. It looks like a 8-bit bloom ( RadiusY=13.37, intensity = 4 ) :

[ATTACH=CONFIG]610[/ATTACH]

Direct link : zupimages.net/up/14/15/wb9i.png

The blur shader looks like this (from qeffects-gl) :


static const char g_szVertexShader_BloomBlur[] =
"#extension GL_ARB_texture_rectangle : enable
"
"precision mediump float;
"
"uniform vec4 Local0;
"
"varying vec4 texCoord[16];
"
"void main(void)
"
"{
"
"texCoord[0] = gl_MultiTexCoord0 + Local0;
"
"texCoord[1] = gl_MultiTexCoord0 + Local0 * 1.250;
"
"texCoord[2] = gl_MultiTexCoord0 + Local0 * 1.375;
"
"texCoord[3] = gl_MultiTexCoord0 + Local0 * 1.500;
"
"texCoord[4] = gl_MultiTexCoord0 + Local0 * 1.625;
"
"texCoord[5] = gl_MultiTexCoord0 + Local0 * 1.750;
"
"texCoord[6] = gl_MultiTexCoord0 + Local0 * 1.875;
"
"texCoord[7] = gl_MultiTexCoord0 + Local0 * 2.000;
"
"texCoord[8] = gl_MultiTexCoord0 - Local0;
"
"texCoord[9] = gl_MultiTexCoord0 - Local0 * 1.250;
"
"texCoord[10] = gl_MultiTexCoord0 - Local0 * 1.375;
"
"texCoord[11] = gl_MultiTexCoord0 - Local0 * 1.500;
"
"texCoord[12] = gl_MultiTexCoord0 - Local0 * 1.625;
"
"texCoord[13] = gl_MultiTexCoord0 - Local0 * 1.750;
"
"texCoord[14] = gl_MultiTexCoord0 - Local0 * 1.875;
"
"texCoord[15] = gl_MultiTexCoord0 - Local0 * 2.000;
"
"gl_Position = ftransform();
"
"}
";

static const char g_szFragmentShader_BloomBlur[] =
"#extension GL_ARB_texture_rectangle : enable
"
"precision mediump float;
"
"uniform sampler2DRect Texture0;
"
"varying vec4 texCoord[16];
"
"void main(void)
"
"{
"
"vec3 col1 = texture2DRect(Texture0, texCoord[0].xy).rgb;
"
"vec3 col2 = texture2DRect(Texture0, texCoord[1].xy).rgb;
"
"vec3 col3 = texture2DRect(Texture0, texCoord[2].xy).rgb;
"
"vec3 col4 = texture2DRect(Texture0, texCoord[3].xy).rgb;
"
"vec3 col5 = texture2DRect(Texture0, texCoord[4].xy).rgb;
"
"vec3 col6 = texture2DRect(Texture0, texCoord[5].xy).rgb;
"
"vec3 col7 = texture2DRect(Texture0, texCoord[6].xy).rgb;
"
"vec3 col8 = texture2DRect(Texture0, texCoord[7].xy).rgb;
"
"vec3 col9 = texture2DRect(Texture0, texCoord[8].xy).rgb;
"
"vec3 col10 = texture2DRect(Texture0, texCoord[9].xy).rgb;
"
"vec3 col11 = texture2DRect(Texture0, texCoord[10].xy).rgb;
"
"vec3 col12 = texture2DRect(Texture0, texCoord[11].xy).rgb;
"
"vec3 col13 = texture2DRect(Texture0, texCoord[12].xy).rgb;
"
"vec3 col14 = texture2DRect(Texture0, texCoord[13].xy).rgb;
"
"vec3 col15 = texture2DRect(Texture0, texCoord[14].xy).rgb;
"
"vec3 col16 = texture2DRect(Texture0, texCoord[15].xy).rgb;
"
"gl_FragColor.rgb = gl_FragColor.rgb / 16.0;"
"gl_FragColor.rgb = (col1 + col2 + col3 + col4 + col5 + col6 + col7 + col8 + col9 + col10 + col11 + col12 + col13 + col14 + col15 + col16) / 16.0;
"
"gl_FragColor.a    = 1.0;
"
"}
";

I’m not sure what newest games use to make a perfect high quality performances bloom :S

Any ideas ?

Hey,

I am not 100% sure, but i think modern game engines use
special materials on models which should get a bloom effect.

Those materials are RGB textures which contain the luminance factors, the
colors, of the bloom or glow effect. The resulting
scene texture which only contains the luminance factors will get the bloom effect
and will be combined with the diffuse scene texture.

This technique is a pretty simple post processing effect which has actually a good
performance too.

I think gamasutra explains this technique really well:
http://www.gamasutra.com/view/feature/2107/realtime_glow.php

  • Daniel