ForwardPipeline render_pass
@@ -22,6 +22,7 @@ impl ForwardPipeline {
/// Render the objects with the given surface materials and the given set of lights.
/// Must be called in a render target render function, for example in the callback function of [Screen::write].
///
+ #[deprecated = "Use render_pass instead"]
pub fn light_pass(
&self,
camera: &Camera,
@@ -31,28 +32,19 @@ impl ForwardPipeline {
spot_lights: &[&SpotLight],
point_lights: &[&PointLight],
) -> Result<()> {
- for (object, material) in objects {
- if in_frustum(camera, object) {
- object.render_forward(
- *material,
+ self.render_pass(
camera,
+ objects,
&Lights {
ambient_light: ambient_light.map(|l| l.clone()),
- directional_lights: directional_lights
- .iter()
- .map(|l| (*l).clone())
- .collect(),
+ directional_lights: directional_lights.iter().map(|l| (*l).clone()).collect(),
spot_lights: spot_lights.iter().map(|l| (*l).clone()).collect(),
point_lights: point_lights.iter().map(|l| (*l).clone()).collect(),
},
- )?;
- }
- }
-
- Ok(())
+ )
}
- pub fn light_pass2(
+ pub fn render_pass(
&self,
camera: &Camera,
objects: &[(&dyn Object, &dyn ForwardMaterial)],
