- replaced deprecated alpha testing with shader code.
This commit is contained in:
parent
84a49e37ee
commit
ed8a21fd86
19 changed files with 42 additions and 96 deletions
|
|
@ -75,8 +75,6 @@ void FRenderState::Reset()
|
|||
mSrcBlend = GL_SRC_ALPHA;
|
||||
mDstBlend = GL_ONE_MINUS_SRC_ALPHA;
|
||||
glSrcBlend = glDstBlend = -1;
|
||||
glAlphaFunc = -1;
|
||||
mAlphaFunc = GL_GEQUAL;
|
||||
mAlphaThreshold = 0.5f;
|
||||
mBlendEquation = GL_FUNC_ADD;
|
||||
mObjectColor = 0xffffffff;
|
||||
|
|
@ -151,6 +149,7 @@ bool FRenderState::ApplyShader()
|
|||
activeShader->muInterpolationFactor.Set(mInterpolationFactor);
|
||||
activeShader->muClipHeightTop.Set(mClipHeightTop);
|
||||
activeShader->muClipHeightBottom.Set(mClipHeightBottom);
|
||||
activeShader->muAlphaThreshold.Set(mAlphaThreshold);
|
||||
|
||||
if (mGlowEnabled)
|
||||
{
|
||||
|
|
@ -269,18 +268,6 @@ void FRenderState::Apply()
|
|||
glDstBlend = mDstBlend;
|
||||
glBlendFunc(mSrcBlend, mDstBlend);
|
||||
}
|
||||
if (mAlphaFunc != glAlphaFunc || mAlphaThreshold != glAlphaThreshold)
|
||||
{
|
||||
glAlphaFunc = mAlphaFunc;
|
||||
glAlphaThreshold = mAlphaThreshold;
|
||||
::glAlphaFunc(mAlphaFunc, mAlphaThreshold);
|
||||
}
|
||||
if (mAlphaTest != glAlphaTest)
|
||||
{
|
||||
glAlphaTest = mAlphaTest;
|
||||
if (mAlphaTest) glEnable(GL_ALPHA_TEST);
|
||||
else glDisable(GL_ALPHA_TEST);
|
||||
}
|
||||
if (mBlendEquation != glBlendEquation)
|
||||
{
|
||||
glBlendEquation = mBlendEquation;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue