1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-19 09:39:48 +00:00
Pixelorama/src/Shaders/Greyscale.gdshader

8 lines
254 B
Plaintext
Raw Normal View History

shader_type canvas_item;
void fragment() {
COLOR = texture(SCREEN_TEXTURE, SCREEN_UV);
// formula from "https://stackoverflow.com/a/596241"
float avg = ((0.2126 * COLOR.r) + (0.7152 * COLOR.g) + (0.0722 * COLOR.b));
COLOR.rgb = vec3(avg);
}