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

Add a Marching Cubes external sample. #457

Merged
merged 1 commit into from
Oct 11, 2024
Merged

Conversation

tcoppex
Copy link
Contributor

@tcoppex tcoppex commented Oct 7, 2024

Hi,

This sample demonstrates how to dynamically generate procedural meshes based on a signed distant function using a multi-pass marching cubes algorithm on the GPU. It also demonstrates tri-planar mapping and integrates an Ambient Occlusion calculation in the final vertex generation stage.

Live preview: https://tcoppex.github.io/webgpu-marchingcubes/

Cheers.

@kainino0x
Copy link
Collaborator

This is a nice sample! Unfortunately it is having issues on Mac :(
Most likely some kind of undefined behavior (out of bounds?) but let us know if it looks like a Chrome bug.
Screenshot 2024-10-09 at 11 52 23 AM

@tcoppex
Copy link
Contributor Author

tcoppex commented Oct 10, 2024

Hi @kainino0x,

Thanks for your feedback! It does seem like an out-of-bounds issue. So far I've only tested it on Chrome v129.x on Windows 11, as browser builds don't appear to be compliant yet on GNU/Linux. I'll get back to you if I find anything. In the meantime, I'll mark the PR as a draft.

Thanks.

@tcoppex tcoppex marked this pull request as draft October 10, 2024 07:50
@tcoppex
Copy link
Contributor Author

tcoppex commented Oct 10, 2024

While I'm not 100% sure why it worked, the issue should now be resolved on Mac.

I reduced the size of the density volume, which mainly affected the compute workgroup size. Despite it was still within general device limits (as defined by https://web3dsurvey.com/), it has done the trick.

@tcoppex tcoppex marked this pull request as ready for review October 10, 2024 16:59
Copy link
Collaborator

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for the sample!

@kainino0x kainino0x merged commit aa492b6 into webgpu:main Oct 11, 2024
1 check passed
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