From f96d553dbf78f9d664d1dbb1fe002fc43f23ad47 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 1 Oct 2021 21:22:18 +0300 Subject: [PATCH] Don't use an internal depth test in ShadowMap It's expected that the content renderable is a Sequence which supplies the necessary state. --- source/effects/shadowmap.cpp | 4 ---- source/effects/shadowmap.h | 2 -- 2 files changed, 6 deletions(-) diff --git a/source/effects/shadowmap.cpp b/source/effects/shadowmap.cpp index 972fefc2..39cf3c45 100644 --- a/source/effects/shadowmap.cpp +++ b/source/effects/shadowmap.cpp @@ -22,9 +22,6 @@ ShadowMap::ShadowMap(unsigned s, Renderable &r, const Light &l, Renderable &c): fbo.set_format((DEPTH_ATTACHMENT,DEPTH_COMPONENT32F)); fbo.attach(DEPTH_ATTACHMENT, depth_buf, 0); - depth_test.enabled = true; - depth_test.compare = LEQUAL; - set_darkness(1.0f); shdata.uniform("shd_world_matrix", Matrix()); } @@ -77,7 +74,6 @@ void ShadowMap::setup_frame(Renderer &renderer) Renderer::Push push(renderer); renderer.set_framebuffer(&fbo); renderer.set_camera(shadow_camera); - renderer.set_depth_test(&depth_test); renderer.render(shadow_caster); } diff --git a/source/effects/shadowmap.h b/source/effects/shadowmap.h index 63d946c2..67103b86 100644 --- a/source/effects/shadowmap.h +++ b/source/effects/shadowmap.h @@ -2,7 +2,6 @@ #define MSP_GL_SHADOWMAP_H_ #include "camera.h" -#include "depthtest.h" #include "effect.h" #include "framebuffer.h" #include "programdata.h" @@ -30,7 +29,6 @@ private: Camera shadow_camera; Matrix shadow_matrix; Texture2D depth_buf; - DepthTest depth_test; const Sampler &sampler; Vector3 target; float radius; -- 2.45.2