[][src]Struct spritec::renderer::JointMatrixTexture

pub struct JointMatrixTexture(_);

Stores the joint matrices as a texture so they can be used in the shader

This is a way to simulate dynamic storage in GLSL. The matrices are stored as one long texture where each x coordinate is a 4D matrix. The columns of the matrix can be accessed using the 4D values at each y coordinate 0 through 3. (See GLSL texelFetch)

Reference: https://webgl2fundamentals.org/webgl/lessons/webgl-skinning.html

Methods

impl JointMatrixTexture[src]

pub fn new(
    display: &Display,
    joint_matrices: impl Iterator<Item = Mat4>
) -> Result<Self, TextureCreationError>
[src]

pub fn identity(display: &Display) -> Result<Self, TextureCreationError>[src]

Returns a joint matrix texture with a single identity matrix in it

pub fn as_texture(&self) -> &Texture2d[src]

Trait Implementations

impl Debug for JointMatrixTexture[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.