diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class3')
5 files changed, 12 insertions, 27 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl index 7d8f9c218d..0fb30559d4 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl @@ -37,7 +37,6 @@ uniform sampler2D depthMap; uniform sampler2D diffuseRect; uniform sampler2D specularRect; uniform sampler2D emissiveRect; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl -uniform sampler2D noiseMap; uniform sampler2D lightFunc; uniform vec3 env_mat[3]; @@ -132,9 +131,6 @@ void main() } else { - - float noise = texture2D(noiseMap, tc).b; - diffuse = srgb_to_linear(diffuse); spec.rgb = srgb_to_linear(spec.rgb); @@ -154,7 +150,6 @@ void main() float fa = light_col[i].a; float dist_atten = calcLegacyDistanceAttenuation(dist, fa); - dist_atten *= noise; float lit = nl * dist_atten; diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl index 5ed8a75e0e..30b7895157 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl @@ -41,7 +41,6 @@ uniform sampler2D normalMap; uniform sampler2D emissiveRect; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl uniform samplerCube environmentMap; uniform sampler2D lightMap; -uniform sampler2D noiseMap; uniform sampler2D projectionMap; // rgba uniform sampler2D lightFunc; @@ -187,7 +186,6 @@ void main() diffuse = srgb_to_linear(diffuse); spec.rgb = srgb_to_linear(spec.rgb); - float noise = texture2D(noiseMap, tc).b; if (proj_tc.z > 0.0 && proj_tc.x < 1.0 && proj_tc.y < 1.0 && @@ -199,7 +197,7 @@ void main() if (nl > 0.0) { - lit = nl * dist_atten * noise; + lit = nl * dist_atten; dlit = getProjectedLightDiffuseColor( l_dist, proj_tc.xy ); @@ -209,7 +207,7 @@ void main() amb_da += (nl*0.5+0.5) /* * (1.0-shadow) */ * proj_ambiance; } - amb_rgb = getProjectedLightAmbiance( amb_da, dist_atten, lit, nl, noise, proj_tc.xy ); + amb_rgb = getProjectedLightAmbiance( amb_da, dist_atten, lit, nl, 1.0, proj_tc.xy ); final_color += diffuse.rgb * amb_rgb; } diff --git a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl index 9b5cb39883..7a5676e0ab 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl @@ -92,6 +92,7 @@ bool shouldSampleProbe(int i, vec3 pos) return false; } + // never allow automatic probes to encroach on box probes sample_automatic = false; } else @@ -426,25 +427,19 @@ void boxIntersectDebug(vec3 origin, vec3 pos, int i, inout vec4 col) // dir - normal to be weighted // origin - center of sphere probe // r - radius of probe influence volume -// min_da - minimum angular attenuation coefficient // i - index of probe in refSphere // dw - distance weight -float sphereWeight(vec3 pos, vec3 dir, vec3 origin, float r, float min_da, int i, out float dw) +float sphereWeight(vec3 pos, vec3 dir, vec3 origin, float r, int i, out float dw) { float r1 = r * 0.5; // 50% of radius (outer sphere to start interpolating down) vec3 delta = pos.xyz - origin; float d2 = max(length(delta), 0.001); - float r2 = r1; //r1 * r1; - - //float atten = 1.0 - max(d2 - r2, 0.0) / max((rr - r2), 0.001); - float atten = 1.0 - max(d2 - r2, 0.0) / max((r - r2), 0.001); + float atten = 1.0 - max(d2 - r1, 0.0) / max((r - r1), 0.001); float w = 1.0 / d2; dw = w * atten * max(r, 1.0)*4; - atten *= max(dot(normalize(-delta), dir), min_da); - w *= atten; return w; @@ -481,7 +476,7 @@ vec3 tapRefMap(vec3 pos, vec3 dir, out float w, out float dw, float lod, vec3 c, refIndex[i].w < 1 ? 4096.0*4096.0 : // <== effectively disable parallax correction for automatically placed probes to keep from bombing the world with obvious spheres rr); - w = sphereWeight(pos, dir, refSphere[i].xyz, r, 0.25, i, dw); + w = sphereWeight(pos, dir, refSphere[i].xyz, r, i, dw); } v -= c; @@ -521,7 +516,7 @@ vec3 tapIrradianceMap(vec3 pos, vec3 dir, out float w, out float dw, vec3 c, int refIndex[i].w < 1 ? 4096.0*4096.0 : // <== effectively disable parallax correction for automatically placed probes to keep from bombing the world with obvious spheres rr); - w = sphereWeight(pos, dir, refSphere[i].xyz, r, 0.001, i, dw); + w = sphereWeight(pos, dir, refSphere[i].xyz, r, i, dw); } v -= c; @@ -559,7 +554,6 @@ vec3 sampleProbes(vec3 pos, vec3 dir, float lod) float dw = 0; vec3 refcol; - { refcol = tapRefMap(pos, dir, w, dw, lod, refSphere[i].xyz, i); @@ -653,7 +647,7 @@ void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv, vec2 tc, vec3 pos, vec3 norm, float glossiness) { // TODO - don't hard code lods - float reflection_lods = max_probe_lod-1; + float reflection_lods = max_probe_lod; preProbeSample(pos); vec3 refnormpersp = reflect(pos.xyz, norm.xyz); @@ -732,7 +726,7 @@ void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 refnormpersp = reflect(pos.xyz, norm.xyz); ambenv = sampleProbeAmbient(pos, norm); - + if (glossiness > 0.0) { float lod = (1.0-glossiness)*reflection_lods; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index dfd1d47b3e..0e3ebd1534 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -211,7 +211,7 @@ void main() else if (!GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_ATMOS)) { //should only be true of WL sky, just port over base color value - color = srgb_to_linear(baseColor.rgb); + color = srgb_to_linear(texture2D(emissiveRect, tc).rgb); } else { diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl index 3d8b95b882..33ea2129cf 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl @@ -51,7 +51,6 @@ uniform sampler2D normalMap; uniform sampler2D emissiveRect; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl uniform samplerCube environmentMap; uniform sampler2D lightMap; -uniform sampler2D noiseMap; uniform sampler2D projectionMap; // rgba uniform sampler2D lightFunc; @@ -193,7 +192,6 @@ void main() diffuse = srgb_to_linear(diffuse); spec.rgb = srgb_to_linear(spec.rgb); - float noise = texture2D(noiseMap, tc).b; if (proj_tc.z > 0.0 && proj_tc.x < 1.0 && proj_tc.y < 1.0 && @@ -205,7 +203,7 @@ void main() if (nl > 0.0) { - lit = nl * dist_atten * noise; + lit = nl * dist_atten; dlit = getProjectedLightDiffuseColor( l_dist, proj_tc.xy ); @@ -214,7 +212,7 @@ void main() amb_da += (nl*0.5+0.5) /* * (1.0-shadow) */ * proj_ambiance; } - vec3 amb_rgb = getProjectedLightAmbiance( amb_da, dist_atten, lit, nl, noise, proj_tc.xy ); + vec3 amb_rgb = getProjectedLightAmbiance( amb_da, dist_atten, lit, nl, 1.0, proj_tc.xy ); final_color += diffuse.rgb*amb_rgb; #if DEBUG_LEG_LIGHT_TYPE final_color = vec3(0,0.5,0); |