[−][src]Struct spritec::renderer::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]
display: &Display,
joint_matrices: impl Iterator<Item = Mat4>
) -> Result<Self, TextureCreationError>
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
Auto Trait Implementations
impl !RefUnwindSafe for JointMatrixTexture
impl !Send for JointMatrixTexture
impl !Sync for JointMatrixTexture
impl Unpin for JointMatrixTexture
impl !UnwindSafe for JointMatrixTexture
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,