Skip to content

Instantly share code, notes, and snippets.

@jimmyjonezz
Created February 21, 2019 12:25
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/5020daf550dae8a0e15a44eaf2279ff0 to your computer and use it in GitHub Desktop.
Save jimmyjonezz/5020daf550dae8a0e15a44eaf2279ff0 to your computer and use it in GitHub Desktop.
Scanline Texture for Godot 3.1 altha 5
shader_type canvas_item;
uniform sampler2D source;
void vertex() {
vec2 texCoord;
}
void fragment() {
vec4 rgba = texture(source, UV);
vec4 intensity;
if (fract(FRAGCOORD.y * (0.5 * 4.0 / 3.0)) > 0.5){
intensity = vec4(0);
} else {
intensity = smoothstep(0.2, 0.8, rgba) + normalize(rgba);
}
COLOR = intensity * -0.25 + rgba *1.1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment