diff --git a/Shaders/deferred-tree.vert b/Shaders/deferred-tree.vert index f19595b57..140ae47f1 100644 --- a/Shaders/deferred-tree.vert +++ b/Shaders/deferred-tree.vert @@ -11,10 +11,9 @@ void main() { // Texture coordinates float numVarieties = gl_Normal.z; - 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; + 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); // Position and scaling vec3 position = gl_Vertex.xyz * gl_Normal.xxy; diff --git a/Shaders/tree-haze.vert b/Shaders/tree-haze.vert index 1135ef852..299c40289 100644 --- a/Shaders/tree-haze.vert +++ b/Shaders/tree-haze.vert @@ -75,19 +75,18 @@ void main() // this code is copied from tree.vert float numVarieties = gl_Normal.z; - float texFract = floor(fract(gl_MultiTexCoord0.x) * numVarieties) / numVarieties; - texFract += floor(gl_MultiTexCoord0.x) / numVarieties; + float texFract = floor(fract(gl_MultiTexCoord0.x) * numVarieties) / (numVarieties * 4.0); + texFract += floor(gl_MultiTexCoord0.x) / (numVarieties * 4.0); // 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); - // Determine the y texture coordinate based on whether it's summer, winter, snowy. - gl_TexCoord[0].y = gl_TexCoord[0].y + 0.25 * int(gl_Color.z > snow_level) + 0.5 * season; - + // 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); + // scaling vec3 position = gl_Vertex.xyz * gl_Normal.xxy; diff --git a/Shaders/tree.vert b/Shaders/tree.vert index 3a50f5491..1eae41a5a 100644 --- a/Shaders/tree.vert +++ b/Shaders/tree.vert @@ -17,16 +17,15 @@ uniform int season; void main(void) { float numVarieties = gl_Normal.z; - float texFract = floor(fract(gl_MultiTexCoord0.x) * numVarieties) / numVarieties; - texFract += floor(gl_MultiTexCoord0.x) / numVarieties; + float texFract = floor(fract(gl_MultiTexCoord0.x) * numVarieties) / (numVarieties * 4.0); + texFract += floor(gl_MultiTexCoord0.x) / (numVarieties * 4.0); // 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); - gl_TexCoord[0].y = gl_TexCoord[0].y + 0.5 * season; + gl_TexCoord[0] = vec4(texFract + 0.5 * season, gl_MultiTexCoord0.y, 0.0, 0.0); // scaling vec3 position = gl_Vertex.xyz * gl_Normal.xxy; diff --git a/Textures/Trees/coniferous.dds b/Textures/Trees/coniferous.dds index 71e66fc0d..55ff01c16 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 90dfdeb9d..7d8582d2a 100644 Binary files a/Textures/Trees/coniferous.png and b/Textures/Trees/coniferous.png differ diff --git a/Textures/Trees/deciduous-autumn.dds b/Textures/Trees/deciduous-autumn.dds index 4d69780d0..f98617672 100644 Binary files a/Textures/Trees/deciduous-autumn.dds and b/Textures/Trees/deciduous-autumn.dds differ diff --git a/Textures/Trees/deciduous-autumn.png b/Textures/Trees/deciduous-autumn.png index bbb38b1d0..baf433b2a 100644 Binary files a/Textures/Trees/deciduous-autumn.png and b/Textures/Trees/deciduous-autumn.png differ diff --git a/Textures/Trees/deciduous.dds b/Textures/Trees/deciduous.dds index 0a0473916..713c1496d 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 61f6120d3..588df5403 100644 Binary files a/Textures/Trees/deciduous.png and b/Textures/Trees/deciduous.png differ diff --git a/Textures/Trees/mixed-autumn.dds b/Textures/Trees/mixed-autumn.dds index 30227e7a4..1c4120790 100644 Binary files a/Textures/Trees/mixed-autumn.dds and b/Textures/Trees/mixed-autumn.dds differ diff --git a/Textures/Trees/mixed-autumn.png b/Textures/Trees/mixed-autumn.png index eb55f2624..3a2961a06 100644 Binary files a/Textures/Trees/mixed-autumn.png and b/Textures/Trees/mixed-autumn.png differ diff --git a/Textures/Trees/mixed-shrub.png b/Textures/Trees/mixed-shrub.png index 30cded1c2..f70a9ea39 100644 Binary files a/Textures/Trees/mixed-shrub.png and b/Textures/Trees/mixed-shrub.png differ diff --git a/Textures/Trees/mixed.dds b/Textures/Trees/mixed.dds index dd98eb9fb..33cf0a806 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 97dc262cf..58bf7ac38 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 e3f915738..bf6581d2a 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 7f9a33d2b..4fad49e3d 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 acc9936f1..6a783349c 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 6625f2a7b..41623f68f 100644 Binary files a/Textures/Trees/tropical.png and b/Textures/Trees/tropical.png differ