Struct three_d::renderer::DeferredPipeline [−][src]
pub struct DeferredPipeline {
pub debug_type: DebugType,
pub lighting_model: LightingModel,
// some fields omitted
}
Expand description
Deferred render pipeline which can render objects (implementing the Geometry trait) with a DeferredPhysicalMaterial and lighting. Supports different types of lighting models by changing the DeferredPipeline::lighting_model field. Deferred rendering draws the geometry information into a buffer in the DeferredPipeline::render_pass and use that information in the DeferredPipeline::lighting_pass. This means that the lighting is only calculated once per pixel since the depth testing is happening in the render pass. Note: Deferred rendering does not support blending and therefore does not support transparency!
Fields
debug_type: DebugType
Set this to visualize the positions, normals etc. for debug purposes.
lighting_model: LightingModel
use lighting_pass where Light struct contain lighting model
Implementations
Constructor.
pub fn geometry_pass<G: Geometry>(
&mut self,
camera: &Camera,
objects: &[(G, impl Borrow<PhysicalMaterial>)]
) -> ThreeDResult<()>
👎 Deprecated: use render_pass instead
pub fn geometry_pass<G: Geometry>(
&mut self,
camera: &Camera,
objects: &[(G, impl Borrow<PhysicalMaterial>)]
) -> ThreeDResult<()>
use render_pass instead
Render the given geometry and material parameters to a buffer. This function must not be called in a render target render function and needs to be followed by a call to DeferredPipeline::lighting_pass.
pub fn render_pass<G: Geometry>(
&mut self,
camera: &Camera,
objects: &[(G, impl Borrow<DeferredPhysicalMaterial>)]
) -> ThreeDResult<()>
pub fn render_pass<G: Geometry>(
&mut self,
camera: &Camera,
objects: &[(G, impl Borrow<DeferredPhysicalMaterial>)]
) -> ThreeDResult<()>
Render the given geometry and material parameters to a buffer. This function must not be called in a render target render function and needs to be followed by a call to DeferredPipeline::lighting_pass.
pub fn light_pass(
&mut self,
camera: &Camera,
ambient_light: Option<&AmbientLight>,
directional_lights: &[&DirectionalLight],
spot_lights: &[&SpotLight],
point_lights: &[&PointLight]
) -> ThreeDResult<()>
👎 Deprecated: use lighting_pass instead
pub fn light_pass(
&mut self,
camera: &Camera,
ambient_light: Option<&AmbientLight>,
directional_lights: &[&DirectionalLight],
spot_lights: &[&SpotLight],
point_lights: &[&PointLight]
) -> ThreeDResult<()>
use lighting_pass instead
Uses the geometry and surface material parameters written in the last DeferredPipeline::render_pass call and all of the given lights to render the objects. Must be called in a render target render function, for example in the callback function of Screen::write.
Uses the geometry and surface material parameters written in the last DeferredPipeline::render_pass call and all of the given lights to render the objects. Must be called in a render target render function, for example in the callback function of Screen::write.
Auto Trait Implementations
impl !RefUnwindSafe for DeferredPipeline
impl !Send for DeferredPipeline
impl !Sync for DeferredPipeline
impl Unpin for DeferredPipeline
impl !UnwindSafe for DeferredPipeline
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