-
Notifications
You must be signed in to change notification settings - Fork 42
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
support for 3D textures #8
Comments
Thanks for bringing this up! To be honest this probably requires a bigger change on my end. I actually think it would make sense to officially support dense 3D textures within GPULayer (for webgl2/webgpu, and then maybe implement a fallback for webgl1). I would just need to add that functionality to GPULayer and then make another test page to make sure that the filtering is working across browsers (I bet hardware linear filtering is not supported on mobile safari, will need to be polyfilled with a trilinear interpolation function). I probably didn't word it well, but in the readme the TODO was referring to using the 1D GPULayer hack to store vertex information for 3D meshes to do simulations on those (e.g. https://apps.amandaghassaei.com/msh-parser/demo/). I'm planning to add a soft-body simulation at some point, but haven't found the time yet. Let me dig into this and see what is required, might actually be an easy fix. I'm curious what types of things you might want to do with 3D textures? I've been sticking to 2D just bc it's hard to compute large 3D textures in real-time. |
Ah, that makes sense. I'm using 3D textures for maintaining and sorting positions and velocities of boids. Normally boids need to know about every other boid, but with a 3D texture that stores positions in an organized way, I can find the neighbors of a boid more efficiently. I learned about the technique from this article. Here's something quick I made, with over 32,000 boids; tested in Mac Chrome and Safari - |
cool demo - that makes sense. I'll keep you posted if I make progress on this! |
README.md file has a
TODO
note to add an example of working with 3D textures, it would be nice to have.The text was updated successfully, but these errors were encountered: