|
|
@@ -74,9 +74,9 @@ class BatchNode extends Node {
|
|
|
|
|
|
const getIndirectIndex = Fn( ( [ id ] ) => {
|
|
|
|
|
|
- const size = int( textureSize( textureLoad( this.batchMesh._indirectTexture ), 0 ).x );
|
|
|
- const x = int( id ).mod( size );
|
|
|
- const y = int( id ).div( size );
|
|
|
+ const size = int( textureSize( textureLoad( this.batchMesh._indirectTexture ), 0 ).x ).toConst();
|
|
|
+ const x = int( id ).mod( size ).toConst();
|
|
|
+ const y = int( id ).div( size ).toConst();
|
|
|
return textureLoad( this.batchMesh._indirectTexture, ivec2( x, y ) ).x;
|
|
|
|
|
|
} ).setLayout( {
|
|
|
@@ -91,11 +91,11 @@ class BatchNode extends Node {
|
|
|
|
|
|
const matricesTexture = this.batchMesh._matricesTexture;
|
|
|
|
|
|
- const size = int( textureSize( textureLoad( matricesTexture ), 0 ).x );
|
|
|
- const j = float( indirectId ).mul( 4 ).toInt().toVar();
|
|
|
+ const size = int( textureSize( textureLoad( matricesTexture ), 0 ).x ).toConst();
|
|
|
+ const j = float( indirectId ).mul( 4 ).toInt().toConst();
|
|
|
|
|
|
- const x = j.mod( size );
|
|
|
- const y = j.div( size );
|
|
|
+ const x = j.mod( size ).toConst();
|
|
|
+ const y = j.div( size ).toConst();
|
|
|
const batchingMatrix = mat4(
|
|
|
textureLoad( matricesTexture, ivec2( x, y ) ),
|
|
|
textureLoad( matricesTexture, ivec2( x.add( 1 ), y ) ),
|
|
|
@@ -110,10 +110,10 @@ class BatchNode extends Node {
|
|
|
|
|
|
const getBatchingColor = Fn( ( [ id ] ) => {
|
|
|
|
|
|
- const size = int( textureSize( textureLoad( colorsTexture ), 0 ).x );
|
|
|
+ const size = int( textureSize( textureLoad( colorsTexture ), 0 ).x ).toConst();
|
|
|
const j = id;
|
|
|
- const x = j.mod( size );
|
|
|
- const y = j.div( size );
|
|
|
+ const x = j.mod( size ).toConst();
|
|
|
+ const y = j.div( size ).toConst();
|
|
|
return textureLoad( colorsTexture, ivec2( x, y ) ).rgb;
|
|
|
|
|
|
} ).setLayout( {
|