From 497a500b6311eec1dbc5038b30eb72bbe5086870 Mon Sep 17 00:00:00 2001 From: Glypse Date: Fri, 23 Jan 2026 16:55:43 +0100 Subject: [PATCH 1/2] fix(color): correct intepolation for chroma=0 OKLch gradients --- src/color/colorLookup.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/color/colorLookup.ts b/src/color/colorLookup.ts index ce8fb1e..cfdb456 100644 --- a/src/color/colorLookup.ts +++ b/src/color/colorLookup.ts @@ -120,10 +120,20 @@ export function gradient( const lowChromaThreshold = 0.001; const adjustedH1 = oklch1.y .lessThan(lowChromaThreshold) - .select(oklch2.z, oklch1.z); + .select( + oklch2.y + .greaterThanEqual(lowChromaThreshold) + .select(oklch2.z, float(0)), + oklch1.z + ); const adjustedH2 = oklch2.y .lessThan(lowChromaThreshold) - .select(oklch1.z, oklch2.z); + .select( + oklch1.y + .greaterThanEqual(lowChromaThreshold) + .select(oklch1.z, float(0)), + oklch2.z + ); // Interpolate in OKLCH space const l = mix(oklch1.x, oklch2.x, localT); From c00193c010c7b0217e51259c17279576067bad9f Mon Sep 17 00:00:00 2001 From: Glypse Date: Sat, 24 Jan 2026 13:43:22 +0100 Subject: [PATCH 2/2] fix(blur): fix gaussian blur at 0 blur --- src/blur/blur.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/blur/blur.ts b/src/blur/blur.ts index 8446457..74a4d51 100644 --- a/src/blur/blur.ts +++ b/src/blur/blur.ts @@ -12,7 +12,8 @@ import { floor, max, convertToTexture, - exp + exp, + select } from "three/tsl"; import type { Node, TextureNode } from "three/webgpu"; @@ -79,8 +80,10 @@ function createGaussianBlurPass( condition: "<=" }, ({ i }) => { - const weight = exp( - float(i).mul(float(i)).negate().div(twoSigmaSq) + const weight = select( + twoSigmaSq.equal(0), + float(0.00001), + exp(float(i).mul(float(i)).negate().div(twoSigmaSq)) ); totalWeight.addAssign(weight); const offset = vec2(