From 3e6ab2d9c7f2d8e8d798aa5e1f628e25149e808c Mon Sep 17 00:00:00 2001 From: Renaud Rohlinger Date: Sat, 24 Aug 2024 22:28:00 +0900 Subject: [PATCH] TSL: Prevent `viewportBottomLeft` breaking change and cleanup (#29223) --- examples/jsm/objects/Water2Mesh.js | 4 ++-- examples/webgpu_materials.html | 4 ++-- src/nodes/Nodes.js | 2 +- src/nodes/display/ViewportNode.js | 8 ++++++++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/examples/jsm/objects/Water2Mesh.js b/examples/jsm/objects/Water2Mesh.js index dd40eca6a708a1..29092ff2a16190 100644 --- a/examples/jsm/objects/Water2Mesh.js +++ b/examples/jsm/objects/Water2Mesh.js @@ -5,7 +5,7 @@ import { Vector2, Vector3 } from 'three'; -import { vec2, viewportSafeUV, viewportSharedTexture, reflector, pow, float, abs, texture, uniform, TempNode, NodeUpdateType, vec4, Fn, cameraPosition, positionWorld, uv, mix, vec3, normalize, max, dot, viewportTopLeft } from 'three/tsl'; +import { vec2, viewportSafeUV, viewportSharedTexture, reflector, pow, float, abs, texture, uniform, TempNode, NodeUpdateType, vec4, Fn, cameraPosition, positionWorld, uv, mix, vec3, normalize, max, dot, viewportUV } from 'three/tsl'; /** * References: @@ -141,7 +141,7 @@ class WaterNode extends TempNode { this.waterBody.add( reflectionSampler.target ); reflectionSampler.uvNode = reflectionSampler.uvNode.add( offset ); - const refractorUV = viewportTopLeft.add( offset ); + const refractorUV = viewportUV.add( offset ); const refractionSampler = viewportSharedTexture( viewportSafeUV( refractorUV ) ); // calculate final uv coords diff --git a/examples/webgpu_materials.html b/examples/webgpu_materials.html index 39fec77dd1ed42..b1a009fbbc3dcd 100644 --- a/examples/webgpu_materials.html +++ b/examples/webgpu_materials.html @@ -25,7 +25,7 @@