Colorblind Accessibility

This shader is originally from this reddit thread https://www.reddit.com/r/gamedev/comments/9u1y6f/adding_colorblind_accessibility_with_an/

 

TL;DR: You can add a colorblind accessibility to any project in minutes with simple post-process shader.

 

Shader code
shader_type canvas_item;

uniform int mode = 0;

void fragment() {
	vec4 px = texture(SCREEN_TEXTURE, SCREEN_UV);
	if (mode==1) { px = px.gbra; }
	if (mode==2) { px = px.brga; }
	if (mode==3) { px = px.bgra; }
	COLOR = vec4(px.rgb,1.0);
}
Tags
accessibility, Color blind
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.
guest
0 Comments
Inline Feedbacks
View all comments