Skip to content

Instantly share code, notes, and snippets.

View padreputativo's full-sized avatar

Padre Putativo padreputativo

View GitHub Profile
@padreputativo
padreputativo / grid.gdshader
Last active September 22, 2021 12:04
Prototiping GridBox Texture Shader
shader_type spatial;
render_mode ensure_correct_normals;
//render_mode world_vertex_coords;
// Based in : https://godotshaders.com/shader/world-coordinates-grid-bw-shader/
uniform vec4 lightColor : hint_color;
uniform vec4 darkColor : hint_color;
uniform vec4 borderColor : hint_color;
shader_type spatial;
render_mode unshaded, ambient_light_disabled, shadows_disabled; //, cull_disabled;
/* Inspired in ShaderToy: https://www.shadertoy.com/view/WlcSzN#
and GDQuest Force Field shader: https://github.com/GDQuest/godot-shaders */
uniform sampler2D Texture;
uniform float DISTANCE : hint_range(0.0, 100.0) = 50.0;
uniform float STRENGTH : hint_range(0, 1) = 0.02;
uniform float SPEED : hint_range(0, 1) = 0.1;
shader_type canvas_item;
/* Shader converted to Godot from ShaderToy https://www.shadertoy.com/view/llK3RR */
uniform float intensity = 1.0;
// Given a vec2 in [-1,+1], generate a texture coord in [0,+1]
vec2 barrelDistortion( vec2 p, vec2 amt ) {
p = 2.0 * p - 1.0;
@padreputativo
padreputativo / film_grain.shader
Last active August 25, 2021 13:20
16mm Film Grain shader for Godot 3
shader_type canvas_item;
/* Shader converted to Godot from ShaderToy https://www.shadertoy.com/view/Xt23DD */
uniform int kMaxIterations = 24;
uniform float STEPS = 16.0;
float Linear1(float c) { return(c<=0.04045)?c/12.92:pow((c+0.055)/1.055,2.4); }