Struct three_d::PhongForwardInstancedMesh [−][src]
An instanced triangle mesh that adds additional lighting functionality based on the Phong shading model to a InstancedMesh.
Fields
name: String
material: PhongMaterial
Implementations
impl PhongForwardInstancedMesh
[src]
pub fn new(
context: &Context,
transformations: &[Mat4],
cpu_mesh: &CPUMesh,
material: &PhongMaterial
) -> Result<Self, Error>
[src]
context: &Context,
transformations: &[Mat4],
cpu_mesh: &CPUMesh,
material: &PhongMaterial
) -> Result<Self, Error>
pub fn render_with_ambient(
&self,
render_states: RenderStates,
viewport: Viewport,
transformation: &Mat4,
camera: &Camera,
ambient_light: &AmbientLight
) -> Result<(), Error>
[src]
&self,
render_states: RenderStates,
viewport: Viewport,
transformation: &Mat4,
camera: &Camera,
ambient_light: &AmbientLight
) -> Result<(), Error>
Render the instanced triangle mesh shaded with an ambient light. Must be called in a render target render function, for example in the callback function of Screen::write.
pub fn render_with_ambient_and_directional(
&self,
render_states: RenderStates,
viewport: Viewport,
transformation: &Mat4,
camera: &Camera,
ambient_light: &AmbientLight,
directional_light: &DirectionalLight
) -> Result<(), Error>
[src]
&self,
render_states: RenderStates,
viewport: Viewport,
transformation: &Mat4,
camera: &Camera,
ambient_light: &AmbientLight,
directional_light: &DirectionalLight
) -> Result<(), Error>
Render the triangle mesh shaded with an ambient and a directional light. Must be called in a render target render function, for example in the callback function of Screen::write.
Methods from Deref<Target = InstancedMesh>
pub fn render_depth(
&self,
render_states: RenderStates,
viewport: Viewport,
transformation: &Mat4,
camera: &Camera
) -> Result<(), Error>
[src]
&self,
render_states: RenderStates,
viewport: Viewport,
transformation: &Mat4,
camera: &Camera
) -> Result<(), Error>
Render only the depth of the instanced mesh into the current depth render target which is useful for shadow maps or depth pre-pass. Must be called in a render target render function, for example in the callback function of Screen::write. The transformation can be used to position, orientate and scale the instanced mesh.
pub fn render_color(
&self,
render_states: RenderStates,
viewport: Viewport,
transformation: &Mat4,
camera: &Camera
) -> Result<(), Error>
[src]
&self,
render_states: RenderStates,
viewport: Viewport,
transformation: &Mat4,
camera: &Camera
) -> Result<(), Error>
Render the instanced mesh with a color per triangle vertex. The colors are defined when constructing the instanced mesh. Must be called in a render target render function, for example in the callback function of Screen::write. The transformation can be used to position, orientate and scale the instanced mesh.
Errors
Will return an error if the instanced mesh has no colors.
pub fn render_with_color(
&self,
color: &Vec4,
render_states: RenderStates,
viewport: Viewport,
transformation: &Mat4,
camera: &Camera
) -> Result<(), Error>
[src]
&self,
color: &Vec4,
render_states: RenderStates,
viewport: Viewport,
transformation: &Mat4,
camera: &Camera
) -> Result<(), Error>
Render the instanced mesh with the given color. Must be called in a render target render function, for example in the callback function of Screen::write. The transformation can be used to position, orientate and scale the instanced mesh.
pub fn render_with_texture(
&self,
texture: &dyn Texture,
render_states: RenderStates,
viewport: Viewport,
transformation: &Mat4,
camera: &Camera
) -> Result<(), Error>
[src]
&self,
texture: &dyn Texture,
render_states: RenderStates,
viewport: Viewport,
transformation: &Mat4,
camera: &Camera
) -> Result<(), Error>
Render the instanced mesh with the given texture. Must be called in a render target render function, for example in the callback function of Screen::write. The transformation can be used to position, orientate and scale the instanced mesh.
Errors
Will return an error if the instanced mesh has no uv coordinates.
pub fn render(
&self,
program: &InstancedMeshProgram,
render_states: RenderStates,
viewport: Viewport,
transformation: &Mat4,
camera: &Camera
) -> Result<(), Error>
[src]
&self,
program: &InstancedMeshProgram,
render_states: RenderStates,
viewport: Viewport,
transformation: &Mat4,
camera: &Camera
) -> Result<(), Error>
Render the instanced mesh with the given InstancedMeshProgram. Must be called in a render target render function, for example in the callback function of Screen::write. The transformation can be used to position, orientate and scale the instanced mesh.
Errors
Will return an error if the instanced mesh shader program requires a certain attribute and the instanced mesh does not have that attribute. For example if the program needs the normal to calculate lighting, but the mesh does not have per vertex normals, this function will return an error.
Trait Implementations
impl Deref for PhongForwardInstancedMesh
[src]
type Target = InstancedMesh
The resulting type after dereferencing.
fn deref(&self) -> &InstancedMesh
[src]
impl Drop for PhongForwardInstancedMesh
[src]
Auto Trait Implementations
impl !RefUnwindSafe for PhongForwardInstancedMesh
impl !Send for PhongForwardInstancedMesh
impl !Sync for PhongForwardInstancedMesh
impl Unpin for PhongForwardInstancedMesh
impl !UnwindSafe for PhongForwardInstancedMesh
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,