Merge viewer-eep

meow-7.2.2
Ansariel 2019-05-09 18:48:19 +02:00
commit 95baae0235
16 changed files with 59 additions and 46 deletions

View File

@ -122,7 +122,7 @@ const S32 LLSettingsDay::FRAME_MAX(56);
const F32 LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR(0.02501f);
const LLUUID LLSettingsDay::DEFAULT_ASSET_ID("78751d18-6c51-3c43-2887-3654cd427a42");
const LLUUID LLSettingsDay::DEFAULT_ASSET_ID("5646d39e-d3d7-6aff-ed71-30fc87d64a91");
// Minimum value to prevent multislider in edit floaters from eating up frames that 'encroach' on one another's space
static const F32 DEFAULT_MULTISLIDER_INCREMENT(0.005f);

View File

@ -953,21 +953,8 @@ void LLSettingsSky::updateSettings()
F32 LLSettingsSky::getSunMoonGlowFactor() const
{
// sun glow at full iff moon is not up
if (getIsSunUp())
{
if (!getIsMoonUp())
{
return 1.0f;
}
}
if (getIsMoonUp())
{
return 0.25f;
}
return 0.0f;
return getIsSunUp() ? 1.0f :
getIsMoonUp() ? getMoonBrightness() * 0.25 : 0.0f;
}
bool LLSettingsSky::getIsSunUp() const
@ -1302,7 +1289,7 @@ void LLSettingsSky::calculateLightSettings() const
mMoonDiffuse = gammaCorrect(componentMult(moonlight, light_transmittance) * moon_brightness);
mMoonAmbient = gammaCorrect(componentMult(moonlight_b, light_transmittance) * 0.0125f);
mTotalAmbient = mSunAmbient + mMoonAmbient;
mTotalAmbient = mSunAmbient;
}
LLUUID LLSettingsSky::GetDefaultAssetId()

View File

@ -1258,6 +1258,7 @@ void LLRender::syncLightState()
shader->uniform3fv(LLShaderMgr::LIGHT_DIFFUSE, 8, diffuse[0].mV);
shader->uniform4fv(LLShaderMgr::LIGHT_AMBIENT, 1, mAmbientLightColor.mV);
shader->uniform1i(LLShaderMgr::SUN_UP_FACTOR, sun_primary[0] ? 1 : 0);
shader->uniform4fv(LLShaderMgr::SUNLIGHT_COLOR, 1, diffuse[0].mV);
shader->uniform4fv(LLShaderMgr::MOONLIGHT_COLOR, 1, diffuse_b[0].mV);
}
}

View File

@ -99,7 +99,8 @@ void main()
vec4 temp2 = vec4(0.);
vec4 blue_weight;
vec4 haze_weight;
vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
//vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
vec4 sunlight = sunlight_color;
vec4 light_atten;
float dens_mul = density_multiplier * 0.45;
@ -156,8 +157,6 @@ void main()
);
// CLOUDS
sunlight = sunlight_color;
temp2.y = max(0., lightnorm.y * 2.);
temp2.y = 1. / temp2.y;
sunlight *= exp( - light_atten * temp2.y);

View File

