diff --git a/examples/jsm/tsl/lighting/ClusteredLightsNode.js b/examples/jsm/tsl/lighting/ClusteredLightsNode.js index 18f80c439a81d9..ccf606cca5e592 100644 --- a/examples/jsm/tsl/lighting/ClusteredLightsNode.js +++ b/examples/jsm/tsl/lighting/ClusteredLightsNode.js @@ -1,7 +1,7 @@ import { DataTexture, FloatType, RGBAFormat, Vector2, Vector3, LightsNode, NodeUpdateType } from 'three/webgpu'; import { - attributeArray, nodeProxy, int, float, vec3, ivec2, ivec4, uniform, Break, Loop, positionView, + attributeArray, nodeProxy, int, float, vec3, vec4, ivec2, ivec4, uniform, Break, Loop, positionView, Fn, If, Return, textureLoad, instanceIndex, screenCoordinate, directPointLight, renderGroup, min, max, pow, log, clamp, dot @@ -306,7 +306,7 @@ class ClusteredLightsNode extends LightsNode { const dataB = textureLoad( this._lightsTexture, ivec2( index, 1 ) ); const position = dataA.xyz; - const viewPosition = this._cameraViewMatrix.mul( position ); + const viewPosition = this._cameraViewMatrix.mul( vec4( position, 1.0 ) ).xyz; const distance = dataA.w; const color = dataB.rgb; const decay = dataB.w; diff --git a/examples/screenshots/webgpu_lights_clustered.jpg b/examples/screenshots/webgpu_lights_clustered.jpg index b53098f94b314c..882910f4ec0cf5 100644 Binary files a/examples/screenshots/webgpu_lights_clustered.jpg and b/examples/screenshots/webgpu_lights_clustered.jpg differ