1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-20 14:45:44 +00:00

Apply PREMUL_ALPHA_FACTOR only in non-split-specular shader variants.

This avoids a shader compile error when using SSS and PREMUL_ALPHA_FACTOR in the same shader.

This doesn't change any functionaility, since in practive, the split-specular shader variant is only ever used for opaque objects while using premul alpha makes the object non-opaque
This commit is contained in:
clayjohn
2025-11-14 23:17:17 -08:00
parent ef34c3d534
commit a7e1a65ca8

View File

@@ -2909,6 +2909,10 @@ void fragment_shader(in SceneData scene_data) {
frag_color.rgb = frag_color.rgb * fog.a + fog.rgb;
#endif //!FOG_DISABLED
#if defined(PREMUL_ALPHA_USED) && !defined(MODE_RENDER_DEPTH)
frag_color.rgb *= premul_alpha;
#endif //PREMUL_ALPHA_USED
#endif //MODE_SEPARATE_SPECULAR
#endif //MODE_RENDER_DEPTH
@@ -2921,10 +2925,6 @@ void fragment_shader(in SceneData scene_data) {
motion_vector = prev_position_uv - position_uv;
#endif
#if defined(PREMUL_ALPHA_USED) && !defined(MODE_RENDER_DEPTH)
frag_color.rgb *= premul_alpha;
#endif //PREMUL_ALPHA_USED
}
void main() {