Compute Shaders in Bevy

  Рет қаралды 13,326

Logic Projects

Logic Projects

Күн бұрын

Пікірлер: 21
@patrick1532
@patrick1532 Жыл бұрын
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
@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.
@DristusFalchion
@DristusFalchion 2 жыл бұрын
So hyped for this. Thank you for making it!
@SunSin91
@SunSin91 Жыл бұрын
I was looking for something like this to learn more Rust, and here it is ! thanks, will study this.. Im into particle simulation.
@Otakutaru
@Otakutaru 2 жыл бұрын
This is soooo niche.... and sooo goood :D
@IMPOSING-NOOB2233
@IMPOSING-NOOB2233 2 жыл бұрын
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
@SEOTADEO Жыл бұрын
Thanks, so interesting!
@michaeljamescollins6800
@michaeljamescollins6800 Жыл бұрын
thank you
@jeffg4686
@jeffg4686 2 жыл бұрын
Great topic. Are you able to build this with wasm-pack or similar and run with same result?
@logicprojects
@logicprojects 2 жыл бұрын
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
@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
@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
@redberries8039 Жыл бұрын
'render_resource::BufferSlice ' is a bust. The buffer being referred to is the command buffer, not any ad-hoc storage buffer
@feathersm7966
@feathersm7966 2 жыл бұрын
Brilliant info, tried to do this a while back.
@rotteegher39
@rotteegher39 2 жыл бұрын
Cool
@airman122469
@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
@buren77 Жыл бұрын
Just for debugging purposes
@soupborsh6002
@soupborsh6002 2 жыл бұрын
Can you rewrite The Powder Toy with compute shader? It will be amazing! This game is FOSS.
@jacques-dev
@jacques-dev 2 жыл бұрын
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
@airman122469 Жыл бұрын
I feel like shaders should just be dealt with in the material render pass.
@hak0bu
@hak0bu 2 жыл бұрын
Actually first :D
Bevy Rendering Demystified
25:30
Logic Projects
Рет қаралды 15 М.
How To Write Fast Shaders
10:33
Jump Trajectory
Рет қаралды 21 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
Bevy 0.14 -- Rust Powered Game Engine
12:01
Gamefromscratch
Рет қаралды 28 М.
Introduction to Vulkan Compute Shaders
21:39
İlker
Рет қаралды 12 М.
Simulating 2D Gravity with Compute Shaders in Godot
28:39
The Pathfinders Codex
Рет қаралды 1 М.
Bevy 0.14.2, Compute Shaders, and Simulations - This Week in Bevy
9:40
Interactive Graphics 17 - Geometry Shaders
51:09
Cem Yuksel
Рет қаралды 10 М.
Bevy 0.8's New Material System
10:33
Logic Projects
Рет қаралды 6 М.
WebGPU :: Javascript at the speed of Light
20:02
Visionary 3D
Рет қаралды 85 М.
WebGPU :: Rendering the future in Real-Time
17:03
Visionary 3D
Рет қаралды 198 М.
Welcome to Shaderland - An introduction to shaders in Godot
1:12:51
How to use Compute Shaders in Godot 4
13:25
Crigz Vs Game Dev
Рет қаралды 21 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН