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

Implement better compute support #2638

Open
Dimev opened this issue Aug 11, 2021 · 4 comments
Open

Implement better compute support #2638

Dimev opened this issue Aug 11, 2021 · 4 comments
Labels
A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible

Comments

@Dimev
Copy link
Contributor

Dimev commented Aug 11, 2021

What problem does this solve or what need does it fill?

I'm working on adding voxel cone tracing, which requires meshes to be processed with a compute shader. Right now, some of the compute bindings from wgpu are still missing, and things like Draw don't work with compute passes

What solution would you like?

Something similar to how the Draw logic currently works, but in a way that allows compute shaders as well, by either allowing it to have both Compute and Render passes, or making a seperate system that works for compute.

What alternative(s) have you considered?

None yet, besides implementing this myself, but I'll need help with understanding how the draw system works in more detail first.

Additional context

I've already made a pr for adding some of the missing wgpu exports for compute in #2628, but not much more.
I'm also working on the voxel cone tracing here: https://github.com/Dimev/bevy-vxgi, but I have no clue how correct this is due to not knowing much about the rendering system (yet)

@Dimev Dimev added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Aug 11, 2021
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Aug 11, 2021
@StarArawn
Copy link
Contributor

and things like Draw don't work with compute passes

I'm a little confused because compute passes can't draw things to the screen its not possible. Ideally compute runs before any draw nodes.

Example:

  1. Dispatch Compute Node to calculate mesh
  2. Pass mesh to standard bevy or custom Draw pipeline.

@Dimev
Copy link
Contributor Author

Dimev commented Aug 11, 2021

hmm
Effectively I need to run a compute shader for all meshes that are drawn, then write to a shared texture, so having some ways to process things with compute in a draw pipeline would be handy

@StarArawn
Copy link
Contributor

hmm
Effectively I need to run a compute shader for all meshes that are drawn, then write to a shared texture, so having some ways to process things with compute in a draw pipeline would be handy

I'm not really sure how VCT works in terms of vowelizing meshes, but if I had to guess you would pass a list of mesh buffers to the compute shader along with a list of game entities and transforms.

@Dimev
Copy link
Contributor Author

Dimev commented Aug 11, 2021

yeah, I'd have to run the compute shader per mesh, then run another after that is done again, which I still have no idea of how that would work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible
Projects
None yet
Development

No branches or pull requests

3 participants