🚚 Move shader code to GLSL files

This commit is contained in:
Simon Schneegans
2022-05-13 08:27:09 +02:00
parent 77d5de7b8e
commit 46cc997e2a
43 changed files with 1303 additions and 1334 deletions
+10
View File
@@ -0,0 +1,10 @@
float distToLine(vec2 origin, vec2 direction, vec2 point) {
vec2 perpendicular = vec2(direction.y, -direction.x);
return abs(dot(normalize(perpendicular), origin - point));
}
float getWinding(vec2 a, vec2 b) { return cross(vec3(a, 0.0), vec3(b, 0.0)).z; }
vec2 rotate(vec2 a, float angle) {
return vec2(a.x * cos(angle) - a.y * sin(angle), a.x * sin(angle) + a.y * cos(angle));
}