@ -110,9 +110,9 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen)
float w = 1.0;
w -= max(spos.z-far_split.z, 0.0)/transition_domain.z;
w = clamp(w, 0.0, 1.0);
//w = clamp(w, 0.0, 1.0);
float contrib = pcfShadow(shadowMap3, norm, lpos, 1.0, pos_screen, light_dir)*w;
if (contrib > 0)
//if (contrib > 0)
{
shadow += contrib;
weight += w;
@ -127,9 +127,9 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen)
float w = 1.0;
w -= max(spos.z-far_split.y, 0.0)/transition_domain.y;
w -= max(near_split.z-spos.z, 0.0)/transition_domain.z;
w = clamp(w, 0.0, 1.0);
//w = clamp(w, 0.0, 1.0);
float contrib = pcfShadow(shadowMap2, norm, lpos, 1.0, pos_screen, light_dir)*w;
if (contrib > 0)
//if (contrib > 0)
{
shadow += contrib;
weight += w;
@ -143,9 +143,9 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen)
float w = 1.0;
w -= max(spos.z-far_split.x, 0.0)/transition_domain.x;
w -= max(near_split.y-spos.z, 0.0)/transition_domain.y;
w = clamp(w, 0.0, 1.0);
//w = clamp(w, 0.0, 1.0);
float contrib = pcfShadow(shadowMap1, norm, lpos, 1.0, pos_screen, light_dir)*w;
if (contrib > 0)
//if (contrib > 0)
{
shadow += contrib;
weight += w;
@ -158,9 +158,9 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen)
float w = 1.0;
w -= max(near_split.x-spos.z, 0.0)/transition_domain.x;
w = clamp(w, 0.0, 1.0);
//w = clamp(w, 0.0, 1.0);
float contrib = pcfShadow(shadowMap0, norm, lpos, 1.0, pos_screen, light_dir)*w;
if (contrib > 0)
//if (contrib > 0)
{
shadow += contrib;
weight += w;

View File

@ -153,6 +153,10 @@ vec3 post_diffuse = color.rgb;
vec3 post_spec = color.rgb;
#ifndef WATER_FOG
color.rgb += diffuse_srgb.a * diffuse_srgb.rgb;
#endif
if (envIntensity > 0.0)
{ //add environmentmap
vec3 env_vec = env_mat * refnormpersp;

View File

@ -32,7 +32,7 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color);
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color)
{
vec4 c = sumLights(pos, norm, color);
c.rgb += atmosAmbient() * color.rgb;
c.rgb += atmosAmbient() * color.rgb * 0.5;
return c;
}

View File

@ -68,7 +68,7 @@ void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, o
vec4 light_atten;
float dens_mul = density_multiplier;
float dist_mul = distance_multiplier * 0.1;
float dist_mul = distance_multiplier;
//sunlight attenuation effect (hue and brightness) due to atmosphere
//this is used later for sunlight modulation at various altitudes

View File

@ -44,6 +44,7 @@ uniform float haze_density;
uniform float cloud_shadow;
uniform float density_multiplier;
uniform float distance_multiplier;
uniform float max_y;
uniform vec4 glow;
@ -117,7 +118,8 @@ void main()
vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
vec4 light_atten;
float dens_mul = density_multiplier * 0.45;
float dens_mul = density_multiplier;
float dist_mul = distance_multiplier;
// Sunlight attenuation effect (hue and brightness) due to atmosphere
// this is used later for sunlight modulation at various altitudes
@ -139,8 +141,7 @@ void main()
// Transparency (-> temp1)
// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
// compiler gets confused.
temp1 = exp(-temp1 * temp2.z);
temp1 = exp(-temp1 * temp2.z * dist_mul);
// Compute haze glow
temp2.x = dot(Pn, lightnorm.xyz);

View File

@ -163,6 +163,10 @@ vec3 post_diffuse = color.rgb;
vec3 post_spec = color.rgb;
#ifndef WATER_FOG
color.rgb += diffuse_srgb.a * diffuse_srgb.rgb;
#endif
if (envIntensity > 0.0)
{ //add environmentmap
vec3 env_vec = env_mat * refnormpersp;

View File

@ -37,6 +37,8 @@ uniform vec4 blue_density;
uniform float haze_horizon;
uniform float haze_density;
uniform float cloud_shadow;
uniform float density_multiplier;
uniform float distance_multiplier;
uniform float max_y;
uniform vec4 glow;
uniform float scene_light_strength;
@ -53,7 +55,7 @@ vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten)
return light;
}
light *= atten.r;
light += additive * exp(-1.0f);
light += additive;
return light * 2.0;
}

View File

