summaryrefslogtreecommitdiff
path: root/gfx/gl/shadowStenciller.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-09-02 21:00:41 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-09-02 21:00:41 +0100
commit052b2b49d9bfdaaa7f7c5603fa7c47b881df93c2 (patch)
treee1ee5476434ae0855a4970c10e7e8fc88744b30b /gfx/gl/shadowStenciller.cpp
parentUpdate Texture::getSize and ::size to account for the third texture dimension (diff)
downloadilt-052b2b49d9bfdaaa7f7c5603fa7c47b881df93c2.tar.bz2
ilt-052b2b49d9bfdaaa7f7c5603fa7c47b881df93c2.tar.xz
ilt-052b2b49d9bfdaaa7f7c5603fa7c47b881df93c2.zip
Update stencil texture to 2d array
Diffstat (limited to 'gfx/gl/shadowStenciller.cpp')
-rw-r--r--gfx/gl/shadowStenciller.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/gfx/gl/shadowStenciller.cpp b/gfx/gl/shadowStenciller.cpp
index 0c34da5..01248bd 100644
--- a/gfx/gl/shadowStenciller.cpp
+++ b/gfx/gl/shadowStenciller.cpp
@@ -25,15 +25,16 @@ glTexture
ShadowStenciller::createStencilTexture(GLsizei width, GLsizei height)
{
glTexture stencil;
- glBindTexture(GL_TEXTURE_2D, stencil);
+ glBindTexture(GL_TEXTURE_2D_ARRAY, stencil);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glTexParameter(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameter(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ 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);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, nullptr);
+ glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_DEPTH_COMPONENT, width, height, 8, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE,
+ nullptr);
return stencil;
}