hadronized / luminance-rs

Type-safe, type-level and stateless Rust graphics framework
https://phaazon.github.io/learn-luminance/
Other
1.09k stars 59 forks source link

Instanced rendering using instance attributes? #586

Open KeyboardDanni opened 2 years ago

KeyboardDanni commented 2 years ago

Hi,

I'm looking to see if I can switch from glium to luminance. Right now I'm trying to see if I can do instancing using a vertex instance buffer like in this example? https://github.com/glium/glium/blob/master/examples/instancing.rs

In glium you can pair a vertex buffer (i.e. a simple quad) with an instance buffer (i.e. the sprite attributes to draw with) and each instance gets its own "view" of the sprite attributes like world_position, no need to use gl_InstanceID. Basically I want "instanced arrays" per this article. I don't want to use a uniform to do this because I will quickly bump against the 16k storage size limit of uniforms and I want to be able to draw batches of up to 8192 sprites at a time.

Is this possible to do in luminance?

realvictorprm commented 1 year ago

Isn't this instancing? https://github.com/phaazon/luminance-rs/commit/2b5c2c7297f958633181dcc05c2653f009b28021