Skip to content

Instantly share code, notes, and snippets.

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

Jimmy jimmyjonezz

🎯
Focusing...
View GitHub Profile
@WiggleWizard
WiggleWizard / psx.shader
Last active May 4, 2020 15:34
PSX shader for Godot
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
@kzerot
kzerot / mask.shader
Created November 12, 2018 12:14
Godot. Very simple mask shader for 2d.
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){
@kolen
kolen / dither.glsl
Created July 30, 2019 21:53
Simple dithering shader for godot engine
// 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),
@henriquelalves
henriquelalves / fisheyeeffect
Last active August 14, 2021 09:45
Godot Shader for FishEye 2D effect
// 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);
@uheartbeast
uheartbeast / ChromaticAberration.shader
Created August 27, 2019 14:42
Simple Chromatic Aberration Shader for Godot 3
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;
@Jellonator
Jellonator / godot_mode7_shader.shader
Created January 2, 2020 22:42
Mode 7 shader for Godot
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
@CowThing
CowThing / pixel_perfect.gd
Last active April 6, 2024 17:09
Pixel perfect scaling script for Godot 3.1
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.