1
0
Fork 0

Fix warning on some GPUs.

This commit is contained in:
Stuart Buchanan 2013-05-10 20:20:08 +01:00
parent 5689d76dca
commit 613db9668f
3 changed files with 4 additions and 4 deletions

View file

@ -13,7 +13,7 @@ void main() {
float numVarieties = gl_Normal.z;
float texFract = floor(fract(gl_MultiTexCoord0.x) * numVarieties) / (numVarieties * 4.0);
texFract += floor(gl_MultiTexCoord0.x) / (numVarieties * 4.0);
gl_TexCoord[0] = vec4(texFract + 0.5 * season, gl_MultiTexCoord0.y, 0.0, 0.0);
gl_TexCoord[0] = vec4(texFract + 0.5 * float(season), gl_MultiTexCoord0.y, 0.0, 0.0);
// Position and scaling
vec3 position = gl_Vertex.xyz * gl_Normal.xxy;

View file

@ -38,7 +38,7 @@ uniform float overcast;
//uniform float scattering;
uniform float ground_scattering;
uniform float snow_level;
uniform int season;
uniform int season;
float earthShade;
float mie_angle;
@ -85,7 +85,7 @@ void main()
float cr = cos(gl_FogCoord + gl_Color.x);
// Shift texture to account for snow level and seasons
gl_TexCoord[0] = vec4(texFract + 0.25 * int(gl_Color.z > snow_level) + 0.5 * season, gl_MultiTexCoord0.y, 0.0, 0.0);
gl_TexCoord[0] = vec4(texFract + 0.25 * float(gl_Color.z > snow_level) + 0.5 * float(season), gl_MultiTexCoord0.y, 0.0, 0.0);
// scaling
vec3 position = gl_Vertex.xyz * gl_Normal.xxy;

View file

@ -25,7 +25,7 @@ void main(void)
// so that trees aren't all oriented N/S
float sr = sin(gl_FogCoord + gl_Color.x);
float cr = cos(gl_FogCoord + gl_Color.x);
gl_TexCoord[0] = vec4(texFract + 0.5 * season, gl_MultiTexCoord0.y, 0.0, 0.0);
gl_TexCoord[0] = vec4(texFract + 0.5 * float(season), gl_MultiTexCoord0.y, 0.0, 0.0);
// scaling
vec3 position = gl_Vertex.xyz * gl_Normal.xxy;