Comments (1)
@pcwalton Tagging you because you suggested this as a solution, and it's a great idea that would really help advance using bevy for art :). Also, in reviewing the feasibility of implementing this, the most gnarly part passes through the preprocessing compute shader bits which you wrote.
My approach is basically going to be this:
- Add a new
UserMeshInstancePlugin<T>
that the user can add once per application, whereT
ensures proper alignment, etc. - In order not to pollute all the rendering code with a new type parameter, this is going to be type erased as
RawBufferVec<u32>
. - Pass this into the compute shader etc as an optional buffer that enables a shaderdef.
- In the compute shader, bind input, output, and a push constant (or whatever) that indicates the size of the data.
- After culling, write input to output at the same time as the mesh data.
- In the user's vertex shader, they are thus able to do
@group(0) @binding(6) var<storage> my_data: array<MyData>;
and use the instance index to look up their per-mesh data.
Does this general approach make sense? Do you have any other more general advice for how to approach this?
from bevy.
Related Issues (20)
- `DirX::new` should be more explicit about normalization and have a code example HOT 1
- Failed loading libxkbcommon.so.0 HOT 5
- Multiple cameras results in multiple writes to swap chain HOT 1
- Trait fn returning `impl Fn()` cannot be used as a system when called from generic type HOT 4
- Main branch fails to compile on Rust beta.
- Add a builder API to `LoadContext` HOT 1
- Auto exposure breaks when object is too dark HOT 2
- Very Large Material 2d Mesh diagonal artifact issue HOT 2
- Bevy has too many rectangle / box types HOT 5
- Move `bevy_math`'s implementations of `Reflect` into `bevy_math` HOT 1
- Allow access to Arc<CustomAttributes>. HOT 2
- Document that zero-length reflection paths are allowed. HOT 5
- `EMPTY` rect has suboptimal values HOT 3
- High performance sorted queries HOT 13
- Add `World::resource_scope_by_id` HOT 2
- Image loading docs are not clear enough about required feature flags HOT 4
- Squircle / Superellipse for UI / Gizmos / Mesh HOT 7
- Parent device is lost HOT 2
- Add additional names to GLTF entities for easier querying
- Bevy_ui outlines should respect BorderRadius.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bevy.