From fecd08b9ad539b89c476a8ad3d6e017e8363fda4 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 7 Apr 2026 06:44:13 +0200 Subject: [PATCH] Update water material to include reflection properties --- src/viewport-three/viewport-host.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/viewport-three/viewport-host.js b/src/viewport-three/viewport-host.js index 4d90ba98..814454e5 100644 --- a/src/viewport-three/viewport-host.js +++ b/src/viewport-three/viewport-host.js @@ -2096,11 +2096,24 @@ export class ViewportHost { x: brush.size.x * 0.5, z: brush.size.z * 0.5 }, - contactPatches + contactPatches, + reflection: { + texture: null, + enabled: faceId === "posY" + } }); if (waterMaterial.animationUniform !== null) { this.volumeAnimatedUniforms.push(waterMaterial.animationUniform); } + if (faceId === "posY" && waterMaterial.reflectionMatrixUniform !== null && waterMaterial.reflectionEnabledUniform !== null) { + this.viewportWaterSurfaceBindings.push({ + brush, + reflectionTextureUniform: waterMaterial.reflectionTextureUniform, + reflectionMatrixUniform: waterMaterial.reflectionMatrixUniform, + reflectionEnabledUniform: waterMaterial.reflectionEnabledUniform, + reflectionRenderTarget: this.getWaterReflectionMode() !== "none" ? this.createWaterReflectionRenderTarget() : null + }); + } return waterMaterial.material; } if (brush.volume.mode === "fog") {