Merged in graham_linden/viewer-eep-g (pull request #391)

SL-10996, SL-11149
meow-7.2.2
Graham Madarasz 2019-05-13 20:57:11 +00:00
commit 5196b7eac9
9 changed files with 810 additions and 871 deletions

View File

@ -50,7 +50,7 @@ float pcfShadow(sampler2DShadow shadowMap, vec3 norm, vec4 stc, float bias_mul,
{
float offset = shadow_bias * bias_mul;
stc.xyz /= stc.w;
stc.z += offset * 3.0;
stc.z += offset * 2.0;
stc.x = floor(stc.x*shadow_res.x + fract(pos_screen.y*shadow_res.y))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here
float cs = shadow2D(shadowMap, stc.xyz).x;
float shadow = cs * 4.0;

View File

@ -157,6 +157,6 @@ void main()
vec3 screenspacewavef = normalize((norm_mat*vec4(wavef, 1.0)).xyz);
frag_data[0] = vec4(color.rgb, 0); // diffuse
frag_data[1] = vec4(specular * 0.15, 0.5); // speccolor, spec
frag_data[1] = vec4(specular * 0.5, 0.5); // speccolor, spec
frag_data[2] = vec4(encode_normal(screenspacewavef.xyz), 0.05, 0);// normalxy, 0, 0
}

View File

@ -190,11 +190,10 @@ vec3 post_atmo = color.rgb;
bloom = fogged.a;
#endif
// srgb colorspace debuggables
//color.rgb = amblit;
//color.rgb = vec3(ambient);
//color.rgb = sunlit;
//color.rgb = post_ambient;
//color.rgb = vec3(final_da);
//color.rgb = sun_contrib;
//color.rgb = post_sunlight;
//color.rgb = diffuse_srgb.rgb;
@ -208,6 +207,11 @@ vec3 post_atmo = color.rgb;
color.rgb = srgb_to_linear(color.rgb);
}
// linear debuggables
//color.rgb = vec3(final_da);
//color.rgb = vec3(ambient);
//color.rgb = vec3(scol);
frag_color.rgb = color.rgb;
frag_color.a = bloom;
}

View File

@ -22,8 +22,6 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
// VARYING param funcs
void setSunlitColor(vec3 v);

View File

@ -51,11 +51,11 @@ vec3 atmosTransport(vec3 light)
vec3 fullbrightAtmosTransport(vec3 light)
{
float brightness = dot(light.rgb, vec3(0.33333));
return atmosTransportFrag(light, getAdditiveColor() * (brightness * 0.5 + 0.5), getAtmosAttenuation());
return atmosTransportFrag(light * 0.5, getAdditiveColor() * (brightness * 0.5 + 0.5), getAtmosAttenuation());
}
vec3 fullbrightShinyAtmosTransport(vec3 light)
{
float brightness = dot(light.rgb, vec3(0.33333));
return atmosTransportFrag(light, getAdditiveColor() * (brightness * 0.5 + 0.5), getAtmosAttenuation());
return atmosTransportFrag(light * 0.5, getAdditiveColor() * (brightness * brightness), getAtmosAttenuation());
}

View File

@ -37,22 +37,29 @@ 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;
uniform mat3 ssao_effect_mat;
uniform int no_atmo;
uniform float sun_moon_glow_factor;
vec3 scaleSoftClipFrag(vec3 light);
vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten)
{
light *= atten.r;
light += additive;
return (2.0 * light);
if (no_atmo == 1)
{
return light;
}
light *= atten.r;
light += additive;
return light * 2.0;
}
vec3 atmosLighting(vec3 light)
{
return atmosFragLighting(light, getAdditiveColor(), getAtmosAttenuation());
}

View File

@ -35,10 +35,12 @@ uniform int no_atmo;
vec3 atmosTransportFrag(vec3 light, vec3 additive, vec3 atten)
{
if (no_atmo == 1)
{
{
return light;
}
return (light + additive) * atten * 2.0;
light *= atten.r;
light += additive;
return light * 2.0;
}
vec3 atmosTransport(vec3 light)
@ -48,10 +50,12 @@ vec3 atmosTransport(vec3 light)
vec3 fullbrightAtmosTransport(vec3 light)
{
return atmosTransportFrag(light, getAdditiveColor(), getAtmosAttenuation());
float brightness = dot(light.rgb, vec3(0.33333));
return atmosTransportFrag(light * 0.5, getAdditiveColor() * (brightness * 0.5 + 0.5), getAtmosAttenuation());
}
vec3 fullbrightShinyAtmosTransport(vec3 light)
{
return atmosTransportFrag(light, getAdditiveColor(), getAtmosAttenuation());
float brightness = dot(light.rgb, vec3(0.33333));
return atmosTransportFrag(light * 0.5, getAdditiveColor() * (brightness * brightness), getAtmosAttenuation());
}

View File

@ -207,10 +207,14 @@ void LLSkyTex::create(const F32 brightness)
void LLSkyTex::createGLImage(S32 which)
{
if (LLPipeline::RenderDeferred) {
#if USE_SRGB_DECODE
if (LLPipeline::RenderDeferred)
{
mTexture[which]->setExplicitFormat(GL_SRGB8_ALPHA8, GL_RGBA);
}
else {
else
#endif
{
mTexture[which]->setExplicitFormat(GL_RGBA8, GL_RGBA);
}
mTexture[which]->createGLTexture(0, mImageRaw[which], 0, TRUE, LLGLTexture::LOCAL);

File diff suppressed because it is too large Load Diff