From 438788e03168fcfd6ecdf366eebe1778a0bdb707 Mon Sep 17 00:00:00 2001 From: 3dtours Date: Wed, 23 Sep 2026 10:10:53 +0700 Subject: [PATCH] web (engine): print the grain from the phone's own module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The web port carried a third copy of the grain shader, so it would have kept printing the old static, unseeded field after the phone stopped. It now imports GRAIN_SKSL and grainCell from src/utils/grainShader.ts, exactly like the phone's export, so there is one shader and one size rule for the whole pipeline. The floor is one output pixel here, which is the whole story on this path: a CanvasKit surface is rasterised in the pixels it is given, so no dp-to-device correction is needed the way the phone preview needs one. Typechecked only — no harness in the tree runs this file; the deployed app (docker/frontend) has its own engine and already prints the new grain. --- web/src/engine/exportEngine.ts | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/web/src/engine/exportEngine.ts b/web/src/engine/exportEngine.ts index 7c8f62d..16bc13e 100644 --- a/web/src/engine/exportEngine.ts +++ b/web/src/engine/exportEngine.ts @@ -33,6 +33,7 @@ import { glowUniformArray, } from '../../../src/utils/toneShader'; import { CINEMA_SKSL, getCinemaUniforms, cinemaIsActive } from '../../../src/utils/cinemaShader'; +import { GRAIN_SKSL, GRAIN_SEED, grainCell } from '../../../src/utils/grainShader'; import { drawFrameOnCanvas, polaroidLayout, @@ -432,24 +433,13 @@ export async function renderPhoto(input: RenderInput): Promise