You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
Fix "Light Only" mode of CanvasItemMaterial
This commit is contained in:
@@ -568,7 +568,7 @@ void main() {
|
||||
}
|
||||
|
||||
#ifdef MODE_LIGHT_ONLY
|
||||
color = vec4(0.0);
|
||||
float light_only_alpha = 0.0;
|
||||
#elif !defined(MODE_UNSHADED)
|
||||
color *= canvas_data.canvas_modulation;
|
||||
#endif
|
||||
@@ -611,6 +611,9 @@ void main() {
|
||||
}
|
||||
|
||||
light_blend_compute(light_base, light_color, color.rgb);
|
||||
#ifdef MODE_LIGHT_ONLY
|
||||
light_only_alpha += light_color.a;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Positional Lights
|
||||
@@ -695,8 +698,15 @@ void main() {
|
||||
}
|
||||
|
||||
light_blend_compute(light_base, light_color, color.rgb);
|
||||
#ifdef MODE_LIGHT_ONLY
|
||||
light_only_alpha += light_color.a;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MODE_LIGHT_ONLY
|
||||
color.a *= light_only_alpha;
|
||||
#endif
|
||||
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user