{"repo":"Kjolnyr/bevy_app_compute","free":true,"listed":false,"github":"https://github.com/Kjolnyr/bevy_app_compute","clone":"git clone https://github.com/Kjolnyr/bevy_app_compute.git","description":"App compute plugin for Bevy","language":"Rust","stars":111,"topics":["rust","bevy","bevy-plugin","compute-shader"],"license":null,"category":"game-templates","readme_excerpt":"Bevy App Compute An easy way to run wgpu compute shaders within a bevy app. Getting Started Add the following line to your Cargo.toml Usage Setup Declare your shaders in structs implementing ComputeShader . The shader() fn should point to your shader source code. You need to derive TypePath as well: Next, declare a struct implementing ComputeWorker to declare the bindings and the logic of your worker: Don't forget to add a shader file to your assets/ folder: Add the AppComputePlugin plugin to your app, as well as one AppComputeWorkerPlugin per struct implementing ComputeWorker : Your compute worker will now run every frame, during the PostUpdate stage. To read/write from it, use the AppComputeWorker resource! (see simple.rs) Multiple passes You can have multiple passes without having to copy data back to the CPU in between: (see multi pass.rs) One shot computes You can configure your worker to execute only when requested: Then, you can call execute() on your worker when you are ready to execute it: It will run at the end of the current frame, and you'll be able to read the data in the next frame. (see one shot.rs) Examples See examples Bevy version mapping Bevy bevy app compute ---- ---------------- 0.16 0.16","default_branch":null,"files":null,"tree":[],"storefront":"/r/Kjolnyr","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Kjolnyr/bevy_app_compute/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}