Skip to content

Instantly share code, notes, and snippets.

View elenzil's full-sized avatar

orion elenzil elenzil

  • seattle, usa
View GitHub Profile
@NiklasRosenstein
NiklasRosenstein / complex.frag
Last active March 28, 2019 16:56
Functions for complex numbers in GLSL. https://www.shadertoy.com/
vec2 cmpxcjg(in vec2 c) {
return vec2(c.x, -c.y);
}
vec2 cmpxmul(in vec2 a, in vec2 b) {
return vec2(a.x * b.x - a.y * b.y, a.y * b.x + a.x * b.y);
}
vec2 cmpxpow(in vec2 c, int p) {
for (int i = 0; i < p; ++i) {