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.
@logicprojects Жыл бұрын
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.
@DristusFalchion2 жыл бұрын
So hyped for this. Thank you for making it!
@SunSin91 Жыл бұрын
I was looking for something like this to learn more Rust, and here it is ! thanks, will study this.. Im into particle simulation.
@Otakutaru2 жыл бұрын
This is soooo niche.... and sooo goood :D
@IMPOSING-NOOB22332 жыл бұрын
I have a project where FPS drops after I render about 50,000 batched sprites per frame. Looking forward to moving to GPU shader like this. Thanks!!!
@SEOTADEO Жыл бұрын
Thanks, so interesting!
@michaeljamescollins6800 Жыл бұрын
thank you
@jeffg46862 жыл бұрын
Great topic. Are you able to build this with wasm-pack or similar and run with same result?
@logicprojects2 жыл бұрын
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
@jeffg4686 Жыл бұрын
@@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.
@redberries8039 Жыл бұрын
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.
@redberries8039 Жыл бұрын
'render_resource::BufferSlice ' is a bust. The buffer being referred to is the command buffer, not any ad-hoc storage buffer
@feathersm79662 жыл бұрын
Brilliant info, tried to do this a while back.
@rotteegher392 жыл бұрын
Cool
@airman122469 Жыл бұрын
Why exactly do you need to copy from the GPU to CPU? The material should just stay on the texture buffer on the GPU.
@buren77 Жыл бұрын
Just for debugging purposes
@soupborsh60022 жыл бұрын
Can you rewrite The Powder Toy with compute shader? It will be amazing! This game is FOSS.
@jacques-dev2 жыл бұрын
I wonder what kind of logic you need for a gas and fluid sim like Powder Toy and how that code would need to run on the GPU
@airman122469 Жыл бұрын
I feel like shaders should just be dealt with in the material render pass.