diff options
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/materialF.glsl | 22 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class2/windlight/transportF.glsl | 9 |
2 files changed, 22 insertions, 9 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index a7dce5c7a5..e640c2d7ae 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -276,20 +276,26 @@ void main() final_color.a = max(final_color.a, emissive_brightness); - // SL-11406 Fullbright: Object > Texture > Shininess > Environment Intensity + // SL-11406 Fullbright: Object > Texture > Shininess > Environment Intensity = 1 + // NOTE: There are two shaders that are used depending on the EI byte value: + // EI = 0 fullbright + // EI > 0 .. 255 material + // When it is passed to us it is normalized. // We can either modify the output environment intensity // OR - // adjust the final color via + // adjust the final color via: // final_color *= 0.666666; - // We remap the environment intensity to simulate what non-EEP is doing. + // We remap the environment intensity to closely simulate what non-EEP is doing. + // At midnight the brightness is exact. + // At midday the brightness is very close. float ei = env_intensity*0.5 + 0.5; vec4 final_normal = vec4(abnormal, ei, 0.0); vec4 final_specular = spec; final_specular.a = specular_color.a; -#if HAS_SPECULAR_MAP - final_specular.a *= norm.a; +#ifdef HAS_SPECULAR_MAP + final_specular.a *= norm.a; final_normal.z *= spec.a; #endif @@ -323,11 +329,10 @@ void main() float da = dot(norm.xyz, normalize(light_dir.xyz)); - // Dot product is guaranteed to be in -1 < dot() < +1 range for normalized vectors + // Dot product is guaranteed to be in -1 <= da <= +1 range for normalized vectors // da = clamp(da, -1.0, 1.0); - float final_da = da; - final_da = clamp(final_da, 0.0, 1.0); + float final_da = clamp(da, 0.0, 1.0); float ambient = da; ambient *= 0.5; @@ -465,3 +470,4 @@ vec3 post_atmo = color.rgb; #endif } + diff --git a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl index d2d839ed05..a06f4f22ad 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl @@ -51,7 +51,14 @@ vec3 atmosTransport(vec3 light) vec3 fullbrightAtmosTransport(vec3 light) { float brightness = dot(light.rgb * 0.5, vec3(0.3333)) + 0.1; - return atmosTransportFrag(light * 0.5, getAdditiveColor() * brightness, getAtmosAttenuation()); + vec3 attenColor = atmosTransportFrag(light * 0.5, getAdditiveColor() * brightness, getAtmosAttenuation()); + + // attenColor is an accurate fog-attenuated result for any brightness + // But, the pre-EEP shader included a brightness-indexed lerp to a non-attenuated version + // of the color - effectively a fog 'burn-through' for very bright pixels. To more closely + // match the pre-EEP behavior, we'll also lerp to the pre-EEP color, based on overall brightness + float preEepBright = dot(light.rgb, vec3(0.3333)); + retun mix(attenColor, (light.rgb + getAdditiveColor().rgb) * (2.0 - preEepBright), preEepBright * preEepBright); } vec3 fullbrightShinyAtmosTransport(vec3 light) |