GRIM: Perform alpha testing when rendering actors with the shaders renderer

Fixes transparency for the tie rope and Glottis' head
This commit is contained in:
Bastien Bouclet 2015-03-29 14:04:41 +02:00
parent 1908a43d18
commit d1b72c7975
2 changed files with 5 additions and 0 deletions

View File

@ -727,6 +727,7 @@ void GfxOpenGLS::startActorDraw(const Actor *actor) {
_actorProgram->setUniform("hasZBuffer", hasZBuffer);
_actorProgram->setUniform("texcropZBuf", _zBufTexCrop);
_actorProgram->setUniform("screenSize", Math::Vector2d(_screenWidth, _screenHeight));
_actorProgram->setUniform1f("alphaRef", 0.5f);
}
if (_currentShadowArray) {

View File

@ -7,6 +7,7 @@ uniform bool textured;
uniform bool hasZBuffer;
uniform vec2 texcropZBuf;
uniform vec2 screenSize;
uniform float alphaRef;
//#define SGSPLUS_FIX
#ifndef SGSPLUS_FIX
@ -40,4 +41,7 @@ void main()
if (textured) {
outColor *= texture(tex, Texcoord);
}
if (outColor.a < alphaRef)
discard;
}