diff --git a/Shaders/forest.frag b/Shaders/forest.frag index 6e0ec3c43..de9260cf6 100644 --- a/Shaders/forest.frag +++ b/Shaders/forest.frag @@ -26,6 +26,8 @@ void main (void) vec4 noisevec = texture3D(NoiseTex, (rawpos.xyz)*0.01*scale); vec4 nvL = texture3D(NoiseTex, (rawpos.xyz)*0.00066*scale); + + float vegetationlevel = (rawpos.z)+nvL[2]*3000.0; float fogFactor; float fogCoord = ecPosition.z; @@ -57,20 +59,27 @@ void main (void) c4 = mix(vec4(n-0.88, n-0.74, -n, 0.0), c1, smoothstep(0.990, 0.890, abs(normalize(Normal).z)+nvL[2]*0.9)); c5 = mix(c3, c4, 1.0); - //brings vegetation 'floor', added vegetationlevel - - float vegetationlevel = (rawpos.z)+nvL[2]*3000.0; + //brings vegetation 'floor' only at vegetationlevel if (vegetationlevel < 2200) { c1 = mix(c2, c5, clamp(0.65, n*0.5, 0.4)); } + //draw (almost) bare peaks else { c1 = mix(c2, c5, clamp(0.65, n*0.5, 0.1)); } - //snow - c1 = mix(c1, clamp(n+nvL[2]*4.1+vec4(0.1, 0.1, nvL[2]*2.2, 1.0), 0.7, 1.0), smoothstep(snowlevel+300.0, snowlevel+360.0, (rawpos.z)+nvL[1]*3000.0)); + //adding snow and permanent snow/glacier + if (vegetationlevel > snowlevel || vegetationlevel > 3300) { + c3 = mix(vec4(n+0.94, n+0.94, n+1.0, 0.7), c1, smoothstep(0.990, 0.965, abs(normalize(Normal).z)+nvL[2]*1.3)); + c4 = mix(vec4(n+0.94, n+0.94, n+1.0, 0.7), c1, smoothstep(0.990, 0.965, abs(normalize(Normal).z)+nvL[2]*1.2)); + c5 = mix(c3, c4, 1.0); + c1 = mix(c1, c5, clamp(0.65, -n, 0.6)); + } + + //snow (just white color at the moment) + //c1 = mix(c1, clamp(n+nvL[2]*4.1+vec4(0.1, 0.1, nvL[2]*2.2, 1.0), 0.7, 1.0), smoothstep(snowlevel+300.0, snowlevel+360.0, (rawpos.z)+nvL[1]*3000.0)); vec3 diffuse = gl_Color.rgb * max(0.4, dot(VNormal, gl_LightSource[0].position.xyz)); vec4 ambient_light = gl_LightSource[0].diffuse * vec4(diffuse, 1.0); diff --git a/Textures/Terrain/glacier.png b/Textures/Terrain/glacier.png index fbdae1358..88fac8c1e 100644 Binary files a/Textures/Terrain/glacier.png and b/Textures/Terrain/glacier.png differ diff --git a/materials.xml b/materials.xml index a6d87a058..91473c7fc 100644 --- a/materials.xml +++ b/materials.xml @@ -2383,6 +2383,7 @@ Shared parameters for various materials. Glacier PolarIce + Effects/glacier Terrain/glacier1.png Terrain/glacier2.png Terrain/glacier3.png