diff --git a/examples/jsm/tsl/lighting/ClusteredLightsNode.js b/examples/jsm/tsl/lighting/ClusteredLightsNode.js index 0c7ba09c45e85a..65c281c1bd93b7 100644 --- a/examples/jsm/tsl/lighting/ClusteredLightsNode.js +++ b/examples/jsm/tsl/lighting/ClusteredLightsNode.js @@ -44,6 +44,7 @@ class ClusteredLightsNode extends LightsNode { this.materialLights = []; this.clusteredLights = []; + this._allLights = []; this.maxLights = maxLights; this.tileSize = tileSize; @@ -205,6 +206,8 @@ class ClusteredLightsNode extends LightsNode { setLights( lights ) { + this._allLights = lights; + const { clusteredLights, materialLights } = this; let materialIndex = 0; @@ -231,6 +234,12 @@ class ClusteredLightsNode extends LightsNode { } + getLights() { + + return this._allLights; + + } + getBlock() { return this._lightIndexes.element( this._screenClusterIndex.mul( int( this._chunksPerCluster ) ) ); diff --git a/src/math/Matrix4.js b/src/math/Matrix4.js index 260d3644528ae7..985fc5b2e452b3 100644 --- a/src/math/Matrix4.js +++ b/src/math/Matrix4.js @@ -238,7 +238,7 @@ class Matrix4 { */ extractBasis( xAxis, yAxis, zAxis ) { - if ( this.determinant() === 0 ) { + if ( this.determinant3x3() === 0 ) { xAxis.set( 1, 0, 0 ); yAxis.set( 0, 1, 0 ); @@ -288,7 +288,7 @@ class Matrix4 { */ extractRotation( m ) { - if ( m.determinant() === 0 ) { + if ( m.determinant3x3() === 0 ) { return this.identity(); @@ -1080,7 +1080,7 @@ class Matrix4 { position.y = te[ 13 ]; position.z = te[ 14 ]; - const det = this.determinant(); + const det = this.determinant3x3(); if ( det === 0 ) {