pub struct NormalMap {
pub texture: Arc<RgbImage>,
pub factor: f32,
}Expand description
Defines the normal texture of a material.
Fields§
§texture: Arc<RgbImage>A tangent space normal map. The texture contains RGB components in linear space. Each texel represents the XYZ components of a normal vector in tangent space.
- Red [0 to 255] maps to X [-1 to 1].
- Green [0 to 255] maps to Y [-1 to 1].
- Blue [128 to 255] maps to Z [1/255 to 1].
The normal vectors use OpenGL conventions where +X is right, +Y is up, and +Z points toward the viewer.
factor: f32The normal_factor is the normal strength to be applied to the
texture value.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NormalMap
impl RefUnwindSafe for NormalMap
impl Send for NormalMap
impl Sync for NormalMap
impl Unpin for NormalMap
impl UnwindSafe for NormalMap
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