Skip to content

Instantly share code, notes, and snippets.

View xeecos's full-sized avatar

xeecos xeecos

View GitHub Profile
@yiwenl
yiwenl / bezier.glsl
Last active May 5, 2024 08:57
Bezier curve in GLSL
// bezier curve with 2 control points
// A is the starting point, B, C are the control points, D is the destination
// t from 0 ~ 1
vec3 bezier(vec3 A, vec3 B, vec3 C, vec3 D, float t) {
vec3 E = mix(A, B, t);
vec3 F = mix(B, C, t);
vec3 G = mix(C, D, t);
vec3 H = mix(E, F, t);
vec3 I = mix(F, G, t);