Trait three_d::renderer::material::Material[][src]

pub trait Material {
    fn fragment_shader_source(
        &self,
        use_vertex_colors: bool,
        lights: &Lights
    ) -> String;
fn use_uniforms(
        &self,
        program: &Program,
        camera: &Camera,
        lights: &Lights
    ) -> ThreeDResult<()>;
fn render_states(&self) -> RenderStates;
fn is_transparent(&self) -> bool; }
Expand description

Represents a material that can be applied to a Shadable object.

The material can use the attributes position (in world space) by adding in vec3 pos;, normal by in vec3 nor;, uv coordinates by in vec2 uvs; and color by in vec4 col; to the fragment shader source code.

Required methods

Returns the fragment shader source for this material. Should output the final fragment color.

Sends the uniform data needed for this material to the fragment shader.

Returns the render states needed to render with this material.

Returns whether or not this material is transparent.

Implementations on Foreign Types

Implementors