From c94bfd67c7dc2aea719288b2f2457e7397a439e5 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 17 Oct 2024 18:14:20 +0100 Subject: Remove magic number for stencil view angles --- gfx/gl/shadowStenciller.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gfx') diff --git a/gfx/gl/shadowStenciller.cpp b/gfx/gl/shadowStenciller.cpp index 68b12ae..55ad8e1 100644 --- a/gfx/gl/shadowStenciller.cpp +++ b/gfx/gl/shadowStenciller.cpp @@ -10,6 +10,8 @@ #include "maths.h" #include +template constexpr T STENCIL_ANGLES = 8; + ShadowStenciller::ShadowStenciller() : shadowCaster {shadowStencil_vs, shadowStencil_gs, shadowStencil_fs}, viewProjections {} { @@ -39,8 +41,8 @@ ShadowStenciller::createStencilTexture(GLsizei width, GLsizei height) glTexParameter(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameter(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_DEPTH_COMPONENT, width, height, 8, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, - nullptr); + glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_DEPTH_COMPONENT, width, height, STENCIL_ANGLES, 0, + GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, nullptr); return stencil; } -- cgit v1.2.3