diff options
author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2023-06-11 20:56:02 -0700 |
---|---|---|
committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2023-06-11 20:56:02 -0700 |
commit | ffac2df6caedf48f30b3913386ea6e4c82ae5a0b (patch) | |
tree | c5e5a0541b318551cc04b6b7108f8f9025c6b72d /indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl | |
parent | 47e311d6e8b9996de3e0a1ac75c13724ce7735aa (diff) | |
parent | 1ebfc1876ec3383067a2399218037a33601b04d5 (diff) |
Merge branch 'DRTVWR-559' into DRTVWR-583-glossy-ssr
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl index 7b7b4a040c..d678973515 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl @@ -84,6 +84,10 @@ vec3 linear_to_srgb(vec3 c); void calcAtmosphericVarsLinear(vec3 inPositionEye, vec3 norm, vec3 light_dir, out vec3 sunlit, out vec3 amblit, out vec3 atten, out vec3 additive); vec3 atmosFragLightingLinear(vec3 color, vec3 additive, vec3 atten); +#ifdef WATER_FOG +vec4 applyWaterFogViewLinear(vec3 pos, vec4 color, vec3 sunlit); +#endif + void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float nh, out float nl, out float nv, out float vh, out float lightDist); float calcLegacyDistanceAttenuation(float distance, float falloff); float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen); @@ -148,7 +152,7 @@ vec3 calcPointLightOrSpotLight(vec3 diffuseColor, vec3 specularColor, // spot*spot => GL_SPOT_EXPONENT=2 float spot_atten = spot*spot; - vec3 intensity = spot_atten * dist_atten * lightColor * 3.9; //magic number to balance with legacy materials + vec3 intensity = spot_atten * dist_atten * lightColor * 3.0; //magic number to balance with legacy materials vec3 speccol; color = intensity*pbrPunctual(diffuseColor, specularColor, perceptualRoughness, metallic, n.xyz, v, lv, speccol); @@ -237,6 +241,11 @@ void main() color.rgb = atmosFragLightingLinear(color.rgb, additive, atten); +#ifdef WATER_FOG + vec4 temp = applyWaterFogViewLinear(pos, vec4(color, 0.0), sunlit_linear); + color = temp.rgb; +#endif + vec3 light = vec3(0); // Punctual lights @@ -258,7 +267,7 @@ void main() glare = min(glare, 1.0); a = max(a, glare); - frag_color = vec4(color.rgb,a); + frag_color = max(vec4(color.rgb,a), vec4(0)); } #else @@ -311,7 +320,7 @@ void main() float a = basecolor.a*vertex_color.a; color += colorEmissive; color = linear_to_srgb(color); - frag_color = vec4(color.rgb,a); + frag_color = max(vec4(color.rgb,a), vec4(0)); } #endif |