Skip to content

Instantly share code, notes, and snippets.

@jimmyjonezz
Last active December 29, 2021 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmyjonezz/1196e29356340bc9ac41bd79119aaf12 to your computer and use it in GitHub Desktop.
Save jimmyjonezz/1196e29356340bc9ac41bd79119aaf12 to your computer and use it in GitHub Desktop.
shader_type canvas_item;
uniform float pb : hint_range(0, 1.0) = 0.4;
uniform float sclV : hint_range(0, 1.0) = 0.25;
void fragment() {
vec2 uv = FRAGCOORD.xy / SCREEN_PIXEL_SIZE.xy;
//or uv = SCREEN_UV; - it's look good!
vec4 texColor = texture(SCREEN_TEXTURE, uv);
vec4 lcdColor = vec4(pb, pb, pb, 1.0);
int px = int(mod(FRAGCOORD.x,3.0));
if (px == 1)
lcdColor.r = 1.0;
else if (px == 2)
lcdColor.g = 1.0;
else lcdColor.b = 1.0;
if (int(mod(FRAGCOORD.y, 2.0)) == 0)
lcdColor.rgb = vec3(sclV, sclV, sclV);
COLOR = texColor * lcdColor;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment