Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified examples/screenshots/webgpu_tsl_compute_attractors_particles.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/nodes/accessors/BatchNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ class BatchNode extends Node {

const getIndirectIndex = Fn( ( [ id ] ) => {

const size = textureSize( textureLoad( this.batchMesh._indirectTexture ), 0 );
const x = int( id ).modInt( int( size ) );
const y = int( id ).div( int( size ) );
const size = int( textureSize( textureLoad( this.batchMesh._indirectTexture ), 0 ) );
const x = int( id ).modInt( size );
const y = int( id ).div( size );
return textureLoad( this.batchMesh._indirectTexture, ivec2( x, y ) ).x;

} ).setLayout( {
Expand Down
8 changes: 8 additions & 0 deletions src/nodes/core/ConstNode.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import InputNode from './InputNode.js';

const _regNum = /float|u?int/;

/**
* Class for representing a constant value in the shader.
*
Expand Down Expand Up @@ -50,6 +52,12 @@ class ConstNode extends InputNode {

const type = this.getNodeType( builder );

if ( _regNum.test( type ) && _regNum.test( output ) ) {

return builder.generateConst( output, this.value );

}

return builder.format( this.generateConst( builder ), type, output );

}
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/pmrem/PMREMUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export const blur = /*@__PURE__*/ Fn( ( { n, latitudinal, poleAxis, outputDirect
axis.assign( normalize( axis ) );

const gl_FragColor = vec3().toVar();
gl_FragColor.addAssign( weights.element( int( 0 ) ).mul( getSample( { theta: 0.0, axis, outputDirection, mipInt, envMap, CUBEUV_TEXEL_WIDTH, CUBEUV_TEXEL_HEIGHT, CUBEUV_MAX_MIP } ) ) );
gl_FragColor.addAssign( weights.element( 0 ).mul( getSample( { theta: 0.0, axis, outputDirection, mipInt, envMap, CUBEUV_TEXEL_WIDTH, CUBEUV_TEXEL_HEIGHT, CUBEUV_MAX_MIP } ) ) );

Loop( { start: int( 1 ), end: n }, ( { i } ) => {

Expand Down
Loading