#[repr(C)]pub struct Vertex {
pub pos: [f32; 3],
pub normal: [f32; 3],
pub tangent: [f32; 3],
pub color: [f32; 3],
pub uv: [f32; 2],
}Expand description
Vertex layout shared by all mesh producers and both GPU backends. Repr(C) so it can be cast directly to GPU buffer memory.
Fields§
§pos: [f32; 3]Object-space position.
normal: [f32; 3]Object-space surface normal, normalised. Transformed to world space in the vertex shader. Used for diffuse lighting in the fragment shader.
tangent: [f32; 3]Object-space tangent vector (U direction of the normal map). Transformed to world space in the vertex shader. Used to build the TBN matrix for tangent-space normal mapping.
color: [f32; 3]Linear RGB colour.
uv: [f32; 2]Texture coordinates in [0, 1] space. (0,0) is top-left.
Trait Implementations§
impl Copy for Vertex
impl NoUninit for Vertex
Auto Trait Implementations§
impl Freeze for Vertex
impl RefUnwindSafe for Vertex
impl Send for Vertex
impl Sync for Vertex
impl Unpin for Vertex
impl UnsafeUnpin for Vertex
impl UnwindSafe for Vertex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more