I really wish there was more documentation and examples on shader integration in bevy, I'm trying to do something relatively simple but unconventional and I don't want to completely tear out the bevy render pipeline and lose out on their parallelism, but most of the bits you actually have to write in their abstractions are standard wgpu boilerplate but more obfuscated and spaghettified because the control flow is not entirely clear from their examples. I'm probably wrong but it's a little frustrating. Thanks for doing your part to help.
Yeah the best documentation is to look at how the engine does things. I often have to look at how they handle lights and UI rendering to understand how I could add something myself.
I'm away from my home setup for holidays so I can't test that anytime soon. My intuition would be no, because I've seen some issues with the storage buffers we use and WebGL but the overall compute shader techniques should work. But also I've seen bevy internally use them for point lights so maybe it would work, needs testing
@@logicprojects - thanks, I'll give it a try this week. Just getting back into this. The compute is where it's at, for sure. A lot more legwork, but worth it. I wonder if they'll be able to do a "derive" for this at some point like they did with the regular shaders. That was nice to see all that come together. they really highlighted the power of the derive. Oh, and thanks again for putting this together. You're not kidding when you say there isn't much documentation out there, and I'm not talking about Bevy. I'm talking about Compute. Combine the two, and there's just a few videos now, so each is much appreciated, and all including this one have been a big help. Curious also, if you've looked into, or used "Multi Draw Indirect" functionality in any game frameworks before. I believe this is able to be done through wgpu using compute shaders, but I haven't looked into it yet. I think in some cases can be very helpful performance wise especially for dedicated (not on chip) gpus in scenes with lots of unique objects (not having to round trip to cpu for each) - not sure how much it buys. probably very scene dependent.
Re reading buffer data back to cpu: Can your read_buffer fn run as a Bevy 'system' on 'update' or do we need to run it from the Render-World ie render node run() or something similar? Since you were 'vague' on getting the buffer data to the App-World I assume it's called from somewhere like a render node run()?? Have you had any further thoughts on getting the renderworld vec back into the appworld? There's Struct bevy::render::render_resource::BufferSlice which has 'pub fn map_async' which looks like it might do something similar to your custom fn, but doesn't help us get the data to the appworld. This is all a bit beyond me so any help would be appreciated.