Struct three_d::renderer::material::ColorMaterial [−][src]
pub struct ColorMaterial {
pub color: Color,
pub texture: Option<Rc<Texture2D<u8>>>,
pub opaque_render_states: RenderStates,
pub transparent_render_states: RenderStates,
}
Expand description
A material that renders a Shadable object in a color defined by multiplying a color with an optional texture and optional per vertex colors. This material is not affected by lights.
Fields
color: Color
A color applied everywhere.
texture: Option<Rc<Texture2D<u8>>>
An optional texture which is samples using uv coordinates (requires that the Shadable object supports uv coordinates).
opaque_render_states: RenderStates
Render states used when the color is opaque (has a maximal alpha value).
transparent_render_states: RenderStates
Render states used when the color is transparent (does not have a maximal alpha value).
Implementations
Constructs a new color material from a CPUMaterial.
Trait Implementations
Returns the fragment shader source for this material. Should output the final fragment color.
fn use_uniforms(
&self,
program: &Program,
_camera: &Camera,
_lights: &Lights
) -> ThreeDResult<()>
fn use_uniforms(
&self,
program: &Program,
_camera: &Camera,
_lights: &Lights
) -> ThreeDResult<()>
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.
Auto Trait Implementations
impl !RefUnwindSafe for ColorMaterial
impl !Send for ColorMaterial
impl !Sync for ColorMaterial
impl Unpin for ColorMaterial
impl !UnwindSafe for ColorMaterial
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more