From ec2cb0d53d06d042e8ddaffec408064d30946f81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20LAGIER?= Date: Thu, 2 Jul 2026 15:57:25 +0200 Subject: [PATCH 1/2] fix(outline-pass): handle clipping planes Refactor vertex and fragment shaders to include clipping planes. --- .../src/simple-outline-pass.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/front/src/core/PostproductionRenderer/src/simple-outline-pass.ts b/packages/front/src/core/PostproductionRenderer/src/simple-outline-pass.ts index 07cf2cd9..583bec8d 100644 --- a/packages/front/src/core/PostproductionRenderer/src/simple-outline-pass.ts +++ b/packages/front/src/core/PostproductionRenderer/src/simple-outline-pass.ts @@ -46,14 +46,21 @@ interface OutlinedTileProxy { } const GHOST_VERT = ` + #include void main() { - gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + vec4 mvPosition = modelViewMatrix * vec4(position, 1.0); + gl_Position = projectionMatrix * mvPosition; + #include } `; const GHOST_FRAG = ` + #include uniform vec4 idColor; - void main() { gl_FragColor = idColor; } + void main() { + #include + gl_FragColor = idColor; + } `; /** @@ -268,6 +275,7 @@ export class SimpleOutlinePass extends Pass { polygonOffsetFactor: -priority, polygonOffsetUnits: -priority, }); + material.clipping = true; const container = new THREE.Group(); container.name = `outline-group:${name}`; From 86c2dcbb51bd1338259a0fccf2e581390b3fa699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20LAGIER?= Date: Thu, 2 Jul 2026 16:07:37 +0200 Subject: [PATCH 2/2] fix(outline-pass): simpler clipping property assignment --- .../src/core/PostproductionRenderer/src/simple-outline-pass.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/front/src/core/PostproductionRenderer/src/simple-outline-pass.ts b/packages/front/src/core/PostproductionRenderer/src/simple-outline-pass.ts index 583bec8d..68586a34 100644 --- a/packages/front/src/core/PostproductionRenderer/src/simple-outline-pass.ts +++ b/packages/front/src/core/PostproductionRenderer/src/simple-outline-pass.ts @@ -266,6 +266,7 @@ export class SimpleOutlinePass extends Pass { const material = new THREE.ShaderMaterial({ uniforms: { idColor: { value: new THREE.Vector4(id / 255, 0, 0, 1) } }, + clipping: true, vertexShader: GHOST_VERT, fragmentShader: GHOST_FRAG, depthTest: true, @@ -275,7 +276,6 @@ export class SimpleOutlinePass extends Pass { polygonOffsetFactor: -priority, polygonOffsetUnits: -priority, }); - material.clipping = true; const container = new THREE.Group(); container.name = `outline-group:${name}`;