Skip to main content

Posts

Showing posts from September, 2022

Simple yet powerful Shaders in GODOT

Watch the Video Tutorial https://youtu.be/j_fCGoaoRmg     Hit Flash Effect Shader This is a very simple shader and mostly used to make the player white indicating a hit or damage. shader_type canvas_item; uniform float quantity : hint_range(0.0, 1.0); void fragment(){ vec4 base = texture(TEXTURE, UV); vec4 new_color = vec4(1.0,1.0,1.0, base.a); COLOR = mix(base,new_color,quantity); }   Grayscale Shader                        GrayScale can be useful in many cases,  like if you    have a shop and some items are locked then You can turn them grayscale.  Or maybe   use it to turn the entire scene grayscale when the  player dies, similar to GTA V. shader_type canvas_item; uniform float quantity : hint_range(0.0, 1.0); void fragment(){ vec4 original = texture(TEXTURE, UV); float mean = (base.x + base.y + base.z) / 3.0; vec4 gray = vec4(mean, mean ,mean, original.a); COLOR = mix(original, gray, quantity); } Moving background Shader                    A long time ago I mad