]> git.tdb.fi Git - libs/gl.git/commitdiff
Don't use an internal depth test in ShadowMap
authorMikko Rasa <tdb@tdb.fi>
Fri, 1 Oct 2021 18:22:18 +0000 (21:22 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 1 Oct 2021 18:31:00 +0000 (21:31 +0300)
It's expected that the content renderable is a Sequence which supplies
the necessary state.

source/effects/shadowmap.cpp
source/effects/shadowmap.h

index 972fefc202e7433a1fd47db0c35fca1b0f3d8f23..39cf3c450a484f7a909f01bfbbd8c7ef74bb475c 100644 (file)
@@ -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);
 }
index 63d946c20e04c4aa4710dad2c345ce4e4e254a35..67103b86f8abfe11ab56ead2ea801759c5138b1c 100644 (file)
@@ -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;