diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class3/deferred')
| -rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl | 1 | ||||
| -rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 24 | 
2 files changed, 19 insertions, 6 deletions
| diff --git a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl index 906e66ecc8..d9dc83bb10 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl @@ -31,6 +31,7 @@ float tapScreenSpaceReflection(int totalSamples, vec2 tc, vec3 viewPos, vec3 n,  uniform samplerCubeArray   reflectionProbes;  uniform samplerCubeArray   irradianceProbes; +  uniform sampler2D sceneMap;  uniform int cube_snapshot;  uniform float max_probe_lod; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 8b0ea23897..20a5ad66b6 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -32,6 +32,14 @@ uniform sampler2D specularRect;  uniform sampler2D normalMap;  uniform sampler2D emissiveRect; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl +uniform samplerCubeArray   heroProbes; + +layout (std140) uniform HeroProbeData +{ +    vec4 heroPosition[1]; +    int heroProbeCount; +}; +  const float M_PI = 3.14159265;  #if defined(HAS_SUN_SHADOW) || defined(HAS_SSAO) @@ -109,8 +117,8 @@ vec3 pbrBaseLight(vec3 diffuseColor,                    vec3 additive,                    vec3 atten); -vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor,  -                    float perceptualRoughness,  +vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor, +                    float perceptualRoughness,                      float metallic,                      vec3 n, // normal                      vec3 v, // surface point to camera @@ -185,7 +193,7 @@ void main()      if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR))      { -        vec3 orm = texture(specularRect, tc).rgb;  +        vec3 orm = texture(specularRect, tc).rgb;          float perceptualRoughness = orm.g;          float metallic = orm.b;          float ao = orm.r; @@ -205,10 +213,14 @@ void main()          vec3 v = -normalize(pos.xyz);          color = pbrBaseLight(diffuseColor, specularColor, metallic, v, norm.xyz, perceptualRoughness, light_dir, sunlit_linear, scol, radiance, irradiance, colorEmissive, ao, additive, atten); +        vec3 refnormpersp = reflect(pos.xyz, norm.xyz); +        color = textureLod(heroProbes, vec4(env_mat * refnormpersp, 0), (1.0 - gloss) * 11).xyz * specularColor; +                  if (do_atmospherics)          {              color = atmosFragLightingLinear(color, additive, atten);          } +              }      else if (!GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_ATMOS))      { @@ -268,6 +280,9 @@ void main()              // add radiance map              applyGlossEnv(color, glossenv, spec, pos.xyz, norm.xyz); + +            color = textureLod(heroProbes, vec4(env_mat * refnormpersp, 0), (1.0 - spec.a) * 11).xyz * spec.rgb; +          }          color.rgb = mix(color.rgb, baseColor.rgb, baseColor.a); @@ -283,14 +298,11 @@ void main()              color = atmosFragLightingLinear(color, additive, atten);          }     } - -      #ifdef WATER_FOG          vec4 fogged = applyWaterFogViewLinear(pos.xyz, vec4(color, bloom));          color       = fogged.rgb;      #endif -      frag_color.rgb = max(color.rgb, vec3(0)); //output linear since local lights will be added to this shader's results      frag_color.a = 0.0;  } | 
