@needle-tools/three 0.185.1 → 0.185.2-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1578,7 +1578,7 @@ class GLTFWriter {
1578
1578
 
1579
1579
  const beforeWriteArgs = { keep: true, newTexture: null };
1580
1580
 
1581
- this._invokeAll( function ( ext ) {
1581
+ await this._invokeAllAsync( function ( ext ) {
1582
1582
 
1583
1583
  ext.beforeWriteTexture && ext.beforeWriteTexture( map, beforeWriteArgs );
1584
1584
 
@@ -1848,7 +1848,7 @@ class GLTFWriter {
1848
1848
 
1849
1849
  const beforeWriteArgs = { keep: true }
1850
1850
 
1851
- this._invokeAll( function ( ext ) {
1851
+ await this._invokeAllAsync( function ( ext ) {
1852
1852
 
1853
1853
  ext.beforeWriteMesh && ext.beforeWriteMesh( mesh, beforeWriteArgs );
1854
1854
 
@@ -2472,7 +2472,7 @@ class GLTFWriter {
2472
2472
 
2473
2473
  const beforeWriteArgs = { keep: true }
2474
2474
 
2475
- this._invokeAll( function ( ext ) {
2475
+ await this._invokeAllAsync( function ( ext ) {
2476
2476
 
2477
2477
  ext.beforeWriteNode && ext.beforeWriteNode( object, beforeWriteArgs );
2478
2478
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/three",
3
- "version": "0.185.1",
3
+ "version": "0.185.2-alpha.1",
4
4
  "description": "JavaScript 3D library",
5
5
  "type": "module",
6
6
  "main": "./build/three.cjs",
package/src/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- export const REVISION = '185.1';
1
+ export const REVISION = '185.2-alpha';
2
2
 
3
3
  /**
4
4
  * Represents mouse buttons and interaction types in context of controls.
@@ -806,12 +806,31 @@ function setValueV4uiArray( gl, v ) {
806
806
 
807
807
  // Array of textures (2D / 3D / Cube / 2DArray)
808
808
 
809
+ const _warnedEmptySamplerArray = new Set();
810
+
809
811
  function setValueT1Array( gl, v, textures ) {
810
812
 
811
813
  const cache = this.cache;
812
814
 
813
815
  const n = v.length;
814
816
 
817
+ // An empty sampler array (`sampler2D x[0]`) has nothing to bind, and Chrome throws
818
+ // "WebGL: INVALID_VALUE: uniform1iv: no array" on `gl.uniform1iv([])` — every frame.
819
+ // Skip the upload (a genuine no-op) and warn once per uniform so the source of the
820
+ // empty array can be tracked down. Seen with empty shadow sampler arrays (ContactShadows).
821
+ if ( n === 0 ) {
822
+
823
+ if ( ! _warnedEmptySamplerArray.has( this.id ) ) {
824
+
825
+ _warnedEmptySamplerArray.add( this.id );
826
+ console.warn( `THREE.WebGLUniforms: skipping empty sampler array uniform '${ this.id }' (nothing to bind).` );
827
+
828
+ }
829
+
830
+ return;
831
+
832
+ }
833
+
815
834
  const units = allocTexUnits( textures, n );
816
835
 
817
836
  if ( ! arraysEqual( cache, units ) ) {