[][src]Enum blender_mesh::MaterialInput

pub enum MaterialInput<U, I> {
    Uniform(U),
    ImageTexture(I),
}

An input to a material property.

This can either be some uniform value that will get used across all vertices / fragments in your shader, or a texture.

Variants

Uniform(U)

Some value that is uniform across all vertices / fragments in your mesh.

ImageTexture(I)

The name of the texture image (excluding the full path) from an image texture node in Blender's material editor.

So a texture stored at /Users/me/hello-world.png becomes MaterialInput::Texture("hello-world.png".to_string())

This means that it is important to have different texture names across all unique textures in your application.

Note

This is different from the other built in texture nodes, such as brick texture and sky texture. We do not currently support these. If these would be useful for you, open an issue!

Examples

// Metalness can be read from the green channel of metal.jpg
use blender_mesh::{MaterialInput, Channel};
let metalness: MaterialInput<f32, (String, Channel)> =
    MaterialInput::ImageTexture((String::from("metal.jpg"), Channel::Green));

Trait Implementations

impl<U: PartialEq, I: PartialEq> PartialEq<MaterialInput<U, I>> for MaterialInput<U, I>[src]

impl<U, I> Default for MaterialInput<U, I> where
    U: Default
[src]

impl<U: Debug, I: Debug> Debug for MaterialInput<U, I>[src]

impl<U, I> Serialize for MaterialInput<U, I> where
    U: Serialize,
    I: Serialize
[src]

impl<'de, U, I> Deserialize<'de> for MaterialInput<U, I> where
    U: Deserialize<'de>,
    I: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<U, I> Send for MaterialInput<U, I> where
    I: Send,
    U: Send

impl<U, I> Unpin for MaterialInput<U, I> where
    I: Unpin,
    U: Unpin

impl<U, I> Sync for MaterialInput<U, I> where
    I: Sync,
    U: Sync

impl<U, I> UnwindSafe for MaterialInput<U, I> where
    I: UnwindSafe,
    U: UnwindSafe

impl<U, I> RefUnwindSafe for MaterialInput<U, I> where
    I: RefUnwindSafe,
    U: RefUnwindSafe

Blanket Implementations

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

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

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.

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

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>,