Module bottomless_pit::material
source · Expand description
Contains the Material and MaterialBuilder struct which are needed for anything to be rendered
// Simple code to draw a 100x100 red rectangle to the screen
let defualt_material = MaterialBuilder::new().build();
impl Game for Struct {
fn render<'pass, 'others>(&mut Self, mut renderer: RenderInformation<'pass, 'others>) where 'others: 'pass {
self.defualt_material.add_rectangle(Vec2{x: 0.0, y: 0.0}, Vec2{x: 100.0, y: 100.0}, Colour::RED, &renderer);
self.default_material.draw(&mut renderer);
}
}Structs
- A diffrent type of material used to draw WebGPU debug lines. These lines will allways be 1px wide and only one instance of this material should ever be made per programm.
- A material represents a unique combination of a Texture and RenderPipeline, while also containing all nessicary buffers
- A builder struct used to create Materials