From 5dcf85cfb8269309246ff94d5b2ddc7d7d5ed3c6 Mon Sep 17 00:00:00 2001 From: Renaud Rohlinger Date: Thu, 12 Sep 2024 20:23:58 +0900 Subject: [PATCH] InstancedPoints: Fix UVs --- examples/jsm/geometries/InstancedPointsGeometry.js | 2 +- src/materials/nodes/InstancedPointsNodeMaterial.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/jsm/geometries/InstancedPointsGeometry.js b/examples/jsm/geometries/InstancedPointsGeometry.js index 081ab6b81af176..1238ad88391542 100644 --- a/examples/jsm/geometries/InstancedPointsGeometry.js +++ b/examples/jsm/geometries/InstancedPointsGeometry.js @@ -20,7 +20,7 @@ class InstancedPointsGeometry extends InstancedBufferGeometry { this.type = 'InstancedPointsGeometry'; const positions = [ - 1, 1, 0, 1, 1, 0, - 1, - 1, 0, 1, - 1, 0 ]; - const uvs = [ - 1, 1, 1, 1, - 1, - 1, 1, - 1 ]; + const uvs = [ 0, 1, 1, 1, 0, 0, 1, 0 ]; const index = [ 0, 2, 1, 2, 3, 1 ]; this.setIndex( index ); diff --git a/src/materials/nodes/InstancedPointsNodeMaterial.js b/src/materials/nodes/InstancedPointsNodeMaterial.js index 0e4a2c2880dc17..45e3fd4f54f79b 100644 --- a/src/materials/nodes/InstancedPointsNodeMaterial.js +++ b/src/materials/nodes/InstancedPointsNodeMaterial.js @@ -92,7 +92,7 @@ class InstancedPointsNodeMaterial extends NodeMaterial { const alpha = float( 1 ).toVar(); - const len2 = lengthSq( uv() ); + const len2 = lengthSq( uv().mul( 2 ).sub( 1 ) ); if ( useAlphaToCoverage ) {