Skip to content

Commit b4ca470

Browse files
authored
TSL: Fix instance() optional parameter (#30848)
1 parent 1e61693 commit b4ca470

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/nodes/accessors/InstanceNode.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class InstanceNode extends Node {
3333
*
3434
* @param {number} count - The number of instances.
3535
* @param {InstancedBufferAttribute} instanceMatrix - Instanced buffer attribute representing the instance transformations.
36-
* @param {InstancedBufferAttribute} instanceColor - Instanced buffer attribute representing the instance colors.
36+
* @param {?InstancedBufferAttribute} instanceColor - Instanced buffer attribute representing the instance colors.
3737
*/
38-
constructor( count, instanceMatrix, instanceColor ) {
38+
constructor( count, instanceMatrix, instanceColor = null ) {
3939

4040
super( 'void' );
4141

@@ -71,6 +71,7 @@ class InstanceNode extends Node {
7171
* The node that represents the instance color data.
7272
*
7373
* @type {?Node}
74+
* @default null
7475
*/
7576
this.instanceColorNode = null;
7677

@@ -220,7 +221,7 @@ export default InstanceNode;
220221
* @function
221222
* @param {number} count - The number of instances.
222223
* @param {InstancedBufferAttribute} instanceMatrix - Instanced buffer attribute representing the instance transformations.
223-
* @param {InstancedBufferAttribute} instanceColor - Instanced buffer attribute representing the instance colors.
224+
* @param {?InstancedBufferAttribute} instanceColor - Instanced buffer attribute representing the instance colors.
224225
* @returns {InstanceNode}
225226
*/
226-
export const instance = /*@__PURE__*/ nodeProxy( InstanceNode ).setParameterLength( 3 );
227+
export const instance = /*@__PURE__*/ nodeProxy( InstanceNode ).setParameterLength( 2, 3 );

0 commit comments

Comments
 (0)