diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/skyV.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/skyV.glsl | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl index 6db4690bff..17ce2dee5b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl @@ -25,26 +25,26 @@ uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; +in vec3 position; // SKY //////////////////////////////////////////////////////////////////////// // The vertex shader for creating the atmospheric sky /////////////////////////////////////////////////////////////////////////////// // Output parameters -VARYING vec4 vary_HazeColor; -VARYING float vary_LightNormPosDot; +out vec3 vary_HazeColor; +out float vary_LightNormPosDot; // Inputs uniform vec3 camPosLocal; -uniform vec4 lightnorm; -uniform vec4 sunlight_color; -uniform vec4 moonlight_color; +uniform vec3 lightnorm; +uniform vec3 sunlight_color; +uniform vec3 moonlight_color; uniform int sun_up_factor; -uniform vec4 ambient_color; -uniform vec4 blue_horizon; -uniform vec4 blue_density; +uniform vec3 ambient_color; +uniform vec3 blue_horizon; +uniform vec3 blue_density; uniform float haze_horizon; uniform float haze_density; @@ -53,10 +53,10 @@ uniform float density_multiplier; uniform float distance_multiplier; uniform float max_y; -uniform vec4 glow; +uniform vec3 glow; uniform float sun_moon_glow_factor; -uniform vec4 cloud_color; +uniform int cube_snapshot; // NOTE: Keep these in sync! // indra\newview\app_settings\shaders\class1\deferred\skyV.glsl @@ -91,16 +91,16 @@ void main() vary_LightNormPosDot = rel_pos_lightnorm_dot; // Initialize temp variables - vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color; - + vec3 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color * 0.7; //magic 0.7 to match legacy color + // Sunlight attenuation effect (hue and brightness) due to atmosphere // this is used later for sunlight modulation at various altitudes - vec4 light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y); + vec3 light_atten = (blue_density + vec3(haze_density * 0.25)) * (density_multiplier * max_y); // Calculate relative weights - vec4 combined_haze = abs(blue_density) + vec4(abs(haze_density)); - vec4 blue_weight = blue_density / combined_haze; - vec4 haze_weight = haze_density / combined_haze; + vec3 combined_haze = abs(blue_density) + vec3(abs(haze_density)); + vec3 blue_weight = blue_density / combined_haze; + vec3 haze_weight = haze_density / combined_haze; // Compute sunlight from rel_pos & lightnorm (for long rays like sky) float off_axis = 1.0 / max(1e-6, max(0., rel_pos_norm.y) + lightnorm.y); @@ -129,20 +129,20 @@ void main() haze_glow = (sun_moon_glow_factor < 1.0) ? 0.0 : (sun_moon_glow_factor * (haze_glow + 0.25)); // Haze color above cloud - vec4 color = (blue_horizon * blue_weight * (sunlight + ambient_color) + vec3 color = (blue_horizon * blue_weight * (sunlight + ambient_color) + (haze_horizon * haze_weight) * (sunlight * haze_glow + ambient_color)); // Final atmosphere additive color *= (1. - combined_haze); // Increase ambient when there are more clouds - vec4 ambient = ambient_color + max(vec4(0), (1. - ambient_color)) * cloud_shadow * 0.5; + vec3 ambient = ambient_color + max(vec3(0), (1. - ambient_color)) * cloud_shadow * 0.5; // Dim sunlight by cloud shadow percentage sunlight *= max(0.0, (1. - cloud_shadow)); // Haze color below cloud - vec4 add_below_cloud = (blue_horizon * blue_weight * (sunlight + ambient) + vec3 add_below_cloud = (blue_horizon * blue_weight * (sunlight + ambient) + (haze_horizon * haze_weight) * (sunlight * haze_glow + ambient)); // Attenuate cloud color by atmosphere |