[Scummvm-git-logs] scummvm master -> ef6efa9e30b97ff6a4262765e8192c5cf2d5e0d8
aquadran
noreply at scummvm.org
Fri Oct 3 11:37:07 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
ef6efa9e30 WINTERMUTE: Disable shadow volumes for TinyGL. It's slow and a bit glitchy due precision.
Commit: ef6efa9e30b97ff6a4262765e8192c5cf2d5e0d8
https://github.com/scummvm/scummvm/commit/ef6efa9e30b97ff6a4262765e8192c5cf2d5e0d8
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2025-10-03T13:36:48+02:00
Commit Message:
WINTERMUTE: Disable shadow volumes for TinyGL. It's slow and a bit glitchy due precision.
Changed paths:
engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp
engines/wintermute/base/gfx/tinygl/base_render_tinygl.h
engines/wintermute/base/gfx/tinygl/shadow_volume_tinygl.cpp
diff --git a/engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp b/engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp
index 6a616ce3f65..975e1589755 100644
--- a/engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp
+++ b/engines/wintermute/base/gfx/tinygl/base_render_tinygl.cpp
@@ -53,6 +53,7 @@ BaseRenderer3D *makeTinyGL3DRenderer(BaseGame *inGame) {
BaseRenderTinyGL::BaseRenderTinyGL(BaseGame *inGame) : BaseRenderer3D(inGame) {
_flipInProgress = false;
+ _shadowVolumesSupported = false;
}
BaseRenderTinyGL::~BaseRenderTinyGL() {
@@ -97,6 +98,9 @@ bool BaseRenderTinyGL::initRenderer(int width, int height, bool windowed) {
_simpleShadow[3].u = 1.0f;
_simpleShadow[3].v = 0.0f;
+ // Disable shadow rendering as it's slow and a bit glitching in precision
+ _shadowVolumesSupported = false;
+
Graphics::PixelFormat pixelFormat = getPixelFormat();
initGraphics(width, height, &pixelFormat);
if (g_system->getScreenFormat() != pixelFormat) {
@@ -753,8 +757,7 @@ void BaseRenderTinyGL::setSpriteBlendMode(Graphics::TSpriteBlendMode blendMode,
}
bool BaseRenderTinyGL::stencilSupported() {
- // assume that we have a stencil buffer
- return true;
+ return _shadowVolumesSupported;
}
int BaseRenderTinyGL::getMaxActiveLights() {
diff --git a/engines/wintermute/base/gfx/tinygl/base_render_tinygl.h b/engines/wintermute/base/gfx/tinygl/base_render_tinygl.h
index 748086401a6..eec0eafc54b 100644
--- a/engines/wintermute/base/gfx/tinygl/base_render_tinygl.h
+++ b/engines/wintermute/base/gfx/tinygl/base_render_tinygl.h
@@ -166,6 +166,7 @@ private:
Common::Array<DXVector4> _lightPositions;
Common::Array<DXVector3> _lightDirections;
TGLuint _postfilterTexture;
+ bool _shadowVolumesSupported;
};
} // wintermute namespace
diff --git a/engines/wintermute/base/gfx/tinygl/shadow_volume_tinygl.cpp b/engines/wintermute/base/gfx/tinygl/shadow_volume_tinygl.cpp
index 134793ad8f0..22c62a0bf36 100644
--- a/engines/wintermute/base/gfx/tinygl/shadow_volume_tinygl.cpp
+++ b/engines/wintermute/base/gfx/tinygl/shadow_volume_tinygl.cpp
@@ -59,6 +59,9 @@ bool ShadowVolumeTinyGL::render() {
//////////////////////////////////////////////////////////////////////////
bool ShadowVolumeTinyGL::renderToStencilBuffer() {
+ if (!dynamic_cast<BaseRenderTinyGL *>(_game->_renderer3D)->stencilSupported()) {
+ return false;
+ }
// Disable z-buffer/color writes (note: z-testing still occurs), and enable the
// stencil-buffer
tglDepthMask(TGL_FALSE);
@@ -103,6 +106,9 @@ bool ShadowVolumeTinyGL::renderToStencilBuffer() {
//////////////////////////////////////////////////////////////////////////
bool ShadowVolumeTinyGL::renderToScene() {
+ if (!dynamic_cast<BaseRenderTinyGL *>(_game->_renderer3D)->stencilSupported()) {
+ return false;
+ }
initMask();
tglDisable(TGL_DEPTH_TEST);
More information about the Scummvm-git-logs
mailing list