Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodes: IndexNode - invocationLocalIndex #29202

Merged
merged 6 commits into from
Aug 24, 2024

Conversation

cmhhelgeson
Copy link
Contributor

@cmhhelgeson cmhhelgeson commented Aug 21, 2024

Description

Adds a new LOCAL scope to IndexNode. This scope allows the user to access the local_invocation_index builtin as a node within a TSL function. While this functionality is primarily intended for use in applications targeting WebGPU, I'm investigating whether parity with the WebGLBackend could potentially be maintained by taking the modulus of the gl_instanceID by a compute shader's workgroup size.

Reference definition here:
https://www.w3.org/TR/WGSL/#local-invocation-index-builtin-value

Copy link

github-actions bot commented Aug 21, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
685.4 kB (169.7 kB) 685.4 kB (169.7 kB) +0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
462 kB (111.4 kB) 462 kB (111.4 kB) +0 B

@cmhhelgeson cmhhelgeson marked this pull request as ready for review August 21, 2024 22:15
@sunag sunag added this to the r168 milestone Aug 21, 2024
@RenaudRohlinger RenaudRohlinger added the TSL Three.js Shading Language label Aug 22, 2024
src/nodes/core/IndexNode.js Outdated Show resolved Hide resolved
@sunag sunag changed the title Nodes: IndexNode - localInstanceIndex Nodes: IndexNode - invocationLocalIndex Aug 24, 2024
@sunag sunag merged commit 676e85d into mrdoob:dev Aug 24, 2024
12 checks passed
@cmhhelgeson cmhhelgeson deleted the local_invocation_index branch September 6, 2024 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TSL Three.js Shading Language
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants