Skip to content

Instantly share code, notes, and snippets.

View jimmyjonezz's full-sized avatar
🎯
Focusing...

Jimmy jimmyjonezz

🎯
Focusing...
View GitHub Profile
@jimmyjonezz
jimmyjonezz / texture_color.gd
Created November 13, 2018 11:06
texture color from uniform
shader_type canvas_item;
render_mode unshaded;
uniform vec4 color: hint_color;
void fragment(){
COLOR = texture(TEXTURE, UV) + vec4(color);
}
@jimmyjonezz
jimmyjonezz / blur_texture
Created February 21, 2019 11:55
Blur Texture 3.1 alpha 5
shader_type canvas_item;
uniform float radius = 10.0;
void fragment(){
vec4 new_color = texture(TEXTURE, UV);
vec2 pixel_size = TEXTURE_PIXEL_SIZE;
new_color += texture(TEXTURE, UV + vec2(0, -radius) * pixel_size);
new_color += texture(TEXTURE, UV + vec2(0, radius) * pixel_size);
new_color += texture(TEXTURE, UV + vec2(-radius, 0) * pixel_size);
@jimmyjonezz
jimmyjonezz / scanline_texture
Created February 21, 2019 12:25
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;
@jimmyjonezz
jimmyjonezz / OldTV_shader
Created February 21, 2019 12:34
OldTV_shader for Godot 3.1 alpha 5
shader_type canvas_item;
uniform float scanline_alpha = 0.25;
uniform float scanline_number = 320.0;
uniform sampler2D scanline_texture;
uniform float wipe = 0;
uniform bool apply_shader = true;
uniform bool scanlines = true;
shader_type canvas_item;
render_mode unshaded;
uniform float randx;
uniform float randy;
uniform float grain_scale : hint_range(0.0, 1.0);
uniform sampler2D noise_tex;
uniform sampler2D vignette_tex;
shader_type canvas_item;
float rng2(vec2 seed, float TIME)
{
return fract(sin(dot(seed * floor(TIME * 12.0), vec2(127.1,311.7))) * 48654.5453123);
}
float rng(float seed, float TIME)
{
return rng2(vec2(seed, 1.0), TIME);
shader_type canvas_item;
uniform float size_x=0.005;
uniform float size_y=0.005;
uniform float r_offset_x = -0.2;
uniform float r_offset_y = 0;
uniform float g_offset_x = 0;
uniform float g_offset_y = 0;
uniform float b_offset_x = 0.2;
shader_type canvas_item;
uniform float percent : hint_range(0, 1);
void fragment(){
vec2 relative_uv = UV.yx - vec2(0.5);
float dist = abs(percent - distance(UV, vec2(0.5))) * 7.0;
float wave = pow(cos(dist)*sin(dist), 5.0);
vec2 displacement = (1.0/(percent+0.01)) * relative_uv * clamp(wave, 0.0, 1.0);
@jimmyjonezz
jimmyjonezz / shader
Created August 17, 2019 18:18
red + nois shader
shader_type canvas_item;
float rng2(vec2 seed, float time)
{
return fract(sin(dot(seed * floor(time* 12.0), vec2(127.1,311.7))) * 48654.5453123);
}
float rng(float seed, float time)
{
return rng2(vec2(seed, 1.0), time);
shader_type canvas_item;
varying float VAR1;
void vertex()
{
VAR1 = VERTEX.y;
}
void light()
{
if( ( LIGHT_VEC.y - VAR1 ) <= 0.0 )
{