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

SL-18190 Fix for fullbright alpha blended legacy materials appearing in wrong color space

parent 709bf220
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
...@@ -244,11 +244,6 @@ void main() ...@@ -244,11 +244,6 @@ void main()
} }
#endif #endif
#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
vec3 gamma_diff = diffcol.rgb;
diffcol.rgb = srgb_to_linear(diffcol.rgb);
#endif
#ifdef HAS_SPECULAR_MAP #ifdef HAS_SPECULAR_MAP
vec4 spec = texture2D(specularMap, vary_texcoord2.xy); vec4 spec = texture2D(specularMap, vary_texcoord2.xy);
spec.rgb *= specular_color.rgb; spec.rgb *= specular_color.rgb;
...@@ -293,7 +288,7 @@ void main() ...@@ -293,7 +288,7 @@ void main()
#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) #if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
//forward rendering, output just lit sRGBA //forward rendering, output lit linear color
vec3 pos = vary_position; vec3 pos = vary_position;
float shadow = 1.0f; float shadow = 1.0f;
...@@ -355,7 +350,7 @@ void main() ...@@ -355,7 +350,7 @@ void main()
color += sun_contrib; color += sun_contrib;
color *= gamma_diff.rgb; color *= diffcol.rgb;
float glare = 0.0; float glare = 0.0;
...@@ -378,9 +373,6 @@ void main() ...@@ -378,9 +373,6 @@ void main()
#endif #endif
} }
color = mix(color.rgb, diffcol.rgb, diffuse.a);
#ifdef HAS_REFLECTION_PROBES #ifdef HAS_REFLECTION_PROBES
if (envIntensity > 0.0) if (envIntensity > 0.0)
{ // add environmentmap { // add environmentmap
...@@ -439,12 +431,13 @@ void main() ...@@ -439,12 +431,13 @@ void main()
al = temp.a; al = temp.a;
#endif #endif
color = mix(color.rgb, srgb_to_linear(diffcol.rgb), diffuse.a);
frag_color = vec4(color, al); frag_color = vec4(color, al);
#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 // deferred path // See: C++: addDeferredAttachment(), shader: softenLightF.glsl
frag_data[0] = final_color; // gbuffer is sRGB frag_data[0] = final_color; // gbuffer is sRGB for legacy materials
frag_data[1] = final_specular; // XYZ = Specular color. W = Specular exponent. frag_data[1] = final_specular; // XYZ = Specular color. W = Specular exponent.
frag_data[2] = final_normal; // XY = Normal. Z = Env. intensity. W = 1 skip atmos (mask off fog) frag_data[2] = final_normal; // XY = Normal. Z = Env. intensity. W = 1 skip atmos (mask off fog)
#endif #endif
......
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