Hey, I have this shader in my program:
uniform sampler2D texture;
uniform vec2 target_size;
uniform float scale;
vec4 bloom(vec4 original)
{
return original*scale;
}
void main()
{
vec4 color = texture2D(texture,gl_TexCoord[0].xy);
vec2 step = scale/target_size;
//right and left
color *= texture2D(texture,gl_TexCoord[0].xy + vec2(step.x,0.0));
color *= texture2D(texture,gl_TexCoord[0].xy + vec2(-step.x,0.0));
//up and down
color *= texture2D(texture,gl_TexCoord[0].xy + vec2(0.0,step.y));
color *= texture2D(texture,gl_TexCoord[0].xy + vec2(0.0,-step.y));
gl_FragColor = bloom(color);
}
It's a simple blur+bloom shader (I think it's gaussian blur, although I'm not sure about the terminology), which blurs the image according to a factor (bigger factor = bigger blur) and blooms it, also depending on the factor.
This shader runs on my really crappy old laptop, with Intel Integrated Graphics set (which uses software 2D rendering), but not on the PCs of two other people who tested the application. Both have ATI graphics cards (one of them has got a HD 5770, the other one a pretty new mobile graphics card).
A more simple shader, like this:
void main()
{
gl_FragColor = vec4(0.0,1.0,0.0,1.0);
}
however, works perfectly fine with them and simply draws a green rectangle to every sprite that it is applied to.
What could this be? Could it be that "newer" graphics cards( HD 5770 isn't exactly new though, afaik OpenGL 3.0 ? ) don't support gl_TexCoord etc. anymore?