You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Avoid shading CanvasGroup nodes twice
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
[b]Note:[/b] The [CanvasGroup] uses a custom shader to read from the backbuffer to draw its children. Assigning a [Material] to the [CanvasGroup] overrides the builtin shader. To duplicate the behavior of the builtin shader in a custom [Shader] use the following:
|
[b]Note:[/b] The [CanvasGroup] uses a custom shader to read from the backbuffer to draw its children. Assigning a [Material] to the [CanvasGroup] overrides the builtin shader. To duplicate the behavior of the builtin shader in a custom [Shader] use the following:
|
||||||
[codeblock]
|
[codeblock]
|
||||||
shader_type canvas_item;
|
shader_type canvas_item;
|
||||||
|
render_mode unshaded;
|
||||||
|
|
||||||
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
||||||
|
|
||||||
|
|||||||
@@ -2684,6 +2684,7 @@ RasterizerCanvasGLES3::RasterizerCanvasGLES3() {
|
|||||||
// Default CanvasGroup shader.
|
// Default CanvasGroup shader.
|
||||||
|
|
||||||
shader_type canvas_item;
|
shader_type canvas_item;
|
||||||
|
render_mode unshaded;
|
||||||
|
|
||||||
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
||||||
|
|
||||||
@@ -2711,6 +2712,7 @@ void fragment() {
|
|||||||
// Default clip children shader.
|
// Default clip children shader.
|
||||||
|
|
||||||
shader_type canvas_item;
|
shader_type canvas_item;
|
||||||
|
render_mode unshaded;
|
||||||
|
|
||||||
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
||||||
|
|
||||||
|
|||||||
@@ -645,7 +645,7 @@ void main() {
|
|||||||
|
|
||||||
#ifdef MODE_LIGHT_ONLY
|
#ifdef MODE_LIGHT_ONLY
|
||||||
color = vec4(0.0);
|
color = vec4(0.0);
|
||||||
#else
|
#elif !defined(MODE_UNSHADED)
|
||||||
color *= canvas_modulation;
|
color *= canvas_modulation;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -2634,6 +2634,7 @@ RendererCanvasRenderRD::RendererCanvasRenderRD() {
|
|||||||
// Default CanvasGroup shader.
|
// Default CanvasGroup shader.
|
||||||
|
|
||||||
shader_type canvas_item;
|
shader_type canvas_item;
|
||||||
|
render_mode unshaded;
|
||||||
|
|
||||||
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
||||||
|
|
||||||
@@ -2661,6 +2662,7 @@ void fragment() {
|
|||||||
// Default clip children shader.
|
// Default clip children shader.
|
||||||
|
|
||||||
shader_type canvas_item;
|
shader_type canvas_item;
|
||||||
|
render_mode unshaded;
|
||||||
|
|
||||||
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user