Merged in graham_linden/viewer-eep-graham (pull request #44)

MAINT-8951
meow-7.2.2
Rider Linden 2018-08-09 23:48:32 +00:00
commit 44e1d3f7dc
9 changed files with 17 additions and 44 deletions

View File

@ -43,7 +43,6 @@ uniform mat3 env_mat;
uniform mat3 ssao_effect_mat;
uniform vec3 sun_dir;
uniform vec3 moon_dir;
#if HAS_SHADOW
uniform sampler2DShadow shadowMap0;
@ -286,12 +285,9 @@ void main()
calcFragAtmospherics(pos.xyz, 1.0, sunlit, amblit, additive, atten);
vec2 abnormal = encode_normal(norm.xyz);
norm.xyz = decode_normal(abnormal.xy);
norm.xyz = decode_normal(abnormal.xy);
float da_sun = dot(norm.xyz, sun_dir.xyz);
float da_moon = dot(norm.xyz, moon_dir.xyz);
float da = max(da_sun, da_moon);
float da = dot(norm.xyz, sun_dir.xyz);
float final_da = da;
final_da = min(final_da, shadow);

View File

@ -98,7 +98,6 @@ uniform mat3 env_mat;
uniform mat3 ssao_effect_mat;
uniform vec3 sun_dir;
uniform vec3 moon_dir;
VARYING vec2 vary_fragcoord;
VARYING vec3 vary_position;
@ -389,9 +388,7 @@ void main()
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
float da_sun =dot(norm.xyz, sun_dir.xyz);
float da_moon =dot(norm.xyz, moon_dir.xyz);
float da = max(da_sun, da_moon);
float da =dot(norm.xyz, sun_dir.xyz);
float final_da = da;
final_da = min(final_da, shadow);
@ -421,9 +418,7 @@ void main()
// the old infinite-sky shiny reflection
//
float sa_sun = dot(refnormpersp, sun_dir.xyz);
float sa_moon = dot(refnormpersp, moon_dir.xyz);
float sa = max(sa_sun, sa_moon);
float sa = dot(refnormpersp, sun_dir.xyz);
vec3 dumbshiny = sunlit*shadow*(texture2D(lightFunc, vec2(sa, spec.a)).r);

View File

@ -56,7 +56,6 @@ uniform mat3 env_mat;
uniform mat3 ssao_effect_mat;
uniform vec3 sun_dir;
uniform vec3 moon_dir;
VARYING vec2 vary_fragcoord;
uniform mat4 inv_proj;
@ -107,9 +106,7 @@ void main()
float envIntensity = norm.z;
norm.xyz = decode_normal(norm.xy); // unpack norm
float da_sun = dot(norm.xyz, sun_dir.xyz);
float da_moon = dot(norm.xyz, moon_dir.xyz);
float da = max(da_sun, da_moon);
float da = dot(norm.xyz, sun_dir.xyz);
float final_da = max(0.0,da);
final_da = min(final_da, 1.0f);
@ -151,9 +148,7 @@ void main()
// the old infinite-sky shiny reflection
//
float sa_sun = dot(refnormpersp, sun_dir.xyz);
float sa_moon = dot(refnormpersp, moon_dir.xyz);
float sa = max(sa_sun, sa_moon);
float sa = dot(refnormpersp, sun_dir.xyz);
vec3 dumbshiny = sunlit*(texture2D(lightFunc, vec2(sa, spec.a)).r);

View File

@ -67,7 +67,6 @@ uniform vec4 shadow_clip;
uniform mat3 ssao_effect_mat;
uniform vec3 sun_dir;
uniform vec3 moon_dir;
VARYING vec2 vary_fragcoord;
uniform mat4 inv_proj;
@ -117,9 +116,7 @@ void main()
float envIntensity = norm.z;
norm.xyz = decode_normal(norm.xy); // unpack norm
float da_sun = max(dot(norm.xyz, sun_dir.xyz), 0.0);
float da_moon = max(dot(norm.xyz, moon_dir.xyz), 0.0);
float da = max(da_sun, da_moon);
float da = max(dot(norm.xyz, sun_dir.xyz), 0.0);
float light_gamma = 1.0/1.3;
da = pow(da, light_gamma);
@ -170,9 +167,7 @@ void main()
// the old infinite-sky shiny reflection
//
float sa_sun = dot(refnormpersp, sun_dir.xyz);
float sa_moon = dot(refnormpersp, moon_dir.xyz);
float sa = max(sa_sun, sa_moon);
float sa = dot(refnormpersp, sun_dir.xyz);
vec3 dumbshiny = sunlit*scol_ambocc.r*(texture2D(lightFunc, vec2(sa, spec.a)).r);
// add the two types of shiny together

View File

@ -59,7 +59,6 @@ uniform mat4 inv_proj;
uniform vec2 screen_res;
uniform vec2 proj_shadow_res;
uniform vec3 sun_dir;
uniform vec3 moon_dir;
uniform vec2 shadow_res;
uniform float shadow_bias;
@ -140,14 +139,10 @@ void main()
}*/
float shadow = 0.0;
float da_sun = dot(norm, sun_dir.xyz);
float da_moon = dot(norm, moon_dir.xyz);
float da = max(da_sun, da_moon);
float dp_directional_light = max(0.0, da);
float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz));
vec3 shadow_pos = pos.xyz;
vec3 offset = ((da_sun > da_moon) ? sun_dir.xyz : moon_dir.xyz) * (1.0-dp_directional_light);
vec3 offset = sun_dir.xyz * (1.0-dp_directional_light);
vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0);

View File

@ -59,7 +59,6 @@ uniform mat4 inv_proj;
uniform vec2 screen_res;
uniform vec2 proj_shadow_res;
uniform vec3 sun_dir;
uniform vec3 moon_dir;
uniform vec2 shadow_res;
@ -201,13 +200,10 @@ void main()
}*/
float shadow = 0.0;
float da_sun = dot(norm, sun_dir.xyz);
float da_moon = dot(norm, moon_dir.xyz);
float da = max(da_sun, da_moon);
float dp_directional_light = max(0.0, da);
float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz));
vec3 shadow_pos = pos.xyz;
vec3 offset = ((da_sun > da_moon) ? sun_dir.xyz : moon_dir.xyz) * (1.0-dp_directional_light);
vec3 offset = sun_dir.xyz * (1.0-dp_directional_light);
vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0);

View File

@ -34,7 +34,6 @@ in vec3 view_dir;
uniform vec3 cameraPosLocal;
uniform vec3 sun_dir;
uniform vec3 moon_dir;
uniform float sun_size;
uniform sampler2D transmittance_texture;

View File

@ -33,7 +33,6 @@ in vec3 view_dir;
uniform vec3 cameraPosLocal;
uniform vec3 sun_dir;
uniform vec3 moon_dir;
uniform float sun_size;
uniform sampler2D transmittance_texture;

View File

@ -1418,8 +1418,11 @@ void LLVOSky::updateReflectionGeometry(LLDrawable *drawable, F32 H,
void LLVOSky::updateFog(const F32 distance)
{
LLEnvironment& environment = LLEnvironment::instance();
LLVector3 light_dir = LLVector3(environment.getClampedLightNorm());
m_legacyAtmospherics.updateFog(distance, light_dir);
if (environment.getCurrentSky() != nullptr)
{
LLVector3 light_dir = LLVector3(environment.getClampedLightNorm());
m_legacyAtmospherics.updateFog(distance, light_dir);
}
}
void LLVOSky::setSunAndMoonDirectionsCFR(const LLVector3 &sun_dir_cfr, const LLVector3 &moon_dir_cfr)