Struct three_d::PhongDeferredPipeline[][src]

pub struct PhongDeferredPipeline {
    pub debug_type: DebugType,
    // some fields omitted
}

Deferred pipeline based on the Phong reflection model supporting a performance-limited amount of directional, point and spot lights with shadows. Supports colored, textured and instanced meshes.

Fields

debug_type: DebugType

Set this to visualize the positions, normals etc. for debug purposes.

Implementations

impl PhongDeferredPipeline[src]

pub fn new(context: &Context) -> Result<Self, Error>[src]

Constructor.

pub fn geometry_pass<F: FnOnce() -> Result<(), Error>>(
    &mut self,
    width: usize,
    height: usize,
    render: F
) -> Result<(), Error>
[src]

Render the geometry and surface material parameters of Phong deferred meshes or instanced meshes by calling the render_geometry on either type of mesh inside the render closure. This function must not be called in a render target render function, but needs to be followed by a call to light_pass which must be inside a render target render function.

pub fn light_pass(
    &mut self,
    viewport: Viewport,
    camera: &Camera,
    ambient_light: Option<&AmbientLight>,
    directional_lights: &[&DirectionalLight],
    spot_lights: &[&SpotLight],
    point_lights: &[&PointLight]
) -> Result<(), Error>
[src]

Uses the geometry and surface material parameters written in the last geometry_pass call and all of the given lights to shade the Phong deferred meshes or instanced meshes. Must be called in a render target render function, for example in the callback function of Screen::write.

pub fn geometry_pass_texture(&self) -> &dyn Texture[src]

pub fn geometry_pass_depth_texture_array(&self) -> &dyn Texture[src]

pub fn geometry_pass_depth_texture(&self) -> DepthTargetTexture2D[src]

Auto Trait Implementations

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> 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.