Skip to content
Snippets Groups Projects
Commit c4212ceb authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Merge branch 'DRTVWR-440' of https://bitbucket.org/lindenlab/viewer

parents f86cc78f 1370c6d0
No related branches found
No related tags found
No related merge requests found
...@@ -67,13 +67,28 @@ uniform vec4 cloud_color; ...@@ -67,13 +67,28 @@ uniform vec4 cloud_color;
uniform float cloud_scale; uniform float cloud_scale;
// NOTE: Keep these in sync!
// indra\newview\app_settings\shaders\class1\deferred\skyV.glsl
// indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl
// indra\newview\lllegacyatmospherics.cpp
void main() void main()
{ {
// World / view / projection // World / view / projection
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
// Texture coords
vary_texcoord0 = texcoord0; vary_texcoord0 = texcoord0;
vary_texcoord0.xy -= 0.5;
vary_texcoord0.xy /= cloud_scale;
vary_texcoord0.xy += 0.5;
vary_texcoord1 = vary_texcoord0;
vary_texcoord1.x += lightnorm.x * 0.0125;
vary_texcoord1.y += lightnorm.z * 0.0125;
vary_texcoord2 = vary_texcoord0 * 16.;
vary_texcoord3 = vary_texcoord1 * 16.;
// Get relative position // Get relative position
vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0); vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
...@@ -87,6 +102,7 @@ void main() ...@@ -87,6 +102,7 @@ void main()
} }
else else
{ {
altitude_blend_factor = 0; // SL-11589 Fix clouds drooping below horizon
P *= (-32000. / P.y); P *= (-32000. / P.y);
} }
...@@ -175,19 +191,6 @@ void main() ...@@ -175,19 +191,6 @@ void main()
vary_CloudDensity = 2. * (cloud_shadow - 0.25); vary_CloudDensity = 2. * (cloud_shadow - 0.25);
// Texture coords
vary_texcoord0 = texcoord0;
vary_texcoord0.xy -= 0.5;
vary_texcoord0.xy /= cloud_scale;
vary_texcoord0.xy += 0.5;
vary_texcoord1 = vary_texcoord0;
vary_texcoord1.x += lightnorm.x * 0.0125;
vary_texcoord1.y += lightnorm.z * 0.0125;
vary_texcoord2 = vary_texcoord0 * 16.;
vary_texcoord3 = vary_texcoord1 * 16.;
// Combine these to minimize register use // Combine these to minimize register use
vary_CloudColorAmbient += oHazeColorBelowCloud; vary_CloudColorAmbient += oHazeColorBelowCloud;
......
...@@ -57,6 +57,10 @@ uniform float sun_moon_glow_factor; ...@@ -57,6 +57,10 @@ uniform float sun_moon_glow_factor;
uniform vec4 cloud_color; uniform vec4 cloud_color;
// NOTE: Keep these in sync!
// indra\newview\app_settings\shaders\class1\deferred\skyV.glsl
// indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl
// indra\newview\lllegacyatmospherics.cpp
void main() void main()
{ {
......
...@@ -254,8 +254,7 @@ LLColor4 LLAtmospherics::calcSkyColorInDir(const LLSettingsSky::ptr_t &psky, Atm ...@@ -254,8 +254,7 @@ LLColor4 LLAtmospherics::calcSkyColorInDir(const LLSettingsSky::ptr_t &psky, Atm
F32 brightness = vars.hazeColor.brightness(); F32 brightness = vars.hazeColor.brightness();
F32 greyscale_sat = brightness * (1.0f - sky_saturation); F32 greyscale_sat = brightness * (1.0f - sky_saturation);
LLColor3 sky_color = vars.hazeColor * sky_saturation + smear(greyscale_sat); LLColor3 sky_color = vars.hazeColor * sky_saturation + smear(greyscale_sat);
//sky_color *= (0.5f + 0.5f * brightness); //sky_color *= (0.5f + 0.5f * brightness); // SL-12574 EEP sky is being attenuated too much
sky_color *= (0.85f + 0.15f*brightness); // SL-12574 EEP sky is being attenuated too much; brighten it slightly until calcSkyColorWLVert() is fixed to match Windlight
return LLColor4(sky_color, 0.0f); return LLColor4(sky_color, 0.0f);
} }
...@@ -265,6 +264,10 @@ LLColor4 LLAtmospherics::calcSkyColorInDir(const LLSettingsSky::ptr_t &psky, Atm ...@@ -265,6 +264,10 @@ LLColor4 LLAtmospherics::calcSkyColorInDir(const LLSettingsSky::ptr_t &psky, Atm
return LLColor4(sky_color, 0.0f); return LLColor4(sky_color, 0.0f);
} }
// NOTE: Keep these in sync!
// indra\newview\app_settings\shaders\class1\deferred\skyV.glsl
// indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl
// indra\newview\lllegacyatmospherics.cpp
void LLAtmospherics::calcSkyColorWLVert(const LLSettingsSky::ptr_t &psky, LLVector3 & Pn, AtmosphericsVars& vars) void LLAtmospherics::calcSkyColorWLVert(const LLSettingsSky::ptr_t &psky, LLVector3 & Pn, AtmosphericsVars& vars)
{ {
LLColor3 blue_density = vars.blue_density; LLColor3 blue_density = vars.blue_density;
...@@ -366,19 +369,18 @@ void LLAtmospherics::calcSkyColorWLVert(const LLSettingsSky::ptr_t &psky, LLVect ...@@ -366,19 +369,18 @@ void LLAtmospherics::calcSkyColorWLVert(const LLSettingsSky::ptr_t &psky, LLVect
// Haze color below cloud // Haze color below cloud
vars.hazeColorBelowCloud = (blue_factor * (sunlight + tmpAmbient) + componentMult(haze_factor, sunlight * temp2.mV[0] + tmpAmbient)); vars.hazeColorBelowCloud = (blue_factor * (sunlight + tmpAmbient) + componentMult(haze_factor, sunlight * temp2.mV[0] + tmpAmbient));
LLColor3 final_atten = LLColor3::white - temp1;
final_atten.mV[0] = llmax(final_atten.mV[0], 0.0f);
final_atten.mV[1] = llmax(final_atten.mV[1], 0.0f);
final_atten.mV[2] = llmax(final_atten.mV[2], 0.0f);
// Final atmosphere additive // Final atmosphere additive
componentMultBy(vars.hazeColor, LLColor3::white - temp1); componentMultBy(vars.hazeColor, LLColor3::white - temp1);
/*
// SL-12574
// Attenuate cloud color by atmosphere // Attenuate cloud color by atmosphere
temp1 = componentSqrt(temp1); //less atmos opacity (more transparency) below clouds temp1 = componentSqrt(temp1); //less atmos opacity (more transparency) below clouds
// At horizon, blend high altitude sky color towards the darker color below the clouds // At horizon, blend high altitude sky color towards the darker color below the clouds
vars.hazeColor += componentMult(vars.hazeColorBelowCloud - vars.hazeColor, LLColor3::white - componentSqrt(temp1)); vars.hazeColor += componentMult(vars.hazeColorBelowCloud - vars.hazeColor, LLColor3::white - componentSqrt(temp1));
*/
} }
void LLAtmospherics::updateFog(const F32 distance, const LLVector3& tosun_in) void LLAtmospherics::updateFog(const F32 distance, const LLVector3& tosun_in)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment