CanvasModulate Copy (Godot 4)

This is a Godot 4 shader that mimics the effect of CanvasModulate.

Shader code
shader_type canvas_item;
varying vec4 modulate;

void vertex()
	modulate = COLOR;

void fragment()
	vec4 color = texture(TEXTURE, UV);
	COLOR = color * modulate;

void light()
	vec4 color = texture(TEXTURE, UV);
	LIGHT = vec4(color.rgb * LIGHT_COLOR.rgb * LIGHT_ENERGY, LIGHT_COLOR.a);
canvasmodulate, Color, light, lighting, modulate
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

Related shaders

Crosshair (Godot 4)

2D Water distortion effect (Godot 4)

Vignette Shader for godot 4 :)

Notify of

Inline Feedbacks
View all comments