Enum blender_mesh::MaterialInput[][src]

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: Clone, I: Clone> Clone for MaterialInput<U, I>[src]

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

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

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

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

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

impl<U, I> StructuralPartialEq for MaterialInput<U, I>[src]

Auto Trait Implementations

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

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

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

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

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

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,