diff options
| author | Brad Linden <brad@lindenlab.com> | 2024-05-23 11:31:19 -0700 | 
|---|---|---|
| committer | Brad Linden <brad@lindenlab.com> | 2024-05-23 11:31:19 -0700 | 
| commit | a1f49564d670a2c41bfa25c833bba2564b9b7f48 (patch) | |
| tree | 1d205e51bc37621916a17d459ad83782fe41f975 /indra/newview/app_settings/shaders/class3/deferred | |
| parent | 6af5db09faf5ea33a2d4c47b64e76f42edae178a (diff) | |
| parent | 6377610f6587989c126b00f490dfc8d527a1c2ce (diff) | |
Merge remote-tracking branch 'origin/DRTVWR-600-maint-A' into brad/merge-maint-a-to-dev
Diffstat (limited to 'indra/newview/app_settings/shaders/class3/deferred')
7 files changed, 64 insertions, 64 deletions
| diff --git a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl index c382a9fbc0..03dc3d7113 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl @@ -1,28 +1,28 @@ -/**  +/**   * @file fullbrightShinyF.glsl   *   * $LicenseInfo:firstyear=2007&license=viewerlgpl$   * Second Life Viewer Source Code   * Copyright (C) 2007, Linden Research, Inc. - *  + *   * This library is free software; you can redistribute it and/or   * modify it under the terms of the GNU Lesser General Public   * License as published by the Free Software Foundation;   * version 2.1 of the License only. - *  + *   * This library is distributed in the hope that it will be useful,   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU   * Lesser General Public License for more details. - *  + *   * You should have received a copy of the GNU Lesser General Public   * License along with this library; if not, write to the Free Software   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA - *  + *   * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA   * $/LicenseInfo$   */ -  +  /*[EXTRA_CODE_HERE]*/  out vec4 frag_color; @@ -59,16 +59,16 @@ void main()  {      mirrorClip(vary_position);  #ifdef HAS_DIFFUSE_LOOKUP -	vec4 color = diffuseLookup(vary_texcoord0.xy); +    vec4 color = diffuseLookup(vary_texcoord0.xy);  #else -	vec4 color = texture(diffuseMap, vary_texcoord0.xy); +    vec4 color = texture(diffuseMap, vary_texcoord0.xy);  #endif -	 -	color.rgb *= vertex_color.rgb; -	// SL-9632 HUDs are affected by Atmosphere +    color.rgb *= vertex_color.rgb; + +    // SL-9632 HUDs are affected by Atmosphere  #ifndef IS_HUD -	 +      vec3 sunlit;      vec3 amblit;      vec3 additive; @@ -90,8 +90,8 @@ void main()      applyLegacyEnv(color.rgb, legacyenv, spec, pos, norm, env_intensity);  #endif -	color.a = 1.0; +    color.a = 1.0; -	frag_color = max(color, vec4(0)); +    frag_color = max(color, vec4(0));  } diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl index 2a20eb79d2..d3e19cf4a8 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl @@ -100,7 +100,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe      float falloff_factor = (12.0 * fa) - 9.0;      float inverted_la = falloff_factor / la;      // Yes, it makes me want to cry as well. DJH -     +      vec3 col = vec3(0);      //get light vector @@ -220,19 +220,19 @@ in vec2 vary_texcoord0;  vec3 getNormal(inout float glossiness)  {  #ifdef HAS_NORMAL_MAP -	vec4 vNt = texture(bumpMap, vary_texcoord1.xy); +    vec4 vNt = texture(bumpMap, vary_texcoord1.xy);      glossiness *= vNt.a; -	vNt.xyz = vNt.xyz * 2 - 1; +    vNt.xyz = vNt.xyz * 2 - 1;      float sign = vary_sign;      vec3 vN = vary_normal;      vec3 vT = vary_tangent.xyz; -     +      vec3 vB = sign * cross(vN, vT);      vec3 tnorm = normalize( vNt.x * vT + vNt.y * vB + vNt.z * vN ); -	return tnorm; +    return tnorm;  #else -	return normalize(vary_normal); +    return normalize(vary_normal);  #endif  } @@ -269,9 +269,9 @@ void waterClip()  float getEmissive(vec4 diffcol)  {  #if (DIFFUSE_ALPHA_MODE != DIFFUSE_ALPHA_MODE_EMISSIVE) -	return emissive_brightness; +    return emissive_brightness;  #else -	return max(diffcol.a, emissive_brightness); +    return max(diffcol.a, emissive_brightness);  #endif  } @@ -295,7 +295,7 @@ void main()      // diffcol == diffuse map combined with vertex color      vec4 diffcol = texture(diffuseMap, vary_texcoord0.xy); -	diffcol.rgb *= vertex_color.rgb; +    diffcol.rgb *= vertex_color.rgb;      alphaMask(diffcol.a);      // spec == specular map combined with specular color @@ -328,7 +328,7 @@ void main()      vec3 additive;      vec3 atten;      calcAtmosphericVarsLinear(pos.xyz, norm.xyz, light_dir, sunlit, amblit, additive, atten); -     +      vec3 sunlit_linear = srgb_to_linear(sunlit);      vec3 amblit_linear = amblit; @@ -336,7 +336,7 @@ void main()      vec3 glossenv;      vec3 legacyenv;      sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, pos.xy*0.5+0.5, pos.xyz, norm.xyz, glossiness, env, true, amblit_linear); -     +      color = ambenv;      float da          = clamp(dot(norm.xyz, light_dir.xyz), 0.0, 1.0); @@ -408,7 +408,7 @@ void main()      frag_color = max(vec4(color, al), vec4(0)); -#else // mode is not DIFFUSE_ALPHA_MODE_BLEND, encode to gbuffer  +#else // mode is not DIFFUSE_ALPHA_MODE_BLEND, encode to gbuffer      // deferred path               // See: C++: addDeferredAttachment(), shader: softenLightF.glsl      float flag = GBUFFER_FLAG_HAS_ATMOS; diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightV.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightV.glsl index c2b9ed3d96..09fd389370 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightV.glsl @@ -1,24 +1,24 @@ -/**  +/**   * @file class3\deferred\multiPointLightV.glsl   *   * $LicenseInfo:firstyear=2022&license=viewerlgpl$   * Second Life Viewer Source Code   * Copyright (C) 2022, Linden Research, Inc. - *  + *   * This library is free software; you can redistribute it and/or   * modify it under the terms of the GNU Lesser General Public   * License as published by the Free Software Foundation;   * version 2.1 of the License only. - *  + *   * This library is distributed in the hope that it will be useful,   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU   * Lesser General Public License for more details. - *  + *   * You should have received a copy of the GNU Lesser General Public   * License along with this library; if not, write to the Free Software   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA - *  + *   * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA   * $/LicenseInfo$   */ @@ -29,9 +29,9 @@ out vec4 vary_fragcoord;  void main()  { -	//transform vertex -	vec4 pos = vec4(position.xyz, 1.0); -	vary_fragcoord = pos; +    //transform vertex +    vec4 pos = vec4(position.xyz, 1.0); +    vary_fragcoord = pos; -	gl_Position = pos; +    gl_Position = pos;  } diff --git a/indra/newview/app_settings/shaders/class3/deferred/pointLightV.glsl b/indra/newview/app_settings/shaders/class3/deferred/pointLightV.glsl index 8d23f1b427..6111f0bf77 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/pointLightV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/pointLightV.glsl @@ -1,24 +1,24 @@ -/**  +/**   * @file class3\deferred\pointLightV.glsl   *   * $LicenseInfo:firstyear=2022&license=viewerlgpl$   * Second Life Viewer Source Code   * Copyright (C) 2022, Linden Research, Inc. - *  + *   * This library is free software; you can redistribute it and/or   * modify it under the terms of the GNU Lesser General Public   * License as published by the Free Software Foundation;   * version 2.1 of the License only. - *  + *   * This library is distributed in the hope that it will be useful,   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU   * Lesser General Public License for more details. - *  + *   * You should have received a copy of the GNU Lesser General Public   * License along with this library; if not, write to the Free Software   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA - *  + *   * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA   * $/LicenseInfo$   */ @@ -36,10 +36,10 @@ out vec3 trans_center;  void main()  { -	//transform vertex -	vec3 p = position*size+center; -	vec4 pos = modelview_projection_matrix * vec4(p.xyz, 1.0); -	vary_fragcoord = pos; -	trans_center = (modelview_matrix*vec4(center.xyz, 1.0)).xyz; -	gl_Position = pos; +    //transform vertex +    vec3 p = position*size+center; +    vec4 pos = modelview_projection_matrix * vec4(p.xyz, 1.0); +    vary_fragcoord = pos; +    trans_center = (modelview_matrix*vec4(center.xyz, 1.0)).xyz; +    gl_Position = pos;  } diff --git a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostV.glsl b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostV.glsl index f7e7268cc3..5555024b03 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostV.glsl @@ -36,13 +36,13 @@ out vec3 camera_ray;  void main()  { -	//transform vertex -	vec4 pos = vec4(position.xyz, 1.0); -	gl_Position = pos;  -	 -	vary_fragcoord = pos.xy * 0.5 + 0.5; +    //transform vertex +    vec4 pos = vec4(position.xyz, 1.0); +    gl_Position = pos; -	vec4 rayOrig = inv_proj * vec4(pos.xy, 1, 1); +    vary_fragcoord = pos.xy * 0.5 + 0.5; + +    vec4 rayOrig = inv_proj * vec4(pos.xy, 1, 1);      camera_ray = rayOrig.xyz / rayOrig.w;  } diff --git a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflUtil.glsl b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflUtil.glsl index f14f7eac8d..e8901c7ba2 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflUtil.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflUtil.glsl @@ -92,7 +92,7 @@ bool traceScreenRay(vec3 position, vec3 reflection, out vec4 hitColor, out float      vec2 screenPosition;      bool hit = false;      hitColor = vec4(0); -     +      int i = 0;      if (depth > depthRejectBias)      { @@ -107,7 +107,7 @@ bool traceScreenRay(vec3 position, vec3 reflection, out vec4 hitColor, out float              }              depthFromScreen = getLinearDepth(screenPosition);              delta = abs(marchingPosition.z) - depthFromScreen; -             +              if (depth < depthFromScreen + epsilon && depth > depthFromScreen - epsilon)              {                  break; @@ -151,7 +151,7 @@ bool traceScreenRay(vec3 position, vec3 reflection, out vec4 hitColor, out float              {                  step *= 0.5;                  marchingPosition = marchingPosition - step * sign(delta); -                 +                  screenPosition = generateProjectedPosition(marchingPosition);                  if (screenPosition.x > 1 || screenPosition.x < 0 ||                      screenPosition.y > 1 || screenPosition.y < 0) @@ -180,7 +180,7 @@ bool traceScreenRay(vec3 position, vec3 reflection, out vec4 hitColor, out float              }          }      } -     +      return hit;  } @@ -335,18 +335,18 @@ collectedColor = vec4(1, 0, 1, 1);      vec2 uv2 = tc * screen_res;      float c = (uv2.x + uv2.y) * 0.125;      float jitter = mod( c, 1.0); -     +      vec2 screenpos = 1 - abs(tc * 2 - 1);      float vignette = clamp((abs(screenpos.x) * abs(screenpos.y)) * 16,0, 1);      vignette *= clamp((dot(normalize(viewPos), n) * 0.5 + 0.5) * 5.5 - 0.8, 0, 1); -     +      float zFar = 128.0;      vignette *= clamp(1.0+(viewPos.z/zFar), 0.0, 1.0);      vignette *= clamp(glossiness * 3 - 1.7, 0, 1);      vec4 hitpoint; -     +      glossiness = 1 - glossiness;      totalSamples = int(max(glossySampleCount, glossySampleCount * glossiness * vignette)); @@ -376,7 +376,7 @@ collectedColor = vec4(1, 0, 1, 1);                      collectedColor.a += 1;                  }              } -             +              if (hits > 0)              {                  collectedColor /= hits; diff --git a/indra/newview/app_settings/shaders/class3/deferred/waterHazeV.glsl b/indra/newview/app_settings/shaders/class3/deferred/waterHazeV.glsl index 16381a5d51..9c2b367158 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/waterHazeV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/waterHazeV.glsl @@ -41,19 +41,19 @@ uniform mat4 modelview_projection_matrix;  void main()  { -	//transform vertex -	vec4 pos = vec4(position.xyz, 1.0); +    //transform vertex +    vec4 pos = vec4(position.xyz, 1.0);      if (above_water > 0)      {          pos = modelview_projection_matrix*pos;      } -    gl_Position = pos;  +    gl_Position = pos;      // appease OSX GLSL compiler/linker by touching all the varyings we said we would      setAtmosAttenuation(vec3(1));      setAdditiveColor(vec3(0)); -	vary_fragcoord = pos; +    vary_fragcoord = pos;  } | 
