From e7a8aa028bccffb9b4cb1492619f3c2ff1a00da6 Mon Sep 17 00:00:00 2001 From: Kartios Date: Sat, 22 Aug 2026 23:41:05 -0700 Subject: [PATCH] fix(satellites): declare uPixelRatio, which was breaking the layer in production MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ShaderMaterial` prepends three's own built-ins — projectionMatrix, modelViewMatrix, position — but it does NOT prepend the custom uniforms declared in the `uniforms` object. `uPixelRatio` was in that object and never declared in the GLSL, so the vertex program failed to compile with ERROR: 0:79: 'uPixelRatio' : undeclared identifier and the whole satellite dome silently drew nothing on the deployed site while every other layer carried on. The only symptom was a console error nobody was reading — which is exactly why the deploy check now opens the page and greps the console rather than trusting a 200. Found by screenshotting the LIVE site after deploying, not by any test: no test in this repo compiles a shader, `npm run build` cannot, and `ui-smoke` passed because the page boots fine with one layer missing. Verified after the fix at two hours on two boards: zero shader errors, where the deployed build had one on every load. Co-Authored-By: Claude Opus 5 (1M context) --- src/engine/satellites.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/engine/satellites.ts b/src/engine/satellites.ts index 6427c2b..ff8ac9f 100644 --- a/src/engine/satellites.ts +++ b/src/engine/satellites.ts @@ -533,6 +533,18 @@ export function createSatelliteLayer(boardRadius: number): SatelliteLayer { uPixelRatio: { value: 1 }, }, vertexShader: ` +/* + * DECLARED HERE, and it has to be. + * + * ShaderMaterial prepends three own built-ins — projectionMatrix, + * modelViewMatrix, position and the rest — but it does NOT prepend the custom + * uniforms declared in the uniforms object above. Putting one there and using it + * in the body without declaring it here compiles nowhere: the program fails with + * "uPixelRatio : undeclared identifier", three logs a shader error, and this + * layer silently draws nothing while every other layer carries on. That shipped + * once, and the console error was the only symptom. + */ +uniform float uPixelRatio; attribute vec4 color; attribute float aSize; varying vec4 vColor;