diff --git a/Shaders/deferred-tree.vert b/Shaders/deferred-tree.vert index 8df53a978..f19595b57 100644 --- a/Shaders/deferred-tree.vert +++ b/Shaders/deferred-tree.vert @@ -11,9 +11,10 @@ void main() { // Texture coordinates 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 * float(season), gl_MultiTexCoord0.y, 0.0, 0.0); + float texFract = floor(fract(gl_MultiTexCoord0.x) * numVarieties) / numVarieties; + texFract += floor(gl_MultiTexCoord0.x) / numVarieties; + gl_TexCoord[0] = vec4(texFract, gl_MultiTexCoord0.y, 0.0, 0.0); + gl_TexCoord[0].y = gl_TexCoord[0].y + 0.5 * season; // Position and scaling vec3 position = gl_Vertex.xyz * gl_Normal.xxy; diff --git a/Shaders/tree-haze.vert b/Shaders/tree-haze.vert index 4ad8c178f..83a36ba97 100644 --- a/Shaders/tree-haze.vert +++ b/Shaders/tree-haze.vert @@ -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; @@ -75,18 +75,19 @@ void main() // this code is copied from tree.vert float numVarieties = gl_Normal.z; - float texFract = floor(fract(gl_MultiTexCoord0.x) * numVarieties) / (numVarieties * 4.0); - texFract += floor(gl_MultiTexCoord0.x) / (numVarieties * 4.0); + float texFract = floor(fract(gl_MultiTexCoord0.x) * numVarieties) / numVarieties; + texFract += floor(gl_MultiTexCoord0.x) / numVarieties; // Determine the rotation for the tree. The Fog Coordinate provides rotation information // to rotate one of the quands by 90 degrees. We then apply an additional position seed // 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, gl_MultiTexCoord0.y, 0.0, 0.0); - // Shift texture to account for snow level and seasons - gl_TexCoord[0] = vec4(texFract + 0.25 * step(snow_level, gl_Color.z) + 0.5 * float(season), gl_MultiTexCoord0.y, 0.0, 0.0); - + // Determine the y texture coordinate based on whether it's summer, winter, snowy. + gl_TexCoord[0].y = gl_TexCoord[0].y + 0.25 * step(snow_level, gl_Color.z) + 0.5 * season; + // scaling vec3 position = gl_Vertex.xyz * gl_Normal.xxy; diff --git a/Shaders/tree.vert b/Shaders/tree.vert index a64ae301a..3a50f5491 100644 --- a/Shaders/tree.vert +++ b/Shaders/tree.vert @@ -17,15 +17,16 @@ uniform int season; void main(void) { float numVarieties = gl_Normal.z; - float texFract = floor(fract(gl_MultiTexCoord0.x) * numVarieties) / (numVarieties * 4.0); - texFract += floor(gl_MultiTexCoord0.x) / (numVarieties * 4.0); + float texFract = floor(fract(gl_MultiTexCoord0.x) * numVarieties) / numVarieties; + texFract += floor(gl_MultiTexCoord0.x) / numVarieties; // Determine the rotation for the tree. The Fog Coordinate provides rotation information // to rotate one of the quands by 90 degrees. We then apply an additional position seed // 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 * float(season), gl_MultiTexCoord0.y, 0.0, 0.0); + gl_TexCoord[0] = vec4(texFract, gl_MultiTexCoord0.y, 0.0, 0.0); + gl_TexCoord[0].y = gl_TexCoord[0].y + 0.5 * season; // scaling vec3 position = gl_Vertex.xyz * gl_Normal.xxy; diff --git a/Textures/Trees/coniferous.dds b/Textures/Trees/coniferous.dds index 14f3928f4..87857e9eb 100644 Binary files a/Textures/Trees/coniferous.dds and b/Textures/Trees/coniferous.dds differ diff --git a/Textures/Trees/coniferous.png b/Textures/Trees/coniferous.png index 405cfa6a2..313f6d221 100644 Binary files a/Textures/Trees/coniferous.png and b/Textures/Trees/coniferous.png differ diff --git a/Textures/Trees/deciduous.dds b/Textures/Trees/deciduous.dds index 3a80cdee4..bc541f3c9 100644 Binary files a/Textures/Trees/deciduous.dds and b/Textures/Trees/deciduous.dds differ diff --git a/Textures/Trees/deciduous.png b/Textures/Trees/deciduous.png index 2ae60b10b..0b16ba11d 100644 Binary files a/Textures/Trees/deciduous.png and b/Textures/Trees/deciduous.png differ diff --git a/Textures/Trees/mixed.dds b/Textures/Trees/mixed.dds index b6c3f12b9..b1270c783 100644 Binary files a/Textures/Trees/mixed.dds and b/Textures/Trees/mixed.dds differ diff --git a/Textures/Trees/mixed.png b/Textures/Trees/mixed.png index 5badb6ec6..f163b7787 100644 Binary files a/Textures/Trees/mixed.png and b/Textures/Trees/mixed.png differ diff --git a/Textures/Trees/tropical-alt.dds b/Textures/Trees/tropical-alt.dds index 3b19e349e..f256da0ff 100644 Binary files a/Textures/Trees/tropical-alt.dds and b/Textures/Trees/tropical-alt.dds differ diff --git a/Textures/Trees/tropical-alt.png b/Textures/Trees/tropical-alt.png index 0c8828132..3249babf6 100644 Binary files a/Textures/Trees/tropical-alt.png and b/Textures/Trees/tropical-alt.png differ diff --git a/Textures/Trees/tropical.dds b/Textures/Trees/tropical.dds index cea985902..5d7b93884 100644 Binary files a/Textures/Trees/tropical.dds and b/Textures/Trees/tropical.dds differ diff --git a/Textures/Trees/tropical.png b/Textures/Trees/tropical.png index 7eabc3c62..d649afbab 100644 Binary files a/Textures/Trees/tropical.png and b/Textures/Trees/tropical.png differ