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);
}
Tags
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

Screen Space God Rays (Godot.4.3)

Delete chromakey for Godot 4.3

Chromakey for Godot 4.3

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments