[Scummvm-git-logs] scummvm master -> 675bea8c868cf69999ead03dbd2c27bae02bccf5
aquadran
noreply at scummvm.org
Sat Nov 22 06:54:20 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:
675bea8c86 EMI: Don't overwrite global actor alpha when drawing sprites
Commit: 675bea8c868cf69999ead03dbd2c27bae02bccf5
https://github.com/scummvm/scummvm/commit/675bea8c868cf69999ead03dbd2c27bae02bccf5
Author: Christian Krause (chkr at plauener.de)
Date: 2025-11-22T07:54:17+01:00
Commit Message:
EMI: Don't overwrite global actor alpha when drawing sprites
- currently, with the shader renderer, the bananas in the
monkey combat scene never vanish
- the reason is, that the actor's global alpha value is set
via uniformColor in startActorDraw() but is overwritten
in drawSprite()
- set the sprite's color (and alpha) values using a different
uniform variable and multiply them in the sprite's vertex
shader
Changed paths:
engines/grim/gfx_opengl_shaders.cpp
engines/grim/shaders/emi_sprite.vertex
diff --git a/engines/grim/gfx_opengl_shaders.cpp b/engines/grim/gfx_opengl_shaders.cpp
index 19169c6a3f2..f4feea6dd03 100644
--- a/engines/grim/gfx_opengl_shaders.cpp
+++ b/engines/grim/gfx_opengl_shaders.cpp
@@ -1172,7 +1172,13 @@ void GfxOpenGLS::drawSprite(const Sprite *sprite) {
// FIXME: Currently vertex-specific colors are not supported for sprites.
// It is unknown at this time if this is really needed anywhere.
Math::Vector4d color(sprite->_red[0] / 255.0f, sprite->_green[0] / 255.0f, sprite->_blue[0] / 255.0f, sprite->_alpha[0] / 255.0f);
- _spriteProgram->setUniform("uniformColor", color);
+ if (g_grim->getGameType() == GType_MONKEY4) {
+ // Don't overwrite the actor's alpha value which is set via uniformColor in startActorDraw()
+ _spriteProgram->setUniform("spriteColor", color);
+ } else {
+ // No need to set spriteColor for GRIM, it is specific to the EMI sprite shader program
+ _spriteProgram->setUniform("uniformColor", color);
+ }
float sprite_textured_quad[] = {
// X , Y , Z , S , T
diff --git a/engines/grim/shaders/emi_sprite.vertex b/engines/grim/shaders/emi_sprite.vertex
index 51f1bb86464..90855b73b74 100644
--- a/engines/grim/shaders/emi_sprite.vertex
+++ b/engines/grim/shaders/emi_sprite.vertex
@@ -12,6 +12,7 @@ uniform highp vec3 cameraPos;
uniform UBOOL textured;
uniform UBOOL useVertexAlpha;
uniform vec4 uniformColor;
+uniform vec4 spriteColor;
struct shadow_info {
UBOOL _active;
@@ -49,6 +50,7 @@ void main() {
if (!UBOOL_TEST(useVertexAlpha))
Color.a = 1.0;
Color *= uniformColor;
+ Color *= spriteColor;
if (UBOOL_TEST(textured)) {
Texcoord = texcoord;
} else {
More information about the Scummvm-git-logs
mailing list