|
|
@@ -18552,7 +18552,7 @@ const instancedMesh = /*@__PURE__*/ Fn( ( [ instancedMesh ] ) => {
|
|
|
*
|
|
|
* @param {Node<texture>} colorsTexture - The colors texture.
|
|
|
* @param {Node<int>} id - The instance or batch ID.
|
|
|
- * @returns {Node<vec3>} The retrieved color.
|
|
|
+ * @returns {Node<vec4>} The retrieved color.
|
|
|
*/
|
|
|
const getBatchingColor = /*@__PURE__*/ Fn( ( [ colorsTexture, id ] ) => {
|
|
|
|
|
|
@@ -18560,7 +18560,7 @@ const getBatchingColor = /*@__PURE__*/ Fn( ( [ colorsTexture, id ] ) => {
|
|
|
const j = int( id );
|
|
|
const x = j.mod( size ).toConst();
|
|
|
const y = j.div( size ).toConst();
|
|
|
- return textureLoad( colorsTexture, ivec2( x, y ) ).rgb;
|
|
|
+ return textureLoad( colorsTexture, ivec2( x, y ) );
|
|
|
|
|
|
} );
|
|
|
|
|
|
@@ -18583,9 +18583,9 @@ const getIndirectIndex = /*@__PURE__*/ Fn( ( [ indirectTexture, id ] ) => {
|
|
|
/**
|
|
|
* TSL object representing a varying property for the batching color vector.
|
|
|
*
|
|
|
- * @type {VaryingNode<vec3>}
|
|
|
+ * @type {VaryingNode<vec4>}
|
|
|
*/
|
|
|
-const batchColor = /*@__PURE__*/ varyingProperty( 'vec3', 'vBatchColor' );
|
|
|
+const batchColor = /*@__PURE__*/ varyingProperty( 'vec4', 'vBatchColor' );
|
|
|
|
|
|
/**
|
|
|
* TSL function representing the vertex shader batching setup.
|
|
|
@@ -52659,28 +52659,29 @@ class NodeBuilder {
|
|
|
const shaderStage = this.shaderStage;
|
|
|
const declarations = this.declarations[ shaderStage ] || ( this.declarations[ shaderStage ] = {} );
|
|
|
|
|
|
- const property = this.getPropertyName( node );
|
|
|
+ const baseName = node.name;
|
|
|
|
|
|
+ let name = baseName;
|
|
|
+ let property = this.getPropertyName( node );
|
|
|
let index = 1;
|
|
|
- let name = property;
|
|
|
|
|
|
// Automatically renames the property if the name is already in use.
|
|
|
|
|
|
- while ( declarations[ name ] !== undefined ) {
|
|
|
+ while ( declarations[ property ] !== undefined ) {
|
|
|
|
|
|
- name = property + '_' + index ++;
|
|
|
+ name = baseName + '_' + index ++;
|
|
|
+ node.name = name;
|
|
|
+ property = this.getPropertyName( node );
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ( index > 1 ) {
|
|
|
-
|
|
|
- node.name = name;
|
|
|
+ if ( name !== baseName ) {
|
|
|
|
|
|
- warn( `TSL: Declaration name '${ property }' of '${ node.type }' already in use. Renamed to '${ name }'.` );
|
|
|
+ warn( `TSL: Declaration name '${ baseName }' of '${ node.type }' already in use. Renamed to '${ name }'.` );
|
|
|
|
|
|
}
|
|
|
|
|
|
- declarations[ name ] = node;
|
|
|
+ declarations[ property ] = node;
|
|
|
|
|
|
}
|
|
|
|