Only apply debug effect if some debug effect is chosen
use crate::*;
use num_derive::FromPrimitive;
-#[derive(Copy, Clone, FromPrimitive)]
+#[derive(Copy, Clone, PartialEq, Eq, FromPrimitive)]
enum Type {POSITION = 0, NORMAL = 1, COLOR = 2, DEPTH = 3, NONE = 4}
pub struct DebugEffect {
@@ -27,6 +27,7 @@ impl DebugEffect {
pub fn apply(&self, full_screen: &FullScreen, geometry_texture: &Texture, depth_texture: &Texture) -> Result<(), effects::Error>
{
+ if self.debug_type != Type::NONE {
state::depth_write(&self.gl,false);
state::depth_test(&self.gl, state::DepthTestType::NONE);
state::blend(&self.gl, state::BlendType::SRC_ALPHA__ONE_MINUS_SRC_ALPHA);
@@ -42,6 +43,7 @@ impl DebugEffect {
self.program.use_attribute_vec3_float(&full_screen.buffer(), "position", 0).unwrap();
self.program.use_attribute_vec2_float(&full_screen.buffer(), "uv_coordinate", 1).unwrap();
self.program.draw_arrays(3);
+ }
Ok(())
}
