Attempt to fix compilation of the motion blur shader for Intel cards...
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9351 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
b59004ae4d
commit
ac836ee960
@ -21,7 +21,7 @@ void main()
|
||||
vec2 texcoords = gl_TexCoord[0].st;
|
||||
|
||||
// Sample the color buffer
|
||||
vec3 color = texture2D(color_buffer, texcoords);
|
||||
vec3 color = texture2D(color_buffer, texcoords).rgb;
|
||||
|
||||
// Compute the blur direction.
|
||||
// IMPORTANT: we don't normalize it so that it avoids a glitch around BLUR_DIR_CENTER,
|
||||
@ -45,15 +45,15 @@ void main()
|
||||
blur_dir *= blur_factor;
|
||||
|
||||
// Compute the blur
|
||||
vec2 inc_vec = blur_dir / NB_SAMPLES;
|
||||
vec2 inc_vec = blur_dir / vec2(NB_SAMPLES);
|
||||
vec2 blur_texcoords = texcoords + inc_vec;
|
||||
for(int i=1 ; i < NB_SAMPLES ; i++)
|
||||
{
|
||||
color += texture2D(color_buffer, blur_texcoords);
|
||||
blur_texcoords += inc_vec;
|
||||
}
|
||||
color /= NB_SAMPLES;
|
||||
gl_FragColor = vec4(color, 0.0);
|
||||
color /= vec3(NB_SAMPLES);
|
||||
gl_FragColor = vec4(color, 1.0);
|
||||
|
||||
// Keep this commented line for debugging:
|
||||
// gl_FragColor = vec4(blur_factor, blur_factor, blur_factor, 0.0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user