Skip to content

Instantly share code, notes, and snippets.

View gruebite's full-sized avatar
🎯
Focusing

gruebite gruebite

🎯
Focusing
View GitHub Profile
@Aldlevine
Aldlevine / animated_atlas_texture.gd
Last active April 6, 2022 00:02
Adds an animated atlas texture to Godot
extends AtlasTexture
class_name AnimatedAtlasTexture
export(int, 1, 100) var h_frames := 1
export(int, 1, 100) var v_frames := 1
export var fps := 10.0
var previous_frame := 0
var frame := 0
@lucasvanmol
lucasvanmol / bend3D_quat.shader
Created November 13, 2020 16:40
bend3D shader but using quaternions instead of matrices
shader_type spatial;
uniform vec3 strength = vec3(0.0);
uniform vec3 center = vec3(0.0, 0.0, 1.0);
vec4 quat_mult(vec4 q1, vec4 q2) {
vec4 qr;
qr.x = (q1.w * q2.x) + (q1.x * q2.w) + (q1.y * q2.z) - (q1.z * q2.y);
qr.y = (q1.w * q2.y) - (q1.x * q2.z) + (q1.y * q2.w) + (q1.z * q2.x);
qr.z = (q1.w * q2.z) + (q1.x * q2.y) - (q1.y * q2.x) + (q1.z * q2.w);