Deferred material does not iml PostMaterial
@@ -180,64 +180,6 @@ impl DeferredPhysicalMaterial {
}
}
-impl PostMaterial for DeferredPhysicalMaterial {
- fn fragment_shader_source(
- &self,
- lights: &[&dyn Light],
- color_texture: Option<ColorTexture>,
- depth_texture: Option<DepthTexture>,
- ) -> String {
- let mut fragment_shader = lights_shader_source(
- lights,
- LightingModel::Cook(
- NormalDistributionFunction::TrowbridgeReitzGGX,
- GeometryFunction::SmithSchlickGGX,
- ),
- );
- fragment_shader.push_str(
- &color_texture
- .expect("Must supply a gbuffer to a deferred lighting pass")
- .fragment_shader_source(),
- );
- fragment_shader.push_str(
- &depth_texture
- .expect("Must supply a depth texture to a deferred lighting pass")
- .fragment_shader_source(),
- );
- fragment_shader.push_str(include_str!("shaders/deferred_lighting.frag"));
- fragment_shader
- }
-
- fn use_uniforms(
- &self,
- program: &Program,
- camera: &Camera,
- lights: &[&dyn Light],
- color_texture: Option<ColorTexture>,
- depth_texture: Option<DepthTexture>,
- ) {
- color_texture
- .expect("Must supply a gbuffer to a deferred lighting pass")
- .use_uniforms(program);
- depth_texture
- .expect("Must supply a depth texture to a deferred lighting pass")
- .use_uniforms(program);
- program.use_uniform_if_required("cameraPosition", camera.position());
- for (i, light) in lights.iter().enumerate() {
- light.use_uniforms(program, i as u32);
- }
- program.use_uniform_if_required(
- "viewProjectionInverse",
- (camera.projection() * camera.view()).invert().unwrap(),
- );
- program.use_uniform("debug_type", DebugType::NONE as i32);
- }
-
- fn render_states(&self) -> RenderStates {
- RenderStates::default()
- }
-}
-
impl FromCpuMaterial for DeferredPhysicalMaterial {
fn from_cpu_material(context: &Context, cpu_material: &CpuMaterial) -> Self {
Self::new(context, cpu_material)
