Skip to content
Snippets Groups Projects
Commit 18f42a65 authored by David Parks's avatar David Parks
Browse files

SL-20611 Followup -- fix edge cases with transparent PBR objects around...

SL-20611 Followup -- fix edge cases with transparent PBR objects around eye/object above/below water.
parent 6472b75b
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
...@@ -82,9 +82,7 @@ vec3 srgb_to_linear(vec3 c); ...@@ -82,9 +82,7 @@ vec3 srgb_to_linear(vec3 c);
vec3 linear_to_srgb(vec3 c); 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); 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); vec4 applySkyAndWaterFog(vec3 pos, vec3 additive, vec3 atten, vec4 color);
vec4 applyWaterFogViewLinear(vec3 pos, vec4 color);
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); 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 calcLegacyDistanceAttenuation(float distance, float falloff);
...@@ -241,10 +239,7 @@ void main() ...@@ -241,10 +239,7 @@ void main()
color.rgb += light.rgb; color.rgb += light.rgb;
color.rgb = atmosFragLightingLinear(color.rgb, additive, atten); color.rgb = applySkyAndWaterFog(pos.xyz, additive, atten, vec4(color, 1.0)).rgb;
vec4 temp = applyWaterFogViewLinear(pos, vec4(color, 0.0));
color = temp.rgb;
float a = basecolor.a*vertex_color.a; float a = basecolor.a*vertex_color.a;
...@@ -300,6 +295,7 @@ void main() ...@@ -300,6 +295,7 @@ void main()
float a = basecolor.a*vertex_color.a; float a = basecolor.a*vertex_color.a;
color += colorEmissive; color += colorEmissive;
color = linear_to_srgb(color); color = linear_to_srgb(color);
frag_color = max(vec4(color.rgb,a), vec4(0)); frag_color = max(vec4(color.rgb,a), vec4(0));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment