#Does anyone know why this shader is always white in Godot 4.0?

2 messages · Page 1 of 1 (latest)

reef lance
#

This is the shader from https://github.com/godotengine/godot-demo-projects/blob/master/2d/sprite_shaders/shaders/offsetshadow.shader

shader_type canvas_item;
render_mode blend_mix;

uniform vec2 offset = vec2(8.0, 8.0);
uniform vec4 modulate : hint_color;

void fragment() {
    vec2 ps = TEXTURE_PIXEL_SIZE;

    vec4 shadow = vec4(modulate.rgb, texture(TEXTURE, UV - offset * ps).a * modulate.a);
    vec4 col = texture(TEXTURE, UV);

    COLOR = mix(shadow, col, col.a);
}
GitHub

Demonstration and Template Projects. Contribute to godotengine/godot-demo-projects development by creating an account on GitHub.

#

Does anyone know why this shader is always white in Godot 4.0?