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:
parent
1908a43d18
commit
d1b72c7975
2 changed files with 5 additions and 0 deletions
|
@ -727,6 +727,7 @@ void GfxOpenGLS::startActorDraw(const Actor *actor) {
|
||||||
_actorProgram->setUniform("hasZBuffer", hasZBuffer);
|
_actorProgram->setUniform("hasZBuffer", hasZBuffer);
|
||||||
_actorProgram->setUniform("texcropZBuf", _zBufTexCrop);
|
_actorProgram->setUniform("texcropZBuf", _zBufTexCrop);
|
||||||
_actorProgram->setUniform("screenSize", Math::Vector2d(_screenWidth, _screenHeight));
|
_actorProgram->setUniform("screenSize", Math::Vector2d(_screenWidth, _screenHeight));
|
||||||
|
_actorProgram->setUniform1f("alphaRef", 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_currentShadowArray) {
|
if (_currentShadowArray) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ uniform bool textured;
|
||||||
uniform bool hasZBuffer;
|
uniform bool hasZBuffer;
|
||||||
uniform vec2 texcropZBuf;
|
uniform vec2 texcropZBuf;
|
||||||
uniform vec2 screenSize;
|
uniform vec2 screenSize;
|
||||||
|
uniform float alphaRef;
|
||||||
|
|
||||||
//#define SGSPLUS_FIX
|
//#define SGSPLUS_FIX
|
||||||
#ifndef SGSPLUS_FIX
|
#ifndef SGSPLUS_FIX
|
||||||
|
@ -40,4 +41,7 @@ void main()
|
||||||
if (textured) {
|
if (textured) {
|
||||||
outColor *= texture(tex, Texcoord);
|
outColor *= texture(tex, Texcoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (outColor.a < alphaRef)
|
||||||
|
discard;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue