1
0
Fork 0

Basic ALS + AW infrastructure to use new cloud transparency parameter

This commit is contained in:
Thorsten Renk 2014-11-16 12:28:09 +02:00
parent 77e382be75
commit 4e9ba3e560
5 changed files with 16 additions and 8 deletions

View file

@ -57,8 +57,8 @@
<wrap-t>clamp</wrap-t>
</texture-unit>
<program>
<vertex-shader>Shaders/3dcloud-lightfield.vert</vertex-shader>
<fragment-shader>Shaders/3dcloud-lightfield.frag</fragment-shader>
<vertex-shader>Shaders/3dcloud-ALS.vert</vertex-shader>
<fragment-shader>Shaders/3dcloud-ALS.frag</fragment-shader>
<attribute>
<name>usrAttr1</name>
<index>10</index>

View file

@ -655,6 +655,7 @@ var p = props.Node.new({ "layer" : 0,
"min-bottom-lighting-factor": c.bottom_shade,
"min-middle-lighting-factor": c.middle_shade,
"min-top-lighting-factor": c.top_shade,
"alpha-factor": c.alpha_factor,
"min-shade-lighting-factor": c.bottom_shade,
"texture": c.texture_sheet,
"num-textures-x": c.num_tex_x,

View file

@ -1553,6 +1553,7 @@ if (path == "new") # we have to switch to new cloud generating routines
local_weather.cloudAssembly.lon = lon;
local_weather.cloudAssembly.alt = alt;
local_weather.cloudAssembly.top_shade = top_shade;
local_weather.cloudAssembly.alpha_factor = alpha_factor;
#print(lat," ",long, " ", alt);
@ -3382,22 +3383,22 @@ var v2 = v0 * (1.2 + rand() * 0.2);
var d2 = d0 + dsign * (3.0 * rand() + 2.0);
var v3 = v0 * (1.3 + rand() * 0.4) + 5.0;
var d3 = d0 + dsign * (3.0 * rand() + dsign * 4.0);
var d3 = d0 + dsign * (3.0 * rand() + 4.0);
var v4 = v0 * (1.7 + rand() * 0.5) + 10.0;
var d4 = d0 + dsign * (4.0 * rand() + dsign * 8.0);
var d4 = d0 + dsign * (4.0 * rand() + 8.0);
var v5 = v0 * (1.7 + rand() * 0.5) + 20.0;
var d5 = d0 + dsign * (4.0 * rand() + dsign * 10.0);
var d5 = d0 + dsign * (4.0 * rand() + 10.0);
var v6 = v0 * (1.7 + rand() * 0.5) + 40.0;
var d6 = d0 + dsign * (4.0 * rand() + dsign * 12.0);
var d6 = d0 + dsign * (4.0 * rand() + 12.0);
var v7 = v0 * (2.0 + rand() * 0.7) + 50.0;
var d7 = d0 + dsign * (4.0 * rand() + dsign * 13.0);
var d7 = d0 + dsign * (4.0 * rand() + 13.0);
var v8 = v0 * (2.0 + rand() * 0.7) + 55.0;;
var d8 = d0 + dsign * (5.0 * rand() + dsign * 14.0);
var d8 = d0 + dsign * (5.0 * rand() + 14.0);
var w = windIpoint.new(lat, lon, d0, v0, d1, v1, d2, v2, d3, v3, d4, v4, d5, v5, d6, v6, d7, v7, d8, v8);
@ -4563,6 +4564,10 @@ if (lowest_layer_turbulence < 0.0) {lowest_layer_turbulence = 0.0;}
var top_shade = 1.0;
# global cloud transparency
var alpha_factor = 1.0;
# global cloud size scale;
var cloud_size_scale = 1.0;

View file

@ -17,6 +17,7 @@ uniform float air_pollution;
attribute vec3 usrAttr1;
attribute vec3 usrAttr2;
float alpha_factor = usrAttr1.r;
float shade_factor = usrAttr1.g;
float cloud_height = usrAttr1.b;
float bottom_factor = usrAttr2.r;
@ -237,6 +238,7 @@ void main(void)
gl_FrontColor.rgb = gl_FrontColor.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
hazeColor.rgb = hazeColor.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
gl_FrontColor.a = gl_FrontColor.a * alpha_factor;
gl_BackColor = gl_FrontColor;
}
}