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: Ensure that setBindGroup matches with @group in the shader. #28953

Merged
merged 3 commits into from
Jul 29, 2024

Conversation

Mutefish0
Copy link
Contributor

Description

Currently, when attaching a cameraProjectionMatrix node to the colorNode, an issue occurs:

截屏2024-07-24 下午2 48 32

After investigating, I found that the issue was caused by a mismatch between setBindGroup and @group.

This PR should fix the issue.

Reproduce

  • Add the code to examples/webgpu_materials.html
material = new THREE.MeshBasicNodeMaterial();
material.colorNode = cameraProjectionMatrix.mul( positionLocal );
materials.push( material );
  • Run npm run start
  • Open http://localhost:8080/examples/webgpu_materials

Copy link

github-actions bot commented Jul 24, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
684 kB (169.4 kB) 684 kB (169.4 kB) +0 B

🌳 Bundle size after tree-shaking

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

Filesize dev Filesize PR Diff
460.9 kB (111.2 kB) 460.9 kB (111.2 kB) +0 B

@sunag
Copy link
Collaborator

sunag commented Jul 29, 2024

I think would be interesting to order the array instead of creating an index.

@sunag sunag merged commit e117afe into mrdoob:dev Jul 29, 2024
12 checks passed
@sunag
Copy link
Collaborator

sunag commented Jul 29, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants