Skip to content

Commit

Permalink
GRIM, SHADERS: Toggle light inside drawMesh.
Browse files Browse the repository at this point in the history
Fixes appearance of roulettes in cn and beavers in dm (residualvm#1186).
  • Loading branch information
vpelletier committed Jul 9, 2016
1 parent 0d10131 commit 52d3bdb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions engines/grim/gfx_opengl_shaders.cpp
Expand Up @@ -975,6 +975,7 @@ void GfxOpenGLS::drawMesh(const Mesh *mesh) {

actorShader->use();
actorShader->setUniform("extraMatrix", _matrixStack.top());
actorShader->setUniform("lightsEnabled", _lightsEnabled);

const Material *curMaterial = NULL;
for (int i = 0; i < mesh->_numFaces;) {
Expand Down
2 changes: 2 additions & 0 deletions engines/grim/shaders/grim_actor.vertex
Expand Up @@ -93,5 +93,7 @@ void main()
light += lights[i]._color.xyz * intensity;
}
Color = clamp(vec4(color.xyz * light, color.w), 0.0, 1.0);
} else {
Color = color;
}
}

0 comments on commit 52d3bdb

Please sign in to comment.