Skip to content

Instantly share code, notes, and snippets.

@dmaz
dmaz / godot_async_scene_loader.gd
Created January 6, 2023 19:54 — forked from NovemberDev/godot_async_scene_loader.gd
Asynchronously loads scenes in godot
# Loads a scene in the background using a seperate thread and a queue.
# Foreach new scene there will be an instance of ResourceInteractiveLoader
# that will raise an on_scene_loaded event once the scene has been loaded.
# Hooking the on_progress event will give you the current progress of any
# scene that is being processed in realtime. The loader also uses caching
# to avoid duplicate loading of scenes and it will prevent loading the
# same scene multiple times concurrently.
#
# Sample usage:
#
@dmaz
dmaz / sobel.shader
Created August 3, 2022 13:40 — forked from kzerot/sobel.shader
Simple sobel edge detection for Godot
shader_type canvas_item;
uniform vec4 edge_color : hint_color = vec4(0.4, 0.4,0.4,1);
uniform vec2 resolution = vec2(800.0,600.0);
void fragment(){
float width = resolution.x;
float height = resolution.y;
float w = 1.0 / width;
float h = 1.0 / height;
@dmaz
dmaz / some_godo_shader.glsl
Created August 3, 2022 13:40 — forked from kzerot/some_godo_shader.glsl
Simple godot shader
shader_type canvas_item;
uniform vec4 col : hint_color;
uniform float eff_str = 0.8;
float rand(float x){
return fract(cos(x) * 2345.6789);
}
float triangle(float x){
return abs(1.0 - mod(abs(x), 2.0)) * 2.0 - 1.0;
}
void fragment()