Fix shader compilation on old Intel drivers

See http://forum.openclonk.org/topic_show.pl?pid=28313#pid28313
issue1247
Armin Burgmeier 2015-02-09 20:10:40 -05:00
parent 7f79caade5
commit bcaa2399eb
2 changed files with 4 additions and 2 deletions

View File

@ -12,7 +12,8 @@ slice(texture+6)
{
#ifdef HAVE_LIGHT
// Ambient light
float ambient = texture2D(ambientTex, ambientTransform * vec3(gl_FragCoord.xy, 1.0)).r * ambientBrightness;
// Extra .xy since some old intel drivers return a vec3
float ambient = texture2D(ambientTex, (ambientTransform * vec3(gl_FragCoord.xy, 1.0)).xy).r * ambientBrightness;
#else
// Lighting disabled: Ambient light everywhere
float ambient = 1.0;

View File

@ -11,7 +11,8 @@ slice(texture+4)
{
#ifdef HAVE_LIGHT
// prepare texture coordinate for light lookup in LightShader.c
vec2 lightCoord = lightTransform * vec3(gl_FragCoord.xy, 1.0);
// Extra .xy since some old intel drivers return a vec3
vec2 lightCoord = (lightTransform * vec3(gl_FragCoord.xy, 1.0)).xy;
#endif
}