1
0

fix(satellites): declare uPixelRatio, which was breaking the layer in production

`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) <noreply@anthropic.com>
This commit is contained in:
2026-08-22 23:41:05 -07:00
parent acf4d1a510
commit e7a8aa028b
+12
View File
@@ -533,6 +533,18 @@ export function createSatelliteLayer(boardRadius: number): SatelliteLayer {
uPixelRatio: { value: 1 }, uPixelRatio: { value: 1 },
}, },
vertexShader: ` 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 vec4 color;
attribute float aSize; attribute float aSize;
varying vec4 vColor; varying vec4 vColor;