Skip to content

Instantly share code, notes, and snippets.

@belzecue
belzecue / 1-pico8-godot-shader.shader
Created November 28, 2024 15:29 — forked from stephanbogner/1-pico8-godot-shader.shader
PICO-8 color palette (or any other) shader for Godot (with the .html file below you can easily adjust the shader to any color palette)
// Adapted from "How to Limit Color Output with Shaders in Godot"
// By TheBuffED
// On https://www.youtube.com/watch?v=Scrdv4oSeNw
// Type of shader https://docs.godotengine.org/en/3.0/tutorials/shading/shading_language.html#shader-types
shader_type canvas_item;
// The shader strength which between 0 (not applied) and 1 (fully applied) because I want to fade the shader in and out
// Can be changed from node via `get_material().set_shader_param("shaderStrength", newValue)`
uniform float shaderStrength = 1.0;
@belzecue
belzecue / bake_morph_textures.py
Created November 21, 2024 14:38 — forked from alexmalyutindev/bake_morph_textures.py
Vertex animation baker for Blender.
# Source
# Vertex animation textures, beanbags and boneless animations
# by Martin Donald
# https://www.youtube.com/watch?v=NQ5Dllbxbz4
import bpy
import bmesh
import mathutils
@belzecue
belzecue / catmull-rom.gd
Created June 22, 2024 11:55 — forked from JoelBesada/catmull-rom.gd
Catmull-Rom Spline in GDScript
func catmull_rom_spline(
_points: Array, resolution: int = 10, extrapolate_end_points = true
) -> PackedVector2Array:
var points = _points.duplicate()
if extrapolate_end_points:
points.insert(0, points[0] - (points[1] - points[0]))
points.append(points[-1] + (points[-1] - points[-2]))
var smooth_points := PackedVector2Array()
if points.size() < 4:
@belzecue
belzecue / create_export_pack.sh
Created April 20, 2024 11:41 — forked from pavanpodila/create_export_pack.sh
Export each Git branch as a separate folder
previous_pwd=$PWD
cd $(dirname $0)
PROJECT="$HOME/Desktop/project"
EXPORT_DIR="$HOME/Desktop/export"
rm -rf $EXPORT_DIR
mkdir -p $EXPORT_DIR
/**
* \brief Returns positional offset for a given point as a result of summing 4 gerstner waves
* \param positionWS point in world space
* \param wavelengths wavelength of each of the 4 waves
* \param amplitudes amplitudes of each of the 4 waves
* \param directions direction of each of the 4 waves (each row = one direction). MUST BE NORMALIZED!
* \param speed global speed multiplier. Individual wave speed depends on Wavelength
* \param steepness Gerstner wave 'Steepness' parameter. Modulates the horizontal offset of points
* \param normal returns the normal of given point.
* \return positional offset of the given point
@belzecue
belzecue / GdscriptCallSequence.txt
Created November 30, 2023 09:57 — forked from Gnumaru/GdscriptCallSequence.txt
The sequence in which methods and signals gets called in gdscript
# as of godot 4.1
_static_init
_init
_notification 20 Node.NOTIFICATION_SCENE_INSTANTIATED # only on instantiated scene roots
_notification 18 Node.NOTIFICATION_PARENTED
_enter_tree
tree_entered signal
_notification 27 Node.NOTIFICATION_POST_ENTER_TREE
_ready
ready signal
export var viewportResizeStanddown = 0.5
var viewportResizeCounter = 0.0
signal settingsChanged()
signal particlesSettingsChanged()
signal removeGpuParticles()
func forbidParticles(time):
particlesForbiddenCounter = time
particlesForbidden = true
@belzecue
belzecue / LinkedList.gd
Last active November 11, 2023 19:25 — forked from bojidar-bg/LinkedList.gd
Doubly Linked List for Godot
# Linked List
# from https://gist.github.com/bojidar-bg/a570c614a4dd1cd84949
# Example use
"""
var my_linked_list = LinkedList.new()
func _ready():
var ll = my_linked_list
@belzecue
belzecue / DoomGlow.cs
Created April 25, 2023 02:34 — forked from TiliSleepStealer/DoomGlow.cs
Doom glow - fake volumetric light glow effect in Unity by Tili_us
// This file is in the public domain. Where
// a public domain declaration is not recognized, you are granted
// a license to freely use, modify, and redistribute this file in
// any way you choose.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Unity remake of a fake volumetric light glow effect
@belzecue
belzecue / gist:4e4f64a579037e5b9c1088a9b7e82a1a
Created February 9, 2023 04:06 — forked from WolfgangSenff/gist:0a9c1d800db42a9a9441b2d0288ed0fd
GDScript 1.0 to 2.0 Beginner Friendly Conversion Guide
Beginner-friendly GDScript 1 to GDScript 2 Conversion Guide
First and foremost, this should not be considered a replacement for the official migration guide,
found at https://docs.godotengine.org/en/latest/tutorials/migrating/upgrading_to_godot_4.html!
Instead, this document is intended to be a friendly guide to helping you upgrade your projects from
GDScript 1 to 2. To do this, I'm going to list the most common conversions I've run into while upgrading
a few of my games and tools. This document is written as of the first release candidate version of Godot 4.0.
The first thing to do when converting a project (no need if you're starting from new) is to either have your
project in source control, or make a duplicate of your entire project's folder and rename it. This will