Added vegetation level to the forest shader, at least for rock/forest in the
This commit is contained in:
parent
bead8c3486
commit
1286a77977
1 changed files with 12 additions and 2 deletions
|
@ -14,6 +14,7 @@ uniform float snowlevel; // From /sim/rendering/snow-level-m
|
||||||
|
|
||||||
const float scale = 1.0;
|
const float scale = 1.0;
|
||||||
|
|
||||||
|
|
||||||
void main (void)
|
void main (void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -56,8 +57,17 @@ 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));
|
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);
|
c5 = mix(c3, c4, 1.0);
|
||||||
|
|
||||||
//mix floor with texture right way
|
//brings vegetation 'floor', added vegetationlevel
|
||||||
|
|
||||||
|
float vegetationlevel = (rawpos.z)+nvL[2]*3000.0;
|
||||||
|
|
||||||
|
if (vegetationlevel < 2200) {
|
||||||
c1 = mix(c2, c5, clamp(0.65, n*0.5, 0.4));
|
c1 = mix(c2, c5, clamp(0.65, n*0.5, 0.4));
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
c1 = mix(c2, c5, clamp(0.65, n*0.5, 0.1));
|
||||||
|
}
|
||||||
|
|
||||||
//snow
|
//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));
|
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));
|
||||||
|
|
Loading…
Add table
Reference in a new issue