Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing...

Jimmy jimmyjonezz

🎯
Focusing...
View GitHub Profile
View godot_mode7_shader.shader
shader_type canvas_item;
uniform mat4 TRANSFORM;
uniform vec2 DEPTH;
uniform bool REPEAT_X;
uniform bool REPEAT_Y;
uniform bool FLIP;
void fragment() {
// Create the matrix. A workaround is used to modify the matrix's W column
@uheartbeast
uheartbeast / ChromaticAberration.shader
Created Aug 27, 2019
Simple Chromatic Aberration Shader for Godot 3
View ChromaticAberration.shader
shader_type canvas_item;
uniform bool apply = true;
uniform float amount = 1.0;
uniform sampler2D offset_texture : hint_white;
void fragment() {
vec4 texture_color = texture(TEXTURE, UV);
vec4 color = texture_color;
@kolen
kolen / dither.glsl
Created Jul 30, 2019
Simple dithering shader for godot engine
View dither.glsl
// Based on http://devlog-martinsh.blogspot.com/2011/03/glsl-dithering.html
shader_type canvas_item;
uniform float scale = 1.0;
float find_closest(int x, int y, float c0)
{
mat4 dither = mat4(vec4( 1.0, 33.0, 9.0, 41.0),
vec4(49.0, 17.0, 57.0, 25.0),
@CowThing
CowThing / pixel_perfect.gd
Last active May 16, 2021
Pixel perfect scaling script for Godot 3.1
View pixel_perfect.gd
extends Node
"""
An autoload singleton for pixel perfect rendering of the game.
Set this script as an autoload.
`base_size` - Is the target size of the viewport. The viewport will scale up to fit the largest
possible integer multiple of this size within the window.
`expand` - If true the viewport will expand to the edges of the window after scaling up.
@kzerot
kzerot / mask.shader
Created Nov 12, 2018
Godot. Very simple mask shader for 2d.
View mask.shader
shader_type canvas_item;
uniform sampler2D mask;
void fragment(){
vec4 col = texture(mask, UV);
if(col.a == 0.0){
COLOR = col;
}
else if (col.a > .99){
@WiggleWizard
WiggleWizard / psx.shader
Last active May 4, 2020
PSX shader for Godot
View psx.shader
shader_type spatial;
render_mode skip_vertex_transform, unshaded;
//Albedo texture
uniform sampler2D albedoTex : hint_albedo;
//Geometric resolution for vert snap
uniform float snapRes = 15.0;
//vec4 for UV recalculation
@henriquelalves
henriquelalves / fisheyeeffect
Last active May 31, 2021
Godot Shader for FishEye 2D effect
View fisheyeeffect
// Based on http://www.geeks3d.com/20140213/glsl-shader-library-fish-eye-and-dome-and-barrel-distortion-post-processing-filters/2/
float PI = 3.1415926535;
uniform float BarrelPower;
vec2 distort(vec2 p) {
if(p.x > 0.0){
float angle = p.y / p.x;
float theta = atan(angle);