From ca2ac3fd2d8933b4baae0634a3030dff267767c0 Mon Sep 17 00:00:00 2001 From: schmelczerandras Date: Fri, 18 Sep 2020 15:26:56 +0200 Subject: [PATCH] Remove clutter --- .../rendering/shaders/distance-fs.glsl | 49 +------------------ src/helper/rotate-90-deg.ts | 3 -- 2 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 src/helper/rotate-90-deg.ts diff --git a/src/graphics/rendering/shaders/distance-fs.glsl b/src/graphics/rendering/shaders/distance-fs.glsl index 8611b37..4e058d1 100644 --- a/src/graphics/rendering/shaders/distance-fs.glsl +++ b/src/graphics/rendering/shaders/distance-fs.glsl @@ -12,58 +12,11 @@ in vec2 position; {declarations} -/* -#endif -#if BLOB_COUNT > 0 - uniform struct { - vec2 headCenter; - vec2 leftFootCenter; - vec2 rightFootCenter; - float headRadius; - float footRadius; - float k; - }[BLOB_COUNT] blobs; - - float smoothMin(float a, float b) - { - const float k = 2.0; - - a = pow(a, k); - b = pow(b, k); - return pow((a * b) / (a + b), 1.0 / k); - } - - float circleMinDistance(vec2 circleCenter, float radius) { - return distance(position, circleCenter) - radius; - } - - void blobMinDistance(inout float minDistance, inout float color) { - for (int i = 0; i < BLOB_COUNT; i++) { - float headDistance = circleMinDistance(blobs[i].headCenter, blobs[i].headRadius); - float leftFootDistance = circleMinDistance(blobs[i].leftFootCenter, blobs[i].footRadius); - float rightFootDistance = circleMinDistance(blobs[i].rightFootCenter, blobs[i].footRadius); - - float res = min( - smoothMin(headDistance, leftFootDistance), - smoothMin(headDistance, rightFootDistance) - ); - - res = min(100.0, headDistance); - res = min(res, leftFootDistance); - res = min(res, rightFootDistance); - //color = mix(2.0, color, step(distanceUvPixelSize + SURFACE_OFFSET, res)); - minDistance = min(minDistance, res); - color = mix(2.0, color, step(distanceNdcPixelSize + SURFACE_OFFSET, res)); - } - } -#endif -*/ - out vec2 fragmentColor; void main() { float minDistance = maxMinDistance; - float color = 1.0; + float color = 0.0; {functionCalls} diff --git a/src/helper/rotate-90-deg.ts b/src/helper/rotate-90-deg.ts deleted file mode 100644 index 1911a63..0000000 --- a/src/helper/rotate-90-deg.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { vec2 } from 'gl-matrix'; - -export const rotate90Deg = (vec: vec2): vec2 => vec2.fromValues(-vec.y, vec.x);