Skip to main content

mraphics_core/material/
mobject_2d.rs

1use crate::Material;
2
3/// Material used for rendering [`Mobject2DStroke`] objects.
4///
5/// # Camera Compatibility
6/// This material is specifically designed to work with [`crate::PerspectiveCamera`].
7/// Using it with other camera types will result in incorrect rendering.
8#[derive(Clone)]
9pub struct Mobject2DMaterial {}
10
11impl Mobject2DMaterial {
12    pub fn new() -> Self {
13        Self {}
14    }
15}
16
17impl Material for Mobject2DMaterial {
18    fn identifier(&self) -> &str {
19        "Mraphics Mobject2D Material"
20    }
21
22    fn shader_code(&self) -> &str {
23        include_str!("shaders/mobject_2d.wgsl")
24    }
25}