Skip to content

Instantly share code, notes, and snippets.

belzecue /
Created April 20, 2024 11:41 — forked from pavanpodila/
Export each Git branch as a separate folder
cd $(dirname $0)
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 / ReadOnlyAttribute.cs
Created March 28, 2020 04:05
[Unity] Inspector Read-Only Fields - Shows field data but doesn't allow to modify it
* ReadOnlyAttribute.cs
* Created by: Joao Borks []
* Created on: 05/06/18 (dd/mm//yy)
* Reference from It3ration:
using UnityEngine;
using System;
belzecue / CameraTrackingRefraction.cs
Created May 21, 2018 19:15 — forked from runevision/CameraTrackingRefraction.cs
Unity CommandBuffer replacement for GrabPass - works with multiple separate cameras.
using UnityEngine;
using UnityEngine.Rendering;
// This script is added to cameras automatically at runtime by the ObjectNeedingRefraction scripts.
public class CameraTrackingRefraction : MonoBehaviour {
public int lastRenderedFrame = -1;
Camera cam;
belzecue /
Last active January 21, 2024 03:20 — forked from patriciogonzalezvivo/
GLSL Noise Algorithms

Please consider using instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
belzecue /
Last active January 16, 2024 02:26 — forked from anthonyec/
Godot gamepad input visualisation for debugging (GDScript 2)
# Godot 3.x version of a Godot 4 script written by anthonyec at:
# This Godot 3.x version available at:
# Attach script to a Control node.
extends Control
export var device: int = 0
belzecue / text_decal_sdf.shader
Created January 6, 2024 16:39
Godot 3 SDF shader for clear decal edges at low resolutions, as used by Valve
// Generate high-resolution white on black text decal in GIMP and apply Filters > Generic > Distance Map
// then scale down to e.g. 64 pixel height.
// Import decal image into Godot and set:
// Compression mode to lossless
// Filter ON
// Mipmaps ON
// Fix alpha border ON
// Invert color ON (if required)
belzecue /
Last active January 1, 2024 17:20
Capture an animation to a PNG sequence, e.g. to turn into an Animated Sprite.
Attach this script to the parent node of an AnimationPlayer.
extends Node2D
export(NodePath) var anim_player_path: NodePath
export(String) var track_name: String
onready var anim_player: AnimationPlayer = get_node(anim_player_path) as AnimationPlayer
onready var tree: SceneTree = get_tree()
class_name RingBuffer extends Reference
Uses simple arrays as ring buffers, passed to these static methods.
Allocates the first two slots for metadata (pointer, queue length).
var rb: Array = RingBuffer.create(5)
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
_notification 20 Node.NOTIFICATION_SCENE_INSTANTIATED # only on instantiated scene roots
_notification 18 Node.NOTIFICATION_PARENTED
tree_entered signal
ready signal