@ -86,14 +86,14 @@ void main()
vec2 disturbance2 = vec2(cloudNoise((uv1 + uv3) / 4.0f).x, cloudNoise((uv4 + uv2) / 8.0f).x) * cloud_variance * (1.0f - cloud_scale * 0.25f);
// Offset texture coords
uv1 += cloud_pos_density1.xy;// + (disturbance * 0.02); //large texture, visible density
uv1 += cloud_pos_density1.xy + (disturbance * 0.02); //large texture, visible density
uv2 += cloud_pos_density1.xy; //large texture, self shadow
uv3 += cloud_pos_density2.xy; //small texture, visible density
uv4 += cloud_pos_density2.xy; //small texture, self shadow
float density_variance = min(1.0, (disturbance.x* 2.0 + disturbance.y* 2.0 + disturbance2.x + disturbance2.y));
//cloudDensity *= 1.0 - (density_variance * density_variance);
cloudDensity *= 1.0 - (density_variance * density_variance);
// Compute alpha1, the main cloud opacity
@ -104,7 +104,7 @@ void main()
alpha1 = 1. - alpha1 * alpha1;
alpha1 = 1. - alpha1 * alpha1;
//alpha1 *= altitude_blend_factor;
alpha1 *= altitude_blend_factor;
//if (alpha1 < 0.001f)
//{

View File

@ -57,6 +57,7 @@ uniform float haze_density;
uniform float cloud_shadow;
uniform float density_multiplier;
uniform float distance_multiplier;
uniform float max_y;
uniform vec4 glow;
@ -100,10 +101,12 @@ void main()
vec4 temp2 = vec4(0.);
vec4 blue_weight;
vec4 haze_weight;
vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
//vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
vec4 sunlight = sunlight_color;
vec4 light_atten;
float dens_mul = density_multiplier * 0.45;
float dens_mul = density_multiplier;
float dist_mul = distance_multiplier;
// Sunlight attenuation effect (hue and brightness) due to atmosphere
// this is used later for sunlight modulation at various altitudes
@ -125,8 +128,7 @@ void main()
// Transparency (-> temp1)
// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
// compiler gets confused.
temp1 = exp(-temp1 * temp2.z);
temp1 = exp(-temp1 * temp2.z * dist_mul);
// Compute haze glow
temp2.x = dot(Pn, lightnorm.xyz);

View File

@ -49,6 +49,7 @@ uniform float haze_density;
uniform float cloud_shadow;
uniform float density_multiplier;
uniform float distance_multiplier;
uniform float max_y;
uniform vec4 glow;
@ -109,7 +110,7 @@ void main()
// Transparency (-> temp1)
// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
// compiler gets confused.
temp1 = exp(-temp1 * temp2.z);
temp1 = exp(-temp1 * temp2.z * distance_multiplier);
// Compute haze glow

View File

@ -31,8 +31,8 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color);
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color)
{
vec4 c = sumLights(pos, norm, color * 2.0);
vec4 c = sumLights(pos, norm, color);
c.rgb += atmosAmbient() * color.rgb;
return c * 2.0;
return c;
}

View File

@ -6345,7 +6345,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
gGL.setAmbientLightColor(ambient);
}
bool sun_up = environment.getIsSunUp();
bool sun_up = environment.getIsSunUp();
bool moon_up = environment.getIsMoonUp();
// Light 0 = Sun or Moon (All objects)
{
@ -6354,7 +6355,9 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
mSunDir.setVec(sun_dir);
mMoonDir.setVec(moon_dir);
mSunDiffuse.setVec(psky->getSunDiffuse());
// calculates diffuse sunlight per-pixel downstream, just provide setting sunlight_color
mSunDiffuse.setVec(psky->getSunlightColor());
mMoonDiffuse.setVec(psky->getMoonDiffuse());
F32 max_color = llmax(mSunDiffuse.mV[0], mSunDiffuse.mV[1], mSunDiffuse.mV[2]);
@ -6371,6 +6374,15 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
}
mMoonDiffuse.clamp();
// prevent underlighting from having neither lightsource facing us
if (!sun_up && !moon_up)
{
mSunDiffuse.setVec(LLColor4(0.0, 0.0, 0.0, 1.0));
mMoonDiffuse.setVec(LLColor4(0.0, 0.0, 0.0, 1.0));
mSunDir.setVec(LLVector4(0.0, 1.0, 0.0, 0.0));
mMoonDir.setVec(LLVector4(0.0, 1.0, 0.0, 0.0));
}
LLVector4 light_dir = sun_up ? mSunDir : mMoonDir;
mHWLightColors[0] = mSunDiffuse;