Skip to content

Instantly share code, notes, and snippets.

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
@belzecue
belzecue / RandomWallpaper.cs
Created April 2, 2022 10:55 — forked from EricJ2190/RandomWallpaper.cs
Random Windows Wallpaper
/* Selects a random image from a folder and makes it the desktop wallpaper.
* usage: RandomWallpaper.exe [c:\path\to\wallpapers]
* If the path is omitted, the current directory is used.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Runtime.InteropServices;
// Derived from Unity built-in shader source.
// https://raw.githubusercontent.com/chsxf/unity-built-in-shaders/0c7940740e75340009bbed453e2b198e294e4bab/Shaders/DefaultResourcesExtra/Skybox-Panoramic.shader
Shader "Skybox/Dual Panoramic" {
Properties{
_Tint1("Tint Color 1", Color) = (.5, .5, .5, .5)
_Tint2("Tint Color 2", Color) = (.5, .5, .5, .5)
[Gamma] _Exposure1("Exposure 1", Range(0, 8)) = 1.0
[Gamma] _Exposure2("Exposure 2", Range(0, 8)) = 1.0
_Rotation1("Rotation1", Range(0, 360)) = 0
/*
Procedural sky panorama cloud shader for Godot by https://www.reddit.com/user/Tsar333/
Posted to: https://www.reddit.com/r/godot/comments/eo47cr/godot_sky_shader_3d/
Node Setup:
WorldEnvironment
-- Viewport
---- ColorRect
@belzecue
belzecue / queue.gd
Created March 2, 2022 16:09 — forked from ViteFalcon/queue.gd
Thread-safe circular buffer queue
extends Node
var array
var size
var start = 0
var end = -1
var mutex = Mutex.new()
signal item_removed
@belzecue
belzecue / RingBufferDic.gd
Created February 24, 2022 15:54
Godot ring buffer using Dictionary. Can pop FIFO or LIFO.
class_name RingBufferDic extends Node
enum PopMode {LIFO, FIFO}
export(int) var maxHistoryEntries := 32
var history := {}
var hwm := 0 # high water mark
var LIFO := -1 # -1 means buffer empty
var FIFO := -1 # -1 means buffer empty
var pop_counter := 0
@belzecue
belzecue / wordle.md
Created February 2, 2022 06:09 — forked from huytd/wordle.md
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@belzecue
belzecue / Parse16BitFloat.shader
Created January 6, 2022 11:54 — forked from lyuma/Parse16BitFloat.shader
Godot Shader to extract the raw 16-bit integer in a FORMAT_RGBAH texture.
shader_type spatial;
render_mode unshaded;
uniform usampler2D data_tex;
/*
Use with the following GDScript code:
var data_img = Image.new()
var data := PoolByteArray()
var indexin = 0x8400
@belzecue
belzecue / decal_albedo.shader.glsl
Created January 6, 2022 11:54 — forked from lyuma/decal_albedo.shader.glsl
decal shader for Godot Engine
shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;
uniform float specular;
uniform float metallic;
uniform float roughness : hint_range(0,1);
@belzecue
belzecue / LightMasking.shader.glsl
Created January 6, 2022 11:54 — forked from lyuma/LightMasking.shader.glsl
Example Godot shader showing how writing to ALPHA can allow for a sort of light masking effect in 3D
shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
uniform float specular;
uniform float metallic;
uniform float roughness : hint_range(0,1);
uniform float point_size : hint_range(0,128);
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;