Alphamasking migrated to shaders instead of using fixed-function. Very early code. Hasn't even made it into viewer-development yet.

This commit is contained in:
Shyotl
2011-08-12 19:20:11 -05:00
parent 8e1c70dcaa
commit f551294e66
34 changed files with 892 additions and 194 deletions

View File

@@ -1092,6 +1092,10 @@ void LLRender::setSceneBlendType(eBlendType type)
void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value)
{
flush();
if (LLGLSLShader::sNoFixedFunction)
{ //glAlphaFunc is deprecated in OpenGL 3.3
return;
}
if (mCurrAlphaFunc != func ||
mCurrAlphaFuncVal != value)
@@ -1107,6 +1111,30 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value)
glAlphaFunc(sGLCompareFunc[func], value);
}
}
if (gDebugGL)
{ //make sure cached state is correct
GLint cur_func = 0;
glGetIntegerv(GL_ALPHA_TEST_FUNC, &cur_func);
if (func == CF_DEFAULT)
{
func = CF_GREATER;
}
if (cur_func != sGLCompareFunc[func])
{
llerrs << "Alpha test function corrupted!" << llendl;
}
F32 ref = 0.f;
glGetFloatv(GL_ALPHA_TEST_REF, &ref);
if (ref != value)
{
llerrs << "Alpha test value corrupted!" << llendl;
}
}
}
void LLRender::blendFunc(eBlendFactor sfactor, eBlendFactor dfactor)