godot-visual-effects/camera-effects/sepia.gdshader

17 lines
413 B
Plaintext
Raw Permalink Normal View History

2023-12-14 06:03:37 +08:00
shader_type canvas_item;
2023-12-16 06:58:06 +08:00
// based on: https://www.shadertoy.com/view/Xl3cDn
2023-12-14 06:03:37 +08:00
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear;
void fragment() {
vec4 col = texture(SCREEN_TEXTURE, UV);
vec3 sepia = vec3(
col.r * .393 + col.g *.769 + col.b * .189,
col.r * .349 + col.g *.686 + col.b * .168,
col.r * .272 + col.g *.534 + col.b * .131);
COLOR = vec4(sepia, 1.0);
}