[Scummvm-git-logs] scummvm master -> 9d18870375f7e7a3c650686995fac1e7affb7168
klusark
noreply at scummvm.org
Tue Nov 10 14:28:17 UTC 2026
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
fcd19def86 GRIM: Create meshes for binary models again
9d18870375 GRIM: Don't turn off shader lights into directional lights
Commit: fcd19def86190f497ab4f1262d232ce7b94e1504
https://github.com/scummvm/scummvm/commit/fcd19def86190f497ab4f1262d232ce7b94e1504
Author: Joel Teichroeb (joel at teichroeb.net)
Date: 2026-11-10T09:26:57-05:00
Commit Message:
GRIM: Create meshes for binary models again
Moving the bounding box calculation into Model::loadText also moved the
createMesh call, so binary models never got their buffers and the
OpenGL with shaders renderer drew no models. Create the meshes in the
constructor for both formats.
Assisted-by: Claude:claude-opus-5-5
Changed paths:
engines/grim/model.cpp
diff --git a/engines/grim/model.cpp b/engines/grim/model.cpp
index a9de7bcb1dc..a347b9442c0 100644
--- a/engines/grim/model.cpp
+++ b/engines/grim/model.cpp
@@ -47,6 +47,11 @@ Model::Model(const Common::String &filename, Common::SeekableReadStream *data, C
TextSplitter ts(_fname, data);
loadText(&ts);
}
+
+ for (int i = 0; i < _numHierNodes; ++i) {
+ if (_rootHierNode[i]._mesh)
+ g_driver->createMesh(_rootHierNode[i]._mesh);
+ }
}
Model::~Model() {
@@ -181,7 +186,6 @@ void Model::loadText(TextSplitter *ts) {
for (int i = 0; i < _numHierNodes; ++i) {
ModelNode &node = _rootHierNode[i];
if (node._mesh) {
- g_driver->createMesh(node._mesh);
Mesh &mesh = *node._mesh;
Math::Vector3d p = mesh._matrix.getPosition();
float x = p.x();
Commit: 9d18870375f7e7a3c650686995fac1e7affb7168
https://github.com/scummvm/scummvm/commit/9d18870375f7e7a3c650686995fac1e7affb7168
Author: Joel Teichroeb (joel at teichroeb.net)
Date: 2026-11-10T09:26:57-05:00
Commit Message:
GRIM: Don't turn off shader lights into directional lights
Unused light slots are now turned off on every setup. A zero position
made them directional lights with a zero vector, which the shaders
normalize into NaN. Mark them as ambient lights with no colour instead,
and clear the ambient flag when no light is enabled.
Assisted-by: Claude:claude-opus-5-5
Changed paths:
engines/grim/gfx_opengl_shaders.cpp
diff --git a/engines/grim/gfx_opengl_shaders.cpp b/engines/grim/gfx_opengl_shaders.cpp
index 75980b2d722..b4213699ec6 100644
--- a/engines/grim/gfx_opengl_shaders.cpp
+++ b/engines/grim/gfx_opengl_shaders.cpp
@@ -1256,9 +1256,16 @@ void GfxOpenGLS::turnOffLight(int lightId) {
return;
}
+ // Turning off light 0 means no light is enabled at all.
+ if (lightId == 0)
+ _hasAmbientLight = false;
+
+ // Mark the slot as an ambient light with no colour. A zero position
+ // would be a directional light, and the shaders would normalize a zero
+ // vector into NaN, which makes the whole model disappear.
_lights[lightId]._color = Math::Vector4d(0.0f, 0.0f, 0.0f, 0.0f);
- _lights[lightId]._position = Math::Vector4d(0.0f, 0.0f, 0.0f, 0.0f);
- _lights[lightId]._direction = Math::Vector4d(0.0f, 0.0f, 0.0f, 0.0f);
+ _lights[lightId]._position = Math::Vector4d(0.0f, 0.0f, 0.0f, -1.0f);
+ _lights[lightId]._direction = Math::Vector4d(0.0f, 0.0f, 0.0f, -1.0f);
}
More information about the Scummvm-git-logs
mailing list