Merge branch 'DRTVWR-546' of https://bitbucket.org/lindenlab/viewer
# Conflicts: # indra/llrender/llvertexbuffer.cpp # indra/newview/app_settings/settings.xml # indra/newview/llappviewer.cpp # indra/newview/llappviewer.h # indra/newview/llfloaterpreference.cpp # indra/newview/llnetmap.cpp # indra/newview/llspatialpartition.cpp # indra/newview/llviewerdisplay.cpp # indra/newview/llviewershadermgr.cpp # indra/newview/pipeline.cppmaster
commit
028941652b
|
|
@ -142,17 +142,8 @@ BOOL LLTexLayerSetBuffer::renderTexLayerSet(LLRenderTarget* bound_target)
|
|||
|
||||
BOOL success = TRUE;
|
||||
|
||||
bool use_shaders = LLGLSLShader::sNoFixedFunction;
|
||||
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.bind();
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
else
|
||||
{
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.00f);
|
||||
}
|
||||
gAlphaMaskProgram.bind();
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
|
||||
LLVertexBuffer::unbind();
|
||||
|
||||
|
|
@ -167,10 +158,7 @@ BOOL LLTexLayerSetBuffer::renderTexLayerSet(LLRenderTarget* bound_target)
|
|||
midRenderTexLayerSet(success, bound_target);
|
||||
// </FS:Ansariel> [Legacy Bake]
|
||||
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.unbind();
|
||||
}
|
||||
gAlphaMaskProgram.unbind();
|
||||
|
||||
LLVertexBuffer::unbind();
|
||||
|
||||
|
|
@ -397,8 +385,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget*
|
|||
}
|
||||
}
|
||||
|
||||
bool use_shaders = LLGLSLShader::sNoFixedFunction;
|
||||
|
||||
LLGLSUIDefault gls_ui;
|
||||
LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE);
|
||||
gGL.setColorMask(true, true);
|
||||
|
|
@ -407,20 +393,14 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget*
|
|||
{
|
||||
gGL.flush();
|
||||
LLGLDisable no_alpha(GL_ALPHA_TEST);
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.0f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.0f);
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
gGL.color4f( 0.f, 0.f, 0.f, 1.f );
|
||||
|
||||
gl_rect_2d_simple( width, height );
|
||||
|
||||
gGL.flush();
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
|
||||
if (mIsVisible)
|
||||
|
|
@ -447,10 +427,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget*
|
|||
|
||||
gGL.setSceneBlendType(LLRender::BT_REPLACE);
|
||||
LLGLDisable no_alpha(GL_ALPHA_TEST);
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
gGL.color4f( 0.f, 0.f, 0.f, 0.f );
|
||||
|
|
@ -459,10 +436,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget*
|
|||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
|
||||
gGL.flush();
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
|
||||
return success;
|
||||
|
|
@ -547,8 +521,6 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
|
|||
LL_PROFILE_ZONE_SCOPED;
|
||||
const LLTexLayerSetInfo *info = getInfo();
|
||||
|
||||
bool use_shaders = LLGLSLShader::sNoFixedFunction;
|
||||
|
||||
gGL.setColorMask(false, true);
|
||||
gGL.setSceneBlendType(LLRender::BT_REPLACE);
|
||||
|
||||
|
|
@ -562,7 +534,6 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
|
|||
{
|
||||
LLGLSUIDefault gls_ui;
|
||||
gGL.getTexUnit(0)->bind(tex);
|
||||
gGL.getTexUnit(0)->setTextureBlendType( LLTexUnit::TB_REPLACE );
|
||||
gl_rect_2d_simple_tex( width, height );
|
||||
}
|
||||
}
|
||||
|
|
@ -573,20 +544,14 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
|
|||
// Set the alpha channel to one (clean up after previous blending)
|
||||
gGL.flush();
|
||||
LLGLDisable no_alpha(GL_ALPHA_TEST);
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
gGL.color4f( 0.f, 0.f, 0.f, 1.f );
|
||||
|
||||
gl_rect_2d_simple( width, height );
|
||||
|
||||
gGL.flush();
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
|
||||
// (Optional) Mask out part of the baked texture with alpha masks
|
||||
|
|
@ -594,7 +559,6 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
|
|||
if (mMaskLayerList.size() > 0)
|
||||
{
|
||||
gGL.setSceneBlendType(LLRender::BT_MULT_ALPHA);
|
||||
gGL.getTexUnit(0)->setTextureBlendType( LLTexUnit::TB_REPLACE );
|
||||
for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++)
|
||||
{
|
||||
LLTexLayerInterface* layer = *iter;
|
||||
|
|
@ -607,7 +571,6 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
|
|||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
gGL.setColorMask(true, true);
|
||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
}
|
||||
|
|
@ -1133,13 +1096,6 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
|||
// *TODO: Is this correct?
|
||||
//gPipeline.disableLights();
|
||||
stop_glerror();
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glDisable(GL_LIGHTING);
|
||||
}
|
||||
stop_glerror();
|
||||
|
||||
bool use_shaders = LLGLSLShader::sNoFixedFunction;
|
||||
|
||||
LLColor4 net_color;
|
||||
BOOL color_specified = findNetColor(&net_color);
|
||||
|
|
@ -1226,10 +1182,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
|||
LLGLDisable alpha_test(no_alpha_test ? GL_ALPHA_TEST : 0);
|
||||
if (no_alpha_test)
|
||||
{
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
||||
}
|
||||
|
||||
LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode();
|
||||
|
|
@ -1243,10 +1196,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
|||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
if (no_alpha_test)
|
||||
{
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1280,18 +1230,12 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
|||
color_specified )
|
||||
{
|
||||
LLGLDisable no_alpha(GL_ALPHA_TEST);
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.000f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.000f);
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
gGL.color4fv( net_color.mV );
|
||||
gl_rect_2d_simple( width, height );
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
|
||||
if( alpha_mask_specified || getInfo()->mWriteAllChannels )
|
||||
|
|
@ -1379,25 +1323,17 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
|
|||
|
||||
gGL.flush();
|
||||
|
||||
bool use_shaders = LLGLSLShader::sNoFixedFunction;
|
||||
|
||||
if( !getInfo()->mStaticImageFileName.empty() )
|
||||
{
|
||||
LLGLTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture( getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask );
|
||||
if( tex )
|
||||
{
|
||||
LLGLSNoAlphaTest gls_no_alpha_test;
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
||||
gGL.getTexUnit(0)->bind(tex, TRUE);
|
||||
gl_rect_2d_simple_tex( width, height );
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1412,18 +1348,11 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
|
|||
if (tex)
|
||||
{
|
||||
LLGLSNoAlphaTest gls_no_alpha_test;
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
||||
gGL.getTexUnit(0)->bind(tex);
|
||||
gl_rect_2d_simple_tex( width, height );
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
success = TRUE;
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1448,13 +1377,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
|||
|
||||
llassert( !mParamAlphaList.empty() );
|
||||
|
||||
bool use_shaders = LLGLSLShader::sNoFixedFunction;
|
||||
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
||||
}
|
||||
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
||||
gGL.setColorMask(false, true);
|
||||
|
||||
LLTexLayerParamAlpha* first_param = *mParamAlphaList.begin();
|
||||
|
|
@ -1539,10 +1462,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
|||
gl_rect_2d_simple( width, height );
|
||||
}
|
||||
|
||||
if (use_shaders)
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
|
||||
LLGLSUIDefault gls_ui;
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ bool LLCubeMap::sUseCubeMaps = true;
|
|||
|
||||
LLCubeMap::LLCubeMap(bool init_as_srgb)
|
||||
: mTextureStage(0),
|
||||
mTextureCoordStage(0),
|
||||
mMatrixStage(0),
|
||||
mIssRGB(init_as_srgb)
|
||||
{
|
||||
|
|
@ -180,7 +179,6 @@ void LLCubeMap::bind()
|
|||
void LLCubeMap::enable(S32 stage)
|
||||
{
|
||||
enableTexture(stage);
|
||||
enableTextureCoords(stage);
|
||||
}
|
||||
|
||||
void LLCubeMap::enableTexture(S32 stage)
|
||||
|
|
@ -192,35 +190,9 @@ void LLCubeMap::enableTexture(S32 stage)
|
|||
}
|
||||
}
|
||||
|
||||
void LLCubeMap::enableTextureCoords(S32 stage)
|
||||
{
|
||||
mTextureCoordStage = stage;
|
||||
if (!LLGLSLShader::sNoFixedFunction && gGLManager.mHasCubeMap && stage >= 0 && LLCubeMap::sUseCubeMaps)
|
||||
{
|
||||
if (stage > 0)
|
||||
{
|
||||
gGL.getTexUnit(stage)->activate();
|
||||
}
|
||||
|
||||
glEnable(GL_TEXTURE_GEN_R);
|
||||
glEnable(GL_TEXTURE_GEN_S);
|
||||
glEnable(GL_TEXTURE_GEN_T);
|
||||
|
||||
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
|
||||
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
|
||||
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
|
||||
|
||||
if (stage > 0)
|
||||
{
|
||||
gGL.getTexUnit(0)->activate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLCubeMap::disable(void)
|
||||
{
|
||||
disableTexture();
|
||||
disableTextureCoords();
|
||||
}
|
||||
|
||||
void LLCubeMap::disableTexture(void)
|
||||
|
|
@ -235,24 +207,6 @@ void LLCubeMap::disableTexture(void)
|
|||
}
|
||||
}
|
||||
|
||||
void LLCubeMap::disableTextureCoords(void)
|
||||
{
|
||||
if (!LLGLSLShader::sNoFixedFunction && gGLManager.mHasCubeMap && mTextureCoordStage >= 0 && LLCubeMap::sUseCubeMaps)
|
||||
{
|
||||
if (mTextureCoordStage > 0)
|
||||
{
|
||||
gGL.getTexUnit(mTextureCoordStage)->activate();
|
||||
}
|
||||
glDisable(GL_TEXTURE_GEN_S);
|
||||
glDisable(GL_TEXTURE_GEN_T);
|
||||
glDisable(GL_TEXTURE_GEN_R);
|
||||
if (mTextureCoordStage > 0)
|
||||
{
|
||||
gGL.getTexUnit(0)->activate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLCubeMap::setMatrix(S32 stage)
|
||||
{
|
||||
mMatrixStage = stage;
|
||||
|
|
|
|||
|
|
@ -48,12 +48,10 @@ public:
|
|||
void enable(S32 stage);
|
||||
|
||||
void enableTexture(S32 stage);
|
||||
void enableTextureCoords(S32 stage);
|
||||
S32 getStage(void) { return mTextureStage; }
|
||||
|
||||
void disable(void);
|
||||
void disableTexture(void);
|
||||
void disableTextureCoords(void);
|
||||
void setMatrix(S32 stage);
|
||||
void restoreMatrix();
|
||||
void setReflection (void);
|
||||
|
|
@ -80,7 +78,6 @@ protected:
|
|||
LLPointer<LLImageGL> mImages[6];
|
||||
LLPointer<LLImageRaw> mRawImages[6];
|
||||
S32 mTextureStage;
|
||||
S32 mTextureCoordStage;
|
||||
S32 mMatrixStage;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1941,207 +1941,30 @@ void LLGLState::checkTextureChannels(const std::string& msg)
|
|||
#endif
|
||||
}
|
||||
|
||||
void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask)
|
||||
{
|
||||
if (!gDebugGL || LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
stop_glerror();
|
||||
BOOL error = FALSE;
|
||||
|
||||
GLint active_texture;
|
||||
glGetIntegerv(GL_CLIENT_ACTIVE_TEXTURE_ARB, &active_texture);
|
||||
|
||||
if (active_texture != GL_TEXTURE0_ARB)
|
||||
{
|
||||
LL_WARNS() << "Client active texture corrupted: " << active_texture << LL_ENDL;
|
||||
if (gDebugSession)
|
||||
{
|
||||
gFailLog << "Client active texture corrupted: " << active_texture << std::endl;
|
||||
}
|
||||
error = TRUE;
|
||||
}
|
||||
|
||||
/*glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &active_texture);
|
||||
if (active_texture != GL_TEXTURE0_ARB)
|
||||
{
|
||||
LL_WARNS() << "Active texture corrupted: " << active_texture << LL_ENDL;
|
||||
if (gDebugSession)
|
||||
{
|
||||
gFailLog << "Active texture corrupted: " << active_texture << std::endl;
|
||||
}
|
||||
error = TRUE;
|
||||
}*/
|
||||
|
||||
static const char* label[] =
|
||||
{
|
||||
"GL_VERTEX_ARRAY",
|
||||
"GL_NORMAL_ARRAY",
|
||||
"GL_COLOR_ARRAY",
|
||||
"GL_TEXTURE_COORD_ARRAY"
|
||||
};
|
||||
|
||||
static GLint value[] =
|
||||
{
|
||||
GL_VERTEX_ARRAY,
|
||||
GL_NORMAL_ARRAY,
|
||||
GL_COLOR_ARRAY,
|
||||
GL_TEXTURE_COORD_ARRAY
|
||||
};
|
||||
|
||||
static const U32 mask[] =
|
||||
{ //copied from llvertexbuffer.h
|
||||
0x0001, //MAP_VERTEX,
|
||||
0x0002, //MAP_NORMAL,
|
||||
0x0010, //MAP_COLOR,
|
||||
0x0004, //MAP_TEXCOORD
|
||||
};
|
||||
|
||||
|
||||
for (S32 j = 1; j < 4; j++)
|
||||
{
|
||||
if (glIsEnabled(value[j]))
|
||||
{
|
||||
if (!(mask[j] & data_mask))
|
||||
{
|
||||
error = TRUE;
|
||||
LL_WARNS("RenderState") << "GL still has " << label[j] << " enabled." << LL_ENDL;
|
||||
if (gDebugSession)
|
||||
{
|
||||
gFailLog << "GL still has " << label[j] << " enabled." << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mask[j] & data_mask)
|
||||
{
|
||||
error = TRUE;
|
||||
LL_WARNS("RenderState") << "GL does not have " << label[j] << " enabled." << LL_ENDL;
|
||||
if (gDebugSession)
|
||||
{
|
||||
gFailLog << "GL does not have " << label[j] << " enabled." << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
gGL.getTexUnit(1)->activate();
|
||||
if (glIsEnabled(GL_TEXTURE_COORD_ARRAY))
|
||||
{
|
||||
if (!(data_mask & 0x0008))
|
||||
{
|
||||
error = TRUE;
|
||||
LL_WARNS("RenderState") << "GL still has GL_TEXTURE_COORD_ARRAY enabled on channel 1." << LL_ENDL;
|
||||
if (gDebugSession)
|
||||
{
|
||||
gFailLog << "GL still has GL_TEXTURE_COORD_ARRAY enabled on channel 1." << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data_mask & 0x0008)
|
||||
{
|
||||
error = TRUE;
|
||||
LL_WARNS("RenderState") << "GL does not have GL_TEXTURE_COORD_ARRAY enabled on channel 1." << LL_ENDL;
|
||||
if (gDebugSession)
|
||||
{
|
||||
gFailLog << "GL does not have GL_TEXTURE_COORD_ARRAY enabled on channel 1." << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*if (glIsEnabled(GL_TEXTURE_2D))
|
||||
{
|
||||
if (!(data_mask & 0x0008))
|
||||
{
|
||||
error = TRUE;
|
||||
LL_WARNS("RenderState") << "GL still has GL_TEXTURE_2D enabled on channel 1." << LL_ENDL;
|
||||
if (gDebugSession)
|
||||
{
|
||||
gFailLog << "GL still has GL_TEXTURE_2D enabled on channel 1." << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data_mask & 0x0008)
|
||||
{
|
||||
error = TRUE;
|
||||
LL_WARNS("RenderState") << "GL does not have GL_TEXTURE_2D enabled on channel 1." << LL_ENDL;
|
||||
if (gDebugSession)
|
||||
{
|
||||
gFailLog << "GL does not have GL_TEXTURE_2D enabled on channel 1." << std::endl;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
gGL.getTexUnit(0)->activate();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{ //make sure vertex attribs are all disabled
|
||||
GLint count;
|
||||
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS_ARB, &count);
|
||||
for (GLint i = 0; i < count; i++)
|
||||
{
|
||||
GLint enabled;
|
||||
glGetVertexAttribivARB((GLuint) i, GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB, &enabled);
|
||||
if (enabled)
|
||||
{
|
||||
error = TRUE;
|
||||
LL_WARNS("RenderState") << "GL still has vertex attrib array " << i << " enabled." << LL_ENDL;
|
||||
if (gDebugSession)
|
||||
{
|
||||
gFailLog << "GL still has vertex attrib array " << i << " enabled." << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (error)
|
||||
{
|
||||
if (gDebugSession)
|
||||
{
|
||||
ll_fail("LLGLState::checkClientArrays failed.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_GL_ERRS << "GL client array corruption detected. " << msg << LL_ENDL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
LLGLState::LLGLState(LLGLenum state, S32 enabled) :
|
||||
mState(state), mWasEnabled(FALSE), mIsEnabled(FALSE)
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{ //always ignore state that's deprecated post GL 3.0
|
||||
switch (state)
|
||||
{
|
||||
case GL_ALPHA_TEST:
|
||||
case GL_NORMALIZE:
|
||||
case GL_TEXTURE_GEN_R:
|
||||
case GL_TEXTURE_GEN_S:
|
||||
case GL_TEXTURE_GEN_T:
|
||||
case GL_TEXTURE_GEN_Q:
|
||||
case GL_LIGHTING:
|
||||
case GL_COLOR_MATERIAL:
|
||||
case GL_FOG:
|
||||
case GL_LINE_STIPPLE:
|
||||
case GL_POLYGON_STIPPLE:
|
||||
mState = 0;
|
||||
break;
|
||||
}
|
||||
switch (state)
|
||||
{
|
||||
case GL_ALPHA_TEST:
|
||||
case GL_NORMALIZE:
|
||||
case GL_TEXTURE_GEN_R:
|
||||
case GL_TEXTURE_GEN_S:
|
||||
case GL_TEXTURE_GEN_T:
|
||||
case GL_TEXTURE_GEN_Q:
|
||||
case GL_LIGHTING:
|
||||
case GL_COLOR_MATERIAL:
|
||||
case GL_FOG:
|
||||
case GL_LINE_STIPPLE:
|
||||
case GL_POLYGON_STIPPLE:
|
||||
mState = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
stop_glerror();
|
||||
if (mState)
|
||||
{
|
||||
|
|
@ -2693,22 +2516,10 @@ LLGLSPipelineSkyBox::LLGLSPipelineSkyBox()
|
|||
, mCullFace(GL_CULL_FACE)
|
||||
, mSquashClip()
|
||||
{
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_FOG);
|
||||
glDisable(GL_CLIP_PLANE0);
|
||||
}
|
||||
}
|
||||
|
||||
LLGLSPipelineSkyBox::~LLGLSPipelineSkyBox()
|
||||
{
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_FOG);
|
||||
glEnable(GL_CLIP_PLANE0);
|
||||
}
|
||||
}
|
||||
|
||||
LLGLSPipelineDepthTestSkyBox::LLGLSPipelineDepthTestSkyBox(bool depth_test, bool depth_write)
|
||||
|
|
|
|||
|
|
@ -276,7 +276,6 @@ public:
|
|||
static void dumpStates();
|
||||
static void checkStates(const std::string& msg = "");
|
||||
static void checkTextureChannels(const std::string& msg = "");
|
||||
static void checkClientArrays(const std::string& msg = "", U32 data_mask = 0);
|
||||
|
||||
protected:
|
||||
static boost::unordered_map<LLGLenum, LLGLboolean> sStateMap;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ using std::string;
|
|||
GLhandleARB LLGLSLShader::sCurBoundShader = 0;
|
||||
LLGLSLShader* LLGLSLShader::sCurBoundShaderPtr = NULL;
|
||||
S32 LLGLSLShader::sIndexedTextureChannels = 0;
|
||||
bool LLGLSLShader::sNoFixedFunction = false;
|
||||
bool LLGLSLShader::sProfileEnabled = false;
|
||||
std::set<LLGLSLShader*> LLGLSLShader::sInstances;
|
||||
U64 LLGLSLShader::sTotalTimeElapsed = 0;
|
||||
|
|
|
|||
|
|
@ -148,7 +148,6 @@ public:
|
|||
static GLhandleARB sCurBoundShader;
|
||||
static LLGLSLShader* sCurBoundShaderPtr;
|
||||
static S32 sIndexedTextureChannels;
|
||||
static bool sNoFixedFunction;
|
||||
|
||||
static void initProfile();
|
||||
static void finishProfile(bool emit_report = true);
|
||||
|
|
|
|||
|
|
@ -131,42 +131,15 @@ void LLTexUnit::refreshState(void)
|
|||
|
||||
glActiveTextureARB(GL_TEXTURE0_ARB + mIndex);
|
||||
|
||||
//
|
||||
// Per apple spec, don't call glEnable/glDisable when index exceeds max texture units
|
||||
// http://www.mailinglistarchive.com/html/mac-opengl@lists.apple.com/2008-07/msg00653.html
|
||||
//
|
||||
bool enableDisable = !LLGLSLShader::sNoFixedFunction &&
|
||||
(mIndex < gGLManager.mNumTextureUnits) && mCurrTexType != LLTexUnit::TT_MULTISAMPLE_TEXTURE;
|
||||
|
||||
if (mCurrTexType != TT_NONE)
|
||||
{
|
||||
if (enableDisable)
|
||||
{
|
||||
glEnable(sGLTextureType[mCurrTexType]);
|
||||
}
|
||||
|
||||
glBindTexture(sGLTextureType[mCurrTexType], mCurrTexture);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (enableDisable)
|
||||
{
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
||||
if (mCurrBlendType != TB_COMBINE)
|
||||
{
|
||||
setTextureBlendType(mCurrBlendType);
|
||||
}
|
||||
else
|
||||
{
|
||||
setTextureCombiner(mCurrColorOp, mCurrColorSrc1, mCurrColorSrc2, false);
|
||||
setTextureCombiner(mCurrAlphaOp, mCurrAlphaSrc1, mCurrAlphaSrc2, true);
|
||||
}
|
||||
|
||||
setTextureColorSpace(mTexColorSpace);
|
||||
}
|
||||
|
||||
|
|
@ -199,14 +172,6 @@ void LLTexUnit::enable(eTextureType type)
|
|||
mCurrTexType = type;
|
||||
|
||||
gGL.flush();
|
||||
if (!LLGLSLShader::sNoFixedFunction &&
|
||||
type != LLTexUnit::TT_MULTISAMPLE_TEXTURE &&
|
||||
mIndex < gGLManager.mNumTextureUnits)
|
||||
{
|
||||
stop_glerror();
|
||||
glEnable(sGLTextureType[type]);
|
||||
stop_glerror();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -219,13 +184,6 @@ void LLTexUnit::disable(void)
|
|||
activate();
|
||||
unbind(mCurrTexType);
|
||||
gGL.flush();
|
||||
if (!LLGLSLShader::sNoFixedFunction &&
|
||||
mCurrTexType != LLTexUnit::TT_MULTISAMPLE_TEXTURE &&
|
||||
mIndex < gGLManager.mNumTextureUnits)
|
||||
{
|
||||
glDisable(sGLTextureType[mCurrTexType]);
|
||||
}
|
||||
|
||||
setTextureColorSpace(TCS_LINEAR);
|
||||
|
||||
mCurrTexType = TT_NONE;
|
||||
|
|
@ -468,7 +426,7 @@ void LLTexUnit::unbind(eTextureType type)
|
|||
|
||||
// Always make sure our texture color space is reset to linear. SRGB sampling should be opt-in in the vast majority of cases. Also prevents color space "popping".
|
||||
mTexColorSpace = TCS_LINEAR;
|
||||
if (LLGLSLShader::sNoFixedFunction && type == LLTexUnit::TT_TEXTURE)
|
||||
if (type == LLTexUnit::TT_TEXTURE)
|
||||
{
|
||||
glBindTexture(sGLTextureType[type], sWhiteTexture);
|
||||
}
|
||||
|
|
@ -580,55 +538,6 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio
|
|||
}
|
||||
}
|
||||
|
||||
void LLTexUnit::setTextureBlendType(eTextureBlendType type)
|
||||
{
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{ //texture blend type means nothing when using shaders
|
||||
return;
|
||||
}
|
||||
|
||||
if (mIndex < 0) return;
|
||||
|
||||
// Do nothing if it's already correctly set.
|
||||
if (mCurrBlendType == type && !gGL.mDirty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
gGL.flush();
|
||||
|
||||
activate();
|
||||
mCurrBlendType = type;
|
||||
S32 scale_amount = 1;
|
||||
switch (type)
|
||||
{
|
||||
case TB_REPLACE:
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
break;
|
||||
case TB_ADD:
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD);
|
||||
break;
|
||||
case TB_MULT:
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
break;
|
||||
case TB_MULT_X2:
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
scale_amount = 2;
|
||||
break;
|
||||
case TB_ALPHA_BLEND:
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
|
||||
break;
|
||||
case TB_COMBINE:
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
|
||||
break;
|
||||
default:
|
||||
LL_ERRS() << "Unknown Texture Blend Type: " << type << LL_ENDL;
|
||||
break;
|
||||
}
|
||||
setColorScale(scale_amount);
|
||||
setAlphaScale(1);
|
||||
}
|
||||
|
||||
GLint LLTexUnit::getTextureSource(eTextureBlendSrc src)
|
||||
{
|
||||
switch(src)
|
||||
|
|
@ -705,159 +614,6 @@ GLint LLTexUnit::getTextureSourceType(eTextureBlendSrc src, bool isAlpha)
|
|||
}
|
||||
}
|
||||
|
||||
void LLTexUnit::setTextureCombiner(eTextureBlendOp op, eTextureBlendSrc src1, eTextureBlendSrc src2, bool isAlpha)
|
||||
{
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{ //register combiners do nothing when not using fixed function
|
||||
return;
|
||||
}
|
||||
|
||||
if (mIndex < 0) return;
|
||||
|
||||
activate();
|
||||
if (mCurrBlendType != TB_COMBINE || gGL.mDirty)
|
||||
{
|
||||
mCurrBlendType = TB_COMBINE;
|
||||
gGL.flush();
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
|
||||
}
|
||||
|
||||
// We want an early out, because this function does a LOT of stuff.
|
||||
if ( ( (isAlpha && (mCurrAlphaOp == op) && (mCurrAlphaSrc1 == src1) && (mCurrAlphaSrc2 == src2))
|
||||
|| (!isAlpha && (mCurrColorOp == op) && (mCurrColorSrc1 == src1) && (mCurrColorSrc2 == src2)) ) && !gGL.mDirty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
gGL.flush();
|
||||
|
||||
// Get the gl source enums according to the eTextureBlendSrc sources passed in
|
||||
GLint source1 = getTextureSource(src1);
|
||||
GLint source2 = getTextureSource(src2);
|
||||
// Get the gl operand enums according to the eTextureBlendSrc sources passed in
|
||||
GLint operand1 = getTextureSourceType(src1, isAlpha);
|
||||
GLint operand2 = getTextureSourceType(src2, isAlpha);
|
||||
// Default the scale amount to 1
|
||||
S32 scale_amount = 1;
|
||||
GLenum comb_enum, src0_enum, src1_enum, src2_enum, operand0_enum, operand1_enum, operand2_enum;
|
||||
|
||||
if (isAlpha)
|
||||
{
|
||||
// Set enums to ALPHA ones
|
||||
comb_enum = GL_COMBINE_ALPHA_ARB;
|
||||
src0_enum = GL_SOURCE0_ALPHA_ARB;
|
||||
src1_enum = GL_SOURCE1_ALPHA_ARB;
|
||||
src2_enum = GL_SOURCE2_ALPHA_ARB;
|
||||
operand0_enum = GL_OPERAND0_ALPHA_ARB;
|
||||
operand1_enum = GL_OPERAND1_ALPHA_ARB;
|
||||
operand2_enum = GL_OPERAND2_ALPHA_ARB;
|
||||
|
||||
// cache current combiner
|
||||
mCurrAlphaOp = op;
|
||||
mCurrAlphaSrc1 = src1;
|
||||
mCurrAlphaSrc2 = src2;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set enums to RGB ones
|
||||
comb_enum = GL_COMBINE_RGB_ARB;
|
||||
src0_enum = GL_SOURCE0_RGB_ARB;
|
||||
src1_enum = GL_SOURCE1_RGB_ARB;
|
||||
src2_enum = GL_SOURCE2_RGB_ARB;
|
||||
operand0_enum = GL_OPERAND0_RGB_ARB;
|
||||
operand1_enum = GL_OPERAND1_RGB_ARB;
|
||||
operand2_enum = GL_OPERAND2_RGB_ARB;
|
||||
|
||||
// cache current combiner
|
||||
mCurrColorOp = op;
|
||||
mCurrColorSrc1 = src1;
|
||||
mCurrColorSrc2 = src2;
|
||||
}
|
||||
|
||||
switch(op)
|
||||
{
|
||||
case TBO_REPLACE:
|
||||
// Slightly special syntax (no second sources), just set all and return.
|
||||
glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_REPLACE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, src0_enum, source1);
|
||||
glTexEnvi(GL_TEXTURE_ENV, operand0_enum, operand1);
|
||||
(isAlpha) ? setAlphaScale(1) : setColorScale(1);
|
||||
return;
|
||||
|
||||
case TBO_MULT:
|
||||
glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_MODULATE);
|
||||
break;
|
||||
|
||||
case TBO_MULT_X2:
|
||||
glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_MODULATE);
|
||||
scale_amount = 2;
|
||||
break;
|
||||
|
||||
case TBO_MULT_X4:
|
||||
glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_MODULATE);
|
||||
scale_amount = 4;
|
||||
break;
|
||||
|
||||
case TBO_ADD:
|
||||
glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_ADD);
|
||||
break;
|
||||
|
||||
case TBO_ADD_SIGNED:
|
||||
glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_ADD_SIGNED_ARB);
|
||||
break;
|
||||
|
||||
case TBO_SUBTRACT:
|
||||
glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_SUBTRACT_ARB);
|
||||
break;
|
||||
|
||||
case TBO_LERP_VERT_ALPHA:
|
||||
glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_INTERPOLATE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, src2_enum, GL_PRIMARY_COLOR_ARB);
|
||||
glTexEnvi(GL_TEXTURE_ENV, operand2_enum, GL_SRC_ALPHA);
|
||||
break;
|
||||
|
||||
case TBO_LERP_TEX_ALPHA:
|
||||
glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_INTERPOLATE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, src2_enum, GL_TEXTURE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, operand2_enum, GL_SRC_ALPHA);
|
||||
break;
|
||||
|
||||
case TBO_LERP_PREV_ALPHA:
|
||||
glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_INTERPOLATE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, src2_enum, GL_PREVIOUS_ARB);
|
||||
glTexEnvi(GL_TEXTURE_ENV, operand2_enum, GL_SRC_ALPHA);
|
||||
break;
|
||||
|
||||
case TBO_LERP_CONST_ALPHA:
|
||||
glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_INTERPOLATE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, src2_enum, GL_CONSTANT_ARB);
|
||||
glTexEnvi(GL_TEXTURE_ENV, operand2_enum, GL_SRC_ALPHA);
|
||||
break;
|
||||
|
||||
case TBO_LERP_VERT_COLOR:
|
||||
glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_INTERPOLATE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, src2_enum, GL_PRIMARY_COLOR_ARB);
|
||||
glTexEnvi(GL_TEXTURE_ENV, operand2_enum, (isAlpha) ? GL_SRC_ALPHA : GL_SRC_COLOR);
|
||||
break;
|
||||
|
||||
default:
|
||||
LL_WARNS() << "Unknown eTextureBlendOp: " << op << ". Setting op to replace." << LL_ENDL;
|
||||
// Slightly special syntax (no second sources), just set all and return.
|
||||
glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_REPLACE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, src0_enum, source1);
|
||||
glTexEnvi(GL_TEXTURE_ENV, operand0_enum, operand1);
|
||||
(isAlpha) ? setAlphaScale(1) : setColorScale(1);
|
||||
return;
|
||||
}
|
||||
|
||||
// Set sources, operands, and scale accordingly
|
||||
glTexEnvi(GL_TEXTURE_ENV, src0_enum, source1);
|
||||
glTexEnvi(GL_TEXTURE_ENV, operand0_enum, operand1);
|
||||
glTexEnvi(GL_TEXTURE_ENV, src1_enum, source2);
|
||||
glTexEnvi(GL_TEXTURE_ENV, operand1_enum, operand2);
|
||||
(isAlpha) ? setAlphaScale(scale_amount) : setColorScale(scale_amount);
|
||||
}
|
||||
|
||||
void LLTexUnit::setColorScale(S32 scale)
|
||||
{
|
||||
if (mCurrColorScale != scale || gGL.mDirty)
|
||||
|
|
@ -946,26 +702,12 @@ LLLightState::LLLightState(S32 index)
|
|||
|
||||
void LLLightState::enable()
|
||||
{
|
||||
if (!mEnabled)
|
||||
{
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glEnable(GL_LIGHT0+mIndex);
|
||||
}
|
||||
mEnabled = true;
|
||||
}
|
||||
mEnabled = true;
|
||||
}
|
||||
|
||||
void LLLightState::disable()
|
||||
{
|
||||
if (mEnabled)
|
||||
{
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glDisable(GL_LIGHT0+mIndex);
|
||||
}
|
||||
mEnabled = false;
|
||||
}
|
||||
mEnabled = false;
|
||||
}
|
||||
|
||||
void LLLightState::setDiffuse(const LLColor4& diffuse)
|
||||
|
|
@ -974,10 +716,6 @@ void LLLightState::setDiffuse(const LLColor4& diffuse)
|
|||
{
|
||||
++gGL.mLightHash;
|
||||
mDiffuse = diffuse;
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glLightfv(GL_LIGHT0+mIndex, GL_DIFFUSE, mDiffuse.mV);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1005,10 +743,6 @@ void LLLightState::setAmbient(const LLColor4& ambient)
|
|||
{
|
||||
++gGL.mLightHash;
|
||||
mAmbient = ambient;
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glLightfv(GL_LIGHT0+mIndex, GL_AMBIENT, mAmbient.mV);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1018,10 +752,6 @@ void LLLightState::setSpecular(const LLColor4& specular)
|
|||
{
|
||||
++gGL.mLightHash;
|
||||
mSpecular = specular;
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glLightfv(GL_LIGHT0+mIndex, GL_SPECULAR, mSpecular.mV);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1030,20 +760,11 @@ void LLLightState::setPosition(const LLVector4& position)
|
|||
//always set position because modelview matrix may have changed
|
||||
++gGL.mLightHash;
|
||||
mPosition = position;
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glLightfv(GL_LIGHT0+mIndex, GL_POSITION, mPosition.mV);
|
||||
}
|
||||
else
|
||||
{ //transform position by current modelview matrix
|
||||
glh::vec4f pos(position.mV);
|
||||
|
||||
const glh::matrix4f& mat = gGL.getModelviewMatrix();
|
||||
mat.mult_matrix_vec(pos);
|
||||
|
||||
mPosition.set(pos.v);
|
||||
}
|
||||
|
||||
//transform position by current modelview matrix
|
||||
glh::vec4f pos(position.mV);
|
||||
const glh::matrix4f& mat = gGL.getModelviewMatrix();
|
||||
mat.mult_matrix_vec(pos);
|
||||
mPosition.set(pos.v);
|
||||
}
|
||||
|
||||
void LLLightState::setConstantAttenuation(const F32& atten)
|
||||
|
|
@ -1052,10 +773,6 @@ void LLLightState::setConstantAttenuation(const F32& atten)
|
|||
{
|
||||
mConstantAtten = atten;
|
||||
++gGL.mLightHash;
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glLightf(GL_LIGHT0+mIndex, GL_CONSTANT_ATTENUATION, atten);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1065,10 +782,6 @@ void LLLightState::setLinearAttenuation(const F32& atten)
|
|||
{
|
||||
++gGL.mLightHash;
|
||||
mLinearAtten = atten;
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glLightf(GL_LIGHT0+mIndex, GL_LINEAR_ATTENUATION, atten);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1078,10 +791,6 @@ void LLLightState::setQuadraticAttenuation(const F32& atten)
|
|||
{
|
||||
++gGL.mLightHash;
|
||||
mQuadraticAtten = atten;
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glLightf(GL_LIGHT0+mIndex, GL_QUADRATIC_ATTENUATION, atten);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1091,10 +800,6 @@ void LLLightState::setSpotExponent(const F32& exponent)
|
|||
{
|
||||
++gGL.mLightHash;
|
||||
mSpotExponent = exponent;
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glLightf(GL_LIGHT0+mIndex, GL_SPOT_EXPONENT, exponent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1104,10 +809,6 @@ void LLLightState::setSpotCutoff(const F32& cutoff)
|
|||
{
|
||||
++gGL.mLightHash;
|
||||
mSpotCutoff = cutoff;
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glLightf(GL_LIGHT0+mIndex, GL_SPOT_CUTOFF, cutoff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1116,19 +817,12 @@ void LLLightState::setSpotDirection(const LLVector3& direction)
|
|||
//always set direction because modelview matrix may have changed
|
||||
++gGL.mLightHash;
|
||||
mSpotDirection = direction;
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glLightfv(GL_LIGHT0+mIndex, GL_SPOT_DIRECTION, direction.mV);
|
||||
}
|
||||
else
|
||||
{ //transform direction by current modelview matrix
|
||||
glh::vec3f dir(direction.mV);
|
||||
//transform direction by current modelview matrix
|
||||
glh::vec3f dir(direction.mV);
|
||||
const glh::matrix4f& mat = gGL.getModelviewMatrix();
|
||||
mat.mult_matrix_dir(dir);
|
||||
|
||||
const glh::matrix4f& mat = gGL.getModelviewMatrix();
|
||||
mat.mult_matrix_dir(dir);
|
||||
|
||||
mSpotDirection.set(dir.v);
|
||||
}
|
||||
mSpotDirection.set(dir.v);
|
||||
}
|
||||
|
||||
LLRender::LLRender()
|
||||
|
|
@ -1277,7 +971,7 @@ void LLRender::refreshState(void)
|
|||
|
||||
setColorMask(mCurrColorMask[0], mCurrColorMask[1], mCurrColorMask[2], mCurrColorMask[3]);
|
||||
|
||||
setAlphaRejectSettings(mCurrAlphaFunc, mCurrAlphaFuncVal);
|
||||
flush();
|
||||
|
||||
mDirty = false;
|
||||
}
|
||||
|
|
@ -1465,39 +1159,6 @@ void LLRender::syncMatrices()
|
|||
syncLightState();
|
||||
}
|
||||
}
|
||||
else if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
static const GLenum mode[] =
|
||||
{
|
||||
GL_MODELVIEW,
|
||||
GL_PROJECTION,
|
||||
GL_TEXTURE,
|
||||
GL_TEXTURE,
|
||||
GL_TEXTURE,
|
||||
GL_TEXTURE,
|
||||
};
|
||||
|
||||
for (U32 i = 0; i < MM_TEXTURE0; ++i)
|
||||
{
|
||||
if (mMatHash[i] != mCurMatHash[i])
|
||||
{
|
||||
glMatrixMode(mode[i]);
|
||||
glLoadMatrixf(mMatrix[i][mMatIdx[i]].m);
|
||||
mCurMatHash[i] = mMatHash[i];
|
||||
}
|
||||
}
|
||||
|
||||
for (U32 i = MM_TEXTURE0; i < NUM_MATRIX_MODES; ++i)
|
||||
{
|
||||
if (mMatHash[i] != mCurMatHash[i])
|
||||
{
|
||||
gGL.getTexUnit(i-MM_TEXTURE0)->activate();
|
||||
glMatrixMode(mode[i]);
|
||||
glLoadMatrixf(mMatrix[i][mMatIdx[i]].m);
|
||||
mCurMatHash[i] = mMatHash[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLRender::translatef(const GLfloat& x, const GLfloat& y, const GLfloat& z)
|
||||
|
|
@ -1813,55 +1474,6 @@ 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)
|
||||
{
|
||||
mCurrAlphaFunc = func;
|
||||
mCurrAlphaFuncVal = value;
|
||||
if (func == CF_DEFAULT)
|
||||
{
|
||||
glAlphaFunc(GL_GREATER, 0.01f);
|
||||
}
|
||||
else
|
||||
{
|
||||
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])
|
||||
{
|
||||
LL_ERRS() << "Alpha test function corrupted!" << LL_ENDL;
|
||||
}
|
||||
|
||||
F32 ref = 0.f;
|
||||
glGetFloatv(GL_ALPHA_TEST_REF, &ref);
|
||||
|
||||
if (ref != value)
|
||||
{
|
||||
LL_ERRS() << "Alpha test value corrupted!" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLRender::blendFunc(eBlendFactor sfactor, eBlendFactor dfactor)
|
||||
{
|
||||
llassert(sfactor < BF_UNDEF);
|
||||
|
|
@ -1934,10 +1546,6 @@ void LLRender::setAmbientLightColor(const LLColor4& color)
|
|||
{
|
||||
++mLightHash;
|
||||
mAmbientLightColor = color;
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, color.mV);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2428,7 +2036,7 @@ void LLRender::color3fv(const GLfloat* c)
|
|||
void LLRender::diffuseColor3f(F32 r, F32 g, F32 b)
|
||||
{
|
||||
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
|
||||
llassert(shader != NULL);
|
||||
|
||||
if (shader)
|
||||
{
|
||||
|
|
@ -2443,7 +2051,7 @@ void LLRender::diffuseColor3f(F32 r, F32 g, F32 b)
|
|||
void LLRender::diffuseColor3fv(const F32* c)
|
||||
{
|
||||
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
|
||||
llassert(shader != NULL);
|
||||
|
||||
if (shader)
|
||||
{
|
||||
|
|
@ -2458,7 +2066,7 @@ void LLRender::diffuseColor3fv(const F32* c)
|
|||
void LLRender::diffuseColor4f(F32 r, F32 g, F32 b, F32 a)
|
||||
{
|
||||
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
|
||||
llassert(shader != NULL);
|
||||
|
||||
if (shader)
|
||||
{
|
||||
|
|
@ -2473,7 +2081,7 @@ void LLRender::diffuseColor4f(F32 r, F32 g, F32 b, F32 a)
|
|||
void LLRender::diffuseColor4fv(const F32* c)
|
||||
{
|
||||
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
|
||||
llassert(shader != NULL);
|
||||
|
||||
if (shader)
|
||||
{
|
||||
|
|
@ -2488,7 +2096,7 @@ void LLRender::diffuseColor4fv(const F32* c)
|
|||
void LLRender::diffuseColor4ubv(const U8* c)
|
||||
{
|
||||
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
|
||||
llassert(shader != NULL);
|
||||
|
||||
if (shader)
|
||||
{
|
||||
|
|
@ -2503,7 +2111,7 @@ void LLRender::diffuseColor4ubv(const U8* c)
|
|||
void LLRender::diffuseColor4ub(U8 r, U8 g, U8 b, U8 a)
|
||||
{
|
||||
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL);
|
||||
llassert(shader != NULL);
|
||||
|
||||
if (shader)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -115,10 +115,7 @@ public:
|
|||
TBO_LERP_VERT_ALPHA, // Interpolate based on Vertex Alpha (VA): ( Source1 * VA + Source2 * (1-VA) )
|
||||
TBO_LERP_TEX_ALPHA, // Interpolate based on Texture Alpha (TA): ( Source1 * TA + Source2 * (1-TA) )
|
||||
TBO_LERP_PREV_ALPHA, // Interpolate based on Previous Alpha (PA): ( Source1 * PA + Source2 * (1-PA) )
|
||||
TBO_LERP_CONST_ALPHA, // Interpolate based on Const Alpha (CA): ( Source1 * CA + Source2 * (1-CA) )
|
||||
TBO_LERP_VERT_COLOR // Interpolate based on Vertex Col (VC): ( Source1 * VC + Source2 * (1-VC) )
|
||||
// *Note* TBO_LERP_VERTEX_COLOR only works with setTextureColorBlend(),
|
||||
// and falls back to TBO_LERP_VERTEX_ALPHA for setTextureAlphaBlend().
|
||||
TBO_LERP_CONST_ALPHA // Interpolate based on Const Alpha (CA): ( Source1 * CA + Source2 * (1-CA) )
|
||||
} eTextureBlendOp;
|
||||
|
||||
typedef enum
|
||||
|
|
@ -211,15 +208,6 @@ public:
|
|||
// make sure you want to permanently change the filtering for the bound texture.
|
||||
void setTextureFilteringOption(LLTexUnit::eTextureFilterOptions option);
|
||||
|
||||
void setTextureBlendType(eTextureBlendType type);
|
||||
|
||||
inline void setTextureColorBlend(eTextureBlendOp op, eTextureBlendSrc src1, eTextureBlendSrc src2 = TBS_PREV_COLOR)
|
||||
{ setTextureCombiner(op, src1, src2, false); }
|
||||
|
||||
// NOTE: If *_COLOR enums are passed to src1 or src2, the corresponding *_ALPHA enum will be used instead.
|
||||
inline void setTextureAlphaBlend(eTextureBlendOp op, eTextureBlendSrc src1, eTextureBlendSrc src2 = TBS_PREV_ALPHA)
|
||||
{ setTextureCombiner(op, src1, src2, true); }
|
||||
|
||||
static U32 getInternalType(eTextureType type);
|
||||
|
||||
U32 getCurrTexture(void) { return mCurrTexture; }
|
||||
|
|
@ -253,7 +241,6 @@ protected:
|
|||
void setAlphaScale(S32 scale);
|
||||
GLint getTextureSource(eTextureBlendSrc src);
|
||||
GLint getTextureSourceType(eTextureBlendSrc src, bool isAlpha = false);
|
||||
void setTextureCombiner(eTextureBlendOp op, eTextureBlendSrc src1, eTextureBlendSrc src2, bool isAlpha = false);
|
||||
};
|
||||
|
||||
class LLLightState
|
||||
|
|
@ -459,8 +446,6 @@ public:
|
|||
void setColorMask(bool writeColorR, bool writeColorG, bool writeColorB, bool writeAlpha);
|
||||
void setSceneBlendType(eBlendType type);
|
||||
|
||||
void setAlphaRejectSettings(eCompareFunc func, F32 value = 0.01f);
|
||||
|
||||
// applies blend func to both color and alpha
|
||||
void blendFunc(eBlendFactor sfactor, eBlendFactor dfactor);
|
||||
// applies separate blend functions to color and alpha
|
||||
|
|
|
|||
|
|
@ -441,15 +441,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
|
|||
|
||||
if (solid_color)
|
||||
{
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gSolidColorProgram.bind();
|
||||
}
|
||||
else
|
||||
{
|
||||
gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
|
||||
gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA);
|
||||
}
|
||||
gSolidColorProgram.bind();
|
||||
}
|
||||
|
||||
if (center_rect.mLeft == 0.f
|
||||
|
|
@ -792,14 +784,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
|
|||
|
||||
if (solid_color)
|
||||
{
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
else
|
||||
{
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
}
|
||||
gUIProgram.bind();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -961,10 +946,6 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
|
|||
|
||||
void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color, F32 phase )
|
||||
{
|
||||
phase = fmod(phase, 1.f);
|
||||
|
||||
S32 shift = S32(phase * 4.f) % 4;
|
||||
|
||||
// Stippled line
|
||||
LLGLEnable stipple(GL_LINE_STIPPLE);
|
||||
|
||||
|
|
@ -973,11 +954,6 @@ void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LL
|
|||
gGL.flush();
|
||||
gGL.setLineWidth(2.5f); // <FS> Line width OGL core profile fix by Rye Mutt
|
||||
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glLineStipple(2, 0x3333 << shift);
|
||||
}
|
||||
|
||||
gGL.begin(LLRender::LINES);
|
||||
{
|
||||
gGL.vertex3fv( start.mV );
|
||||
|
|
@ -1117,52 +1093,16 @@ void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor
|
|||
// Draw gray and white checkerboard with black border
|
||||
void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha)
|
||||
{
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
// Initialize the first time this is called.
|
||||
const S32 PIXELS = 32;
|
||||
static GLubyte checkerboard[PIXELS * PIXELS];
|
||||
static BOOL first = TRUE;
|
||||
if( first )
|
||||
{
|
||||
for( S32 i = 0; i < PIXELS; i++ )
|
||||
{
|
||||
for( S32 j = 0; j < PIXELS; j++ )
|
||||
{
|
||||
checkerboard[i * PIXELS + j] = ((i & 1) ^ (j & 1)) * 0xFF;
|
||||
}
|
||||
}
|
||||
first = FALSE;
|
||||
}
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
//polygon stipple is deprecated, use "Checker" texture
|
||||
LLPointer<LLUIImage> img = LLRender2D::getInstance()->getUIImage("Checker");
|
||||
gGL.getTexUnit(0)->bind(img->getImage());
|
||||
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP);
|
||||
gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
|
||||
|
||||
// ...white squares
|
||||
gGL.color4f( 1.f, 1.f, 1.f, alpha );
|
||||
gl_rect_2d(rect);
|
||||
LLColor4 color(1.f, 1.f, 1.f, alpha);
|
||||
LLRectf uv_rect(0, 0, rect.getWidth()/32.f, rect.getHeight()/32.f);
|
||||
|
||||
// ...gray squares
|
||||
gGL.color4f( .7f, .7f, .7f, alpha );
|
||||
gGL.flush();
|
||||
|
||||
glPolygonStipple( checkerboard );
|
||||
|
||||
LLGLEnable polygon_stipple(GL_POLYGON_STIPPLE);
|
||||
gl_rect_2d(rect);
|
||||
}
|
||||
else
|
||||
{ //polygon stipple is deprecated, use "Checker" texture
|
||||
LLPointer<LLUIImage> img = LLRender2D::getInstance()->getUIImage("Checker");
|
||||
gGL.getTexUnit(0)->bind(img->getImage());
|
||||
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP);
|
||||
gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
|
||||
|
||||
LLColor4 color(1.f, 1.f, 1.f, alpha);
|
||||
LLRectf uv_rect(0, 0, rect.getWidth()/32.f, rect.getHeight()/32.f);
|
||||
|
||||
gl_draw_scaled_image(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(),
|
||||
img->getImage(), color, uv_rect);
|
||||
}
|
||||
gl_draw_scaled_image(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), img->getImage(), color, uv_rect);
|
||||
|
||||
gGL.flush();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1060,43 +1060,6 @@ BOOL LLShaderMgr::linkProgramObject(GLhandleARB obj, BOOL suppress_errors)
|
|||
LL_SHADER_LOADING_WARNS() << "GLSL Linker Error:" << LL_ENDL;
|
||||
}
|
||||
|
||||
#if LL_DARWIN
|
||||
|
||||
// For some reason this absolutely kills the frame rate when VBO's are enabled
|
||||
if (0)
|
||||
{
|
||||
// Force an evaluation of the gl state so the driver can tell if the shader will run in hardware or software
|
||||
// per Apple's suggestion
|
||||
LLGLSLShader::sNoFixedFunction = false;
|
||||
|
||||
glUseProgramObjectARB(obj);
|
||||
|
||||
gGL.begin(LLRender::TRIANGLES);
|
||||
gGL.vertex3f(0.0f, 0.0f, 0.0f);
|
||||
gGL.vertex3f(0.0f, 0.0f, 0.0f);
|
||||
gGL.vertex3f(0.0f, 0.0f, 0.0f);
|
||||
gGL.end();
|
||||
gGL.flush();
|
||||
|
||||
glUseProgramObjectARB(0);
|
||||
|
||||
LLGLSLShader::sNoFixedFunction = true;
|
||||
|
||||
// Query whether the shader can or cannot run in hardware
|
||||
// http://developer.apple.com/qa/qa2007/qa1502.html
|
||||
GLint vertexGPUProcessing, fragmentGPUProcessing;
|
||||
CGLContextObj ctx = CGLGetCurrentContext();
|
||||
CGLGetParameter(ctx, kCGLCPGPUVertexProcessing, &vertexGPUProcessing);
|
||||
CGLGetParameter(ctx, kCGLCPGPUFragmentProcessing, &fragmentGPUProcessing);
|
||||
if (!fragmentGPUProcessing || !vertexGPUProcessing)
|
||||
{
|
||||
LL_SHADER_LOADING_WARNS() << "GLSL Linker: Running in Software:" << LL_ENDL;
|
||||
success = GL_FALSE;
|
||||
suppress_errors = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
std::string log = get_object_log(obj);
|
||||
LLStringUtil::toLower(log);
|
||||
if (log.find("software") != std::string::npos)
|
||||
|
|
@ -1105,7 +1068,6 @@ BOOL LLShaderMgr::linkProgramObject(GLhandleARB obj, BOOL suppress_errors)
|
|||
success = GL_FALSE;
|
||||
suppress_errors = FALSE;
|
||||
}
|
||||
#endif
|
||||
return success;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -440,134 +440,25 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
|
|||
data_mask = data_mask & ~MAP_TEXTURE_INDEX;
|
||||
}
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
for (U32 i = 0; i < TYPE_MAX; ++i)
|
||||
{
|
||||
for (U32 i = 0; i < TYPE_MAX; ++i)
|
||||
{
|
||||
S32 loc = i;
|
||||
S32 loc = i;
|
||||
|
||||
U32 mask = 1 << i;
|
||||
U32 mask = 1 << i;
|
||||
|
||||
if (sLastMask & (1 << i))
|
||||
{ //was enabled
|
||||
if (!(data_mask & mask))
|
||||
{ //needs to be disabled
|
||||
glDisableVertexAttribArrayARB(loc);
|
||||
}
|
||||
}
|
||||
else
|
||||
{ //was disabled
|
||||
if (data_mask & mask)
|
||||
{ //needs to be enabled
|
||||
glEnableVertexAttribArrayARB(loc);
|
||||
}
|
||||
if (sLastMask & (1 << i))
|
||||
{ //was enabled
|
||||
if (!(data_mask & mask))
|
||||
{ //needs to be disabled
|
||||
glDisableVertexAttribArrayARB(loc);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
static const GLenum array[] =
|
||||
{
|
||||
GL_VERTEX_ARRAY,
|
||||
GL_NORMAL_ARRAY,
|
||||
GL_TEXTURE_COORD_ARRAY,
|
||||
GL_COLOR_ARRAY,
|
||||
};
|
||||
|
||||
static const GLenum mask[] =
|
||||
{
|
||||
MAP_VERTEX,
|
||||
MAP_NORMAL,
|
||||
MAP_TEXCOORD0,
|
||||
MAP_COLOR
|
||||
};
|
||||
|
||||
|
||||
|
||||
for (U32 i = 0; i < 4; ++i)
|
||||
{
|
||||
if (sLastMask & mask[i])
|
||||
{ //was enabled
|
||||
if (!(data_mask & mask[i]))
|
||||
{ //needs to be disabled
|
||||
glDisableClientState(array[i]);
|
||||
}
|
||||
else if (gDebugGL)
|
||||
{ //needs to be enabled, make sure it was (DEBUG)
|
||||
if (!glIsEnabled(array[i]))
|
||||
{
|
||||
if (gDebugSession)
|
||||
{
|
||||
gFailLog << "Bad client state! " << array[i] << " disabled." << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_ERRS() << "Bad client state! " << array[i] << " disabled." << LL_ENDL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{ //was disabled
|
||||
if (data_mask & mask)
|
||||
{ //needs to be enabled
|
||||
glEnableVertexAttribArrayARB(loc);
|
||||
}
|
||||
else
|
||||
{ //was disabled
|
||||
if (data_mask & mask[i])
|
||||
{ //needs to be enabled
|
||||
glEnableClientState(array[i]);
|
||||
}
|
||||
else if (gDebugGL && glIsEnabled(array[i]))
|
||||
{ //needs to be disabled, make sure it was (DEBUG TEMPORARY)
|
||||
if (gDebugSession)
|
||||
{
|
||||
gFailLog << "Bad client state! " << array[i] << " enabled." << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_ERRS() << "Bad client state! " << array[i] << " enabled." << LL_ENDL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const U32 map_tc[] =
|
||||
{
|
||||
MAP_TEXCOORD1,
|
||||
MAP_TEXCOORD2,
|
||||
MAP_TEXCOORD3
|
||||
};
|
||||
|
||||
for (U32 i = 0; i < 3; i++)
|
||||
{
|
||||
if (sLastMask & map_tc[i])
|
||||
{
|
||||
if (!(data_mask & map_tc[i]))
|
||||
{ //disable
|
||||
glClientActiveTextureARB(GL_TEXTURE1_ARB+i);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
}
|
||||
}
|
||||
else if (data_mask & map_tc[i])
|
||||
{
|
||||
glClientActiveTextureARB(GL_TEXTURE1_ARB+i);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
}
|
||||
}
|
||||
|
||||
if (sLastMask & MAP_TANGENT)
|
||||
{
|
||||
if (!(data_mask & MAP_TANGENT))
|
||||
{
|
||||
glClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
}
|
||||
}
|
||||
else if (data_mask & MAP_TANGENT)
|
||||
{
|
||||
glClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -592,7 +483,7 @@ void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos)
|
|||
void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVector2* tc, S32 num_indices, const U16* indicesp)
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
|
||||
llassert(LLGLSLShader::sCurBoundShaderPtr != NULL);
|
||||
|
||||
// <FS:Beq> FIRE-29679 trap empty calls that cause crashes when rezzing in OpenSim.
|
||||
if(pos == nullptr || indicesp == nullptr )
|
||||
|
|
@ -705,7 +596,7 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
|
|||
gGL.syncMatrices();
|
||||
|
||||
llassert(mNumVerts >= 0);
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
|
||||
llassert(LLGLSLShader::sCurBoundShaderPtr != NULL);
|
||||
|
||||
if (mGLArray)
|
||||
{
|
||||
|
|
@ -773,7 +664,7 @@ void LLVertexBuffer::drawRangeFast(U32 mode, U32 start, U32 end, U32 count, U32
|
|||
|
||||
void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
|
||||
{
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
|
||||
llassert(LLGLSLShader::sCurBoundShaderPtr != NULL);
|
||||
mMappable = false;
|
||||
gGL.syncMatrices();
|
||||
|
||||
|
|
@ -824,7 +715,7 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
|
|||
void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
|
||||
llassert(LLGLSLShader::sCurBoundShaderPtr != NULL);
|
||||
mMappable = false;
|
||||
gGL.syncMatrices();
|
||||
|
||||
|
|
@ -2527,140 +2418,94 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
|
|||
LL_ERRS() << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask." << LL_ENDL;
|
||||
}
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
if (data_mask & MAP_NORMAL)
|
||||
{
|
||||
if (data_mask & MAP_NORMAL)
|
||||
{
|
||||
S32 loc = TYPE_NORMAL;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_NORMAL]);
|
||||
glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_NORMAL], ptr);
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD3)
|
||||
{
|
||||
S32 loc = TYPE_TEXCOORD3;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD3]);
|
||||
glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], ptr);
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD2)
|
||||
{
|
||||
S32 loc = TYPE_TEXCOORD2;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD2]);
|
||||
glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], ptr);
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD1)
|
||||
{
|
||||
S32 loc = TYPE_TEXCOORD1;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD1]);
|
||||
glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], ptr);
|
||||
}
|
||||
if (data_mask & MAP_TANGENT)
|
||||
{
|
||||
S32 loc = TYPE_TANGENT;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_TANGENT]);
|
||||
glVertexAttribPointerARB(loc, 4,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TANGENT], ptr);
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD0)
|
||||
{
|
||||
S32 loc = TYPE_TEXCOORD0;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD0]);
|
||||
glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], ptr);
|
||||
}
|
||||
if (data_mask & MAP_COLOR)
|
||||
{
|
||||
S32 loc = TYPE_COLOR;
|
||||
//bind emissive instead of color pointer if emissive is present
|
||||
void* ptr = (data_mask & MAP_EMISSIVE) ? (void*)(base + mOffsets[TYPE_EMISSIVE]) : (void*)(base + mOffsets[TYPE_COLOR]);
|
||||
glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_COLOR], ptr);
|
||||
}
|
||||
if (data_mask & MAP_EMISSIVE)
|
||||
{
|
||||
S32 loc = TYPE_EMISSIVE;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_EMISSIVE]);
|
||||
glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr);
|
||||
|
||||
if (!(data_mask & MAP_COLOR))
|
||||
{ //map emissive to color channel when color is not also being bound to avoid unnecessary shader swaps
|
||||
loc = TYPE_COLOR;
|
||||
glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr);
|
||||
}
|
||||
}
|
||||
if (data_mask & MAP_WEIGHT)
|
||||
{
|
||||
S32 loc = TYPE_WEIGHT;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_WEIGHT]);
|
||||
glVertexAttribPointerARB(loc, 1, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], ptr);
|
||||
}
|
||||
if (data_mask & MAP_WEIGHT4)
|
||||
{
|
||||
S32 loc = TYPE_WEIGHT4;
|
||||
void* ptr = (void*)(base+mOffsets[TYPE_WEIGHT4]);
|
||||
glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], ptr);
|
||||
}
|
||||
if (data_mask & MAP_CLOTHWEIGHT)
|
||||
{
|
||||
S32 loc = TYPE_CLOTHWEIGHT;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]);
|
||||
glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr);
|
||||
}
|
||||
if (data_mask & MAP_TEXTURE_INDEX &&
|
||||
(gGLManager.mGLSLVersionMajor >= 2 || gGLManager.mGLSLVersionMinor >= 30)) //indexed texture rendering requires GLSL 1.30 or later
|
||||
{
|
||||
#if !LL_DARWIN
|
||||
S32 loc = TYPE_TEXTURE_INDEX;
|
||||
void *ptr = (void*) (base + mOffsets[TYPE_VERTEX] + 12);
|
||||
glVertexAttribIPointer(loc, 1, GL_UNSIGNED_INT, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr);
|
||||
#endif
|
||||
}
|
||||
if (data_mask & MAP_VERTEX)
|
||||
{
|
||||
S32 loc = TYPE_VERTEX;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_VERTEX]);
|
||||
glVertexAttribPointerARB(loc, 3,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data_mask & MAP_NORMAL)
|
||||
{
|
||||
glNormalPointer(GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_NORMAL], (void*)(base + mOffsets[TYPE_NORMAL]));
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD3)
|
||||
{
|
||||
glClientActiveTextureARB(GL_TEXTURE3_ARB);
|
||||
glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], (void*)(base + mOffsets[TYPE_TEXCOORD3]));
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD2)
|
||||
{
|
||||
glClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], (void*)(base + mOffsets[TYPE_TEXCOORD2]));
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD1)
|
||||
{
|
||||
glClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], (void*)(base + mOffsets[TYPE_TEXCOORD1]));
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
}
|
||||
if (data_mask & MAP_TANGENT)
|
||||
{
|
||||
glClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glTexCoordPointer(4,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TANGENT], (void*)(base + mOffsets[TYPE_TANGENT]));
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD0)
|
||||
{
|
||||
glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], (void*)(base + mOffsets[TYPE_TEXCOORD0]));
|
||||
}
|
||||
if (data_mask & MAP_COLOR)
|
||||
{
|
||||
glColorPointer(4, GL_UNSIGNED_BYTE, LLVertexBuffer::sTypeSize[TYPE_COLOR], (void*)(base + mOffsets[TYPE_COLOR]));
|
||||
}
|
||||
if (data_mask & MAP_VERTEX)
|
||||
{
|
||||
glVertexPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
|
||||
}
|
||||
S32 loc = TYPE_NORMAL;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_NORMAL]);
|
||||
glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_NORMAL], ptr);
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD3)
|
||||
{
|
||||
S32 loc = TYPE_TEXCOORD3;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD3]);
|
||||
glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], ptr);
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD2)
|
||||
{
|
||||
S32 loc = TYPE_TEXCOORD2;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD2]);
|
||||
glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], ptr);
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD1)
|
||||
{
|
||||
S32 loc = TYPE_TEXCOORD1;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD1]);
|
||||
glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], ptr);
|
||||
}
|
||||
if (data_mask & MAP_TANGENT)
|
||||
{
|
||||
S32 loc = TYPE_TANGENT;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_TANGENT]);
|
||||
glVertexAttribPointerARB(loc, 4,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TANGENT], ptr);
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD0)
|
||||
{
|
||||
S32 loc = TYPE_TEXCOORD0;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD0]);
|
||||
glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], ptr);
|
||||
}
|
||||
if (data_mask & MAP_COLOR)
|
||||
{
|
||||
S32 loc = TYPE_COLOR;
|
||||
//bind emissive instead of color pointer if emissive is present
|
||||
void* ptr = (data_mask & MAP_EMISSIVE) ? (void*)(base + mOffsets[TYPE_EMISSIVE]) : (void*)(base + mOffsets[TYPE_COLOR]);
|
||||
glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_COLOR], ptr);
|
||||
}
|
||||
if (data_mask & MAP_EMISSIVE)
|
||||
{
|
||||
S32 loc = TYPE_EMISSIVE;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_EMISSIVE]);
|
||||
glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr);
|
||||
|
||||
if (!(data_mask & MAP_COLOR))
|
||||
{ //map emissive to color channel when color is not also being bound to avoid unnecessary shader swaps
|
||||
loc = TYPE_COLOR;
|
||||
glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr);
|
||||
}
|
||||
}
|
||||
if (data_mask & MAP_WEIGHT)
|
||||
{
|
||||
S32 loc = TYPE_WEIGHT;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_WEIGHT]);
|
||||
glVertexAttribPointerARB(loc, 1, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], ptr);
|
||||
}
|
||||
if (data_mask & MAP_WEIGHT4)
|
||||
{
|
||||
S32 loc = TYPE_WEIGHT4;
|
||||
void* ptr = (void*)(base+mOffsets[TYPE_WEIGHT4]);
|
||||
glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], ptr);
|
||||
}
|
||||
if (data_mask & MAP_CLOTHWEIGHT)
|
||||
{
|
||||
S32 loc = TYPE_CLOTHWEIGHT;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]);
|
||||
glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr);
|
||||
}
|
||||
if (data_mask & MAP_TEXTURE_INDEX &&
|
||||
(gGLManager.mGLSLVersionMajor >= 2 || gGLManager.mGLSLVersionMinor >= 30)) //indexed texture rendering requires GLSL 1.30 or later
|
||||
{
|
||||
#if !LL_DARWIN
|
||||
S32 loc = TYPE_TEXTURE_INDEX;
|
||||
void *ptr = (void*) (base + mOffsets[TYPE_VERTEX] + 12);
|
||||
glVertexAttribIPointer(loc, 1, GL_UNSIGNED_INT, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr);
|
||||
#endif
|
||||
}
|
||||
if (data_mask & MAP_VERTEX)
|
||||
{
|
||||
S32 loc = TYPE_VERTEX;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_VERTEX]);
|
||||
glVertexAttribPointerARB(loc, 3,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr);
|
||||
}
|
||||
|
||||
llglassertok();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1801,14 +1801,6 @@ void* LLWindowWin32::createSharedContext()
|
|||
LL_INFOS() << "Created OpenGL " << llformat("%d.%d", attribs[1], attribs[3]) <<
|
||||
(LLRender::sGLCoreProfile ? " core" : " compatibility") << " context." << LL_ENDL;
|
||||
done = true;
|
||||
|
||||
// force sNoFixedFunction iff we're trying to use nsight debugging which does not support many legacy API uses
|
||||
|
||||
// nSight doesn't support use of legacy API funcs in the fixed function pipe
|
||||
if (LLRender::sGLCoreProfile || LLRender::sNsightDebugSupport)
|
||||
{
|
||||
LLGLSLShader::sNoFixedFunction = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
<string>RenderAvatarMaxComplexity</string>
|
||||
<string>RenderAvatarMaxNonImpostors</string>
|
||||
<string>RenderAvatarPhysicsLODFactor</string>
|
||||
<string>RenderAvatarVP</string>
|
||||
<string>RenderCompressTextures</string>
|
||||
<string>RenderDeferred</string>
|
||||
<string>RenderDeferredSSAO</string>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
<RenderAvatarLODFactor value="1.0"/>
|
||||
<!--Default for now-->
|
||||
<RenderAvatarPhysicsLODFactor value="0.9"/>
|
||||
<!--NO SHADERS-->
|
||||
<RenderAvatarVP value="TRUE"/>
|
||||
<!--Short Range-->
|
||||
<RenderFarClip value="128"/>
|
||||
<!--Default for now-->
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
<RenderAvatarLODFactor value="0.5"/>
|
||||
<!--Default for now-->
|
||||
<RenderAvatarPhysicsLODFactor value="0.0"/>
|
||||
<!--NO SHADERS-->
|
||||
<RenderAvatarVP value="FALSE"/>
|
||||
<!--Short Range-->
|
||||
<RenderFarClip value="64"/>
|
||||
<!--Default for now-->
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
<RenderAvatarLODFactor value="0.5"/>
|
||||
<!--Default for now-->
|
||||
<RenderAvatarPhysicsLODFactor value="0.75"/>
|
||||
<!--NO SHADERS-->
|
||||
<RenderAvatarVP value="TRUE"/>
|
||||
<!--Short Range-->
|
||||
<RenderFarClip value="96"/>
|
||||
<!--Default for now-->
|
||||
|
|
|
|||
|
|
@ -11691,17 +11691,6 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<real>1.0</real>
|
||||
</map>
|
||||
<key>RenderAvatarVP</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Use vertex programs to perform hardware skinning of avatar</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>RenderCompressTextures</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
<RenderAvatarLODFactor value="1.0"/>
|
||||
<!--Default for now-->
|
||||
<RenderAvatarPhysicsLODFactor value="1.0"/>
|
||||
<!--NO SHADERS-->
|
||||
<RenderAvatarVP value="TRUE"/>
|
||||
<!--Short Range-->
|
||||
<RenderFarClip value="256"/>
|
||||
<!--Default for now-->
|
||||
|
|
|
|||
|
|
@ -2033,12 +2033,17 @@ void LLAppViewer::flushLFSIO()
|
|||
|
||||
bool LLAppViewer::cleanup()
|
||||
{
|
||||
LLAtmosphere::cleanupClass();
|
||||
// Since we don't know what functions are going to be queued by
|
||||
// onCleanup(), we have to assume they might rely on some of the things
|
||||
// we're about to destroy below. Run them first.
|
||||
mOnCleanup();
|
||||
|
||||
LLAtmosphere::cleanupClass();
|
||||
|
||||
//ditch LLVOAvatarSelf instance
|
||||
gAgentAvatarp = NULL;
|
||||
|
||||
LLNotifications::instance().clear();
|
||||
LLNotifications::instance().clear();
|
||||
|
||||
// workaround for DEV-35406 crash on shutdown
|
||||
LLEventPumps::instance().reset();
|
||||
|
|
@ -2079,14 +2084,14 @@ bool LLAppViewer::cleanup()
|
|||
// to ensure shutdown order
|
||||
LLMortician::setZealous(TRUE);
|
||||
|
||||
// Give any remaining SLPlugin instances a chance to exit cleanly.
|
||||
LLPluginProcessParent::shutdown();
|
||||
// Give any remaining SLPlugin instances a chance to exit cleanly.
|
||||
LLPluginProcessParent::shutdown();
|
||||
|
||||
disconnectViewer();
|
||||
LLViewerCamera::deleteSingleton();
|
||||
LLViewerCamera::deleteSingleton();
|
||||
|
||||
LL_INFOS() << "Viewer disconnected" << LL_ENDL;
|
||||
|
||||
|
||||
if (gKeyboard)
|
||||
{
|
||||
gKeyboard->resetKeys();
|
||||
|
|
@ -2195,16 +2200,16 @@ bool LLAppViewer::cleanup()
|
|||
|
||||
if (gAudiop)
|
||||
{
|
||||
// be sure to stop the internet stream cleanly BEFORE destroying the interface to stop it.
|
||||
gAudiop->stopInternetStream();
|
||||
// shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem.
|
||||
// be sure to stop the internet stream cleanly BEFORE destroying the interface to stop it.
|
||||
gAudiop->stopInternetStream();
|
||||
// shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem.
|
||||
// <FS> FMOD fixes
|
||||
// LLStreamingAudioInterface *sai = gAudiop->getStreamingAudioImpl();
|
||||
// LLStreamingAudioInterface *sai = gAudiop->getStreamingAudioImpl();
|
||||
// delete sai;
|
||||
// gAudiop->setStreamingAudioImpl(NULL);
|
||||
|
||||
// shut down the audio subsystem
|
||||
gAudiop->shutdown();
|
||||
// shut down the audio subsystem
|
||||
gAudiop->shutdown();
|
||||
|
||||
delete gAudiop;
|
||||
gAudiop = NULL;
|
||||
|
|
@ -2279,11 +2284,11 @@ bool LLAppViewer::cleanup()
|
|||
delete gKeyboard;
|
||||
gKeyboard = NULL;
|
||||
|
||||
if (LLViewerJoystick::instanceExists())
|
||||
{
|
||||
// Turn off Space Navigator and similar devices
|
||||
LLViewerJoystick::getInstance()->terminate();
|
||||
}
|
||||
if (LLViewerJoystick::instanceExists())
|
||||
{
|
||||
// Turn off Space Navigator and similar devices
|
||||
LLViewerJoystick::getInstance()->terminate();
|
||||
}
|
||||
|
||||
LL_INFOS() << "Cleaning up Objects" << LL_ENDL;
|
||||
|
||||
|
|
@ -2326,11 +2331,11 @@ bool LLAppViewer::cleanup()
|
|||
// Store the time of our current logoff
|
||||
gSavedPerAccountSettings.setU32("LastLogoff", time_corrected());
|
||||
|
||||
if (LLEnvironment::instanceExists())
|
||||
{
|
||||
//Store environment settings if nessesary
|
||||
LLEnvironment::getInstance()->saveToSettings();
|
||||
}
|
||||
if (LLEnvironment::instanceExists())
|
||||
{
|
||||
//Store environment settings if necessary
|
||||
LLEnvironment::getInstance()->saveToSettings();
|
||||
}
|
||||
|
||||
// Must do this after all panels have been deleted because panels that have persistent rects
|
||||
// save their rects on delete.
|
||||
|
|
@ -2416,7 +2421,7 @@ bool LLAppViewer::cleanup()
|
|||
LLConversationLog::instance().cache();
|
||||
}
|
||||
|
||||
clearSecHandler();
|
||||
clearSecHandler();
|
||||
|
||||
if (mPurgeCacheOnExit)
|
||||
{
|
||||
|
|
@ -2460,13 +2465,13 @@ bool LLAppViewer::cleanup()
|
|||
}
|
||||
}
|
||||
|
||||
if (mPurgeUserDataOnExit)
|
||||
{
|
||||
// Ideally we should not save anything from this session since it is going to be purged now,
|
||||
// but this is a very 'rare' case (user deleting himself), not worth overcomplicating 'save&cleanup' code
|
||||
std::string user_path = gDirUtilp->getOSUserAppDir() + gDirUtilp->getDirDelimiter() + LLStartUp::getUserId();
|
||||
gDirUtilp->deleteDirAndContents(user_path);
|
||||
}
|
||||
if (mPurgeUserDataOnExit)
|
||||
{
|
||||
// Ideally we should not save anything from this session since it is going to be purged now,
|
||||
// but this is a very 'rare' case (user deleting himself), not worth overcomplicating 'save&cleanup' code
|
||||
std::string user_path = gDirUtilp->getOSUserAppDir() + gDirUtilp->getDirDelimiter() + LLStartUp::getUserId();
|
||||
gDirUtilp->deleteDirAndContents(user_path);
|
||||
}
|
||||
|
||||
// Delete workers first
|
||||
// shotdown all worker threads before deleting them in case of co-dependencies
|
||||
|
|
@ -2490,11 +2495,11 @@ bool LLAppViewer::cleanup()
|
|||
|
||||
//MUST happen AFTER SUBSYSTEM_CLEANUP(LLCurl)
|
||||
delete sTextureCache;
|
||||
sTextureCache = NULL;
|
||||
sTextureCache = NULL;
|
||||
delete sTextureFetch;
|
||||
sTextureFetch = NULL;
|
||||
sTextureFetch = NULL;
|
||||
delete sImageDecodeThread;
|
||||
sImageDecodeThread = NULL;
|
||||
sImageDecodeThread = NULL;
|
||||
delete mFastTimerLogThread;
|
||||
mFastTimerLogThread = NULL;
|
||||
// <FS:Ansariel> Regular disk cache cleanup
|
||||
|
|
@ -2557,15 +2562,15 @@ bool LLAppViewer::cleanup()
|
|||
// make sure nothing uses applyProxySettings by this point.
|
||||
LL_INFOS() << "Cleaning up LLProxy." << LL_ENDL;
|
||||
SUBSYSTEM_CLEANUP(LLProxy);
|
||||
LLCore::LLHttp::cleanup();
|
||||
LLCore::LLHttp::cleanup();
|
||||
|
||||
ll_close_fail_log();
|
||||
|
||||
LLError::LLCallStacks::cleanup();
|
||||
|
||||
LLEnvironment::deleteSingleton();
|
||||
LLSelectMgr::deleteSingleton();
|
||||
LLViewerEventRecorder::deleteSingleton();
|
||||
LLEnvironment::deleteSingleton();
|
||||
LLSelectMgr::deleteSingleton();
|
||||
LLViewerEventRecorder::deleteSingleton();
|
||||
|
||||
// It's not at first obvious where, in this long sequence, a generic cleanup
|
||||
// call OUGHT to go. So let's say this: as we migrate cleanup from
|
||||
|
|
@ -2578,8 +2583,7 @@ bool LLAppViewer::cleanup()
|
|||
// deleteSingleton() methods.
|
||||
LLSingletonBase::deleteAll();
|
||||
|
||||
|
||||
LL_INFOS() << "Goodbye!" << LL_ENDL;
|
||||
LL_INFOS() << "Goodbye!" << LL_ENDL;
|
||||
|
||||
removeDumpDir();
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@
|
|||
#include "lltimer.h"
|
||||
#include "llappcorehttp.h"
|
||||
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
class LLCommandLineParser;
|
||||
class LLFrameTimer;
|
||||
class LLPumpIO;
|
||||
|
|
@ -69,13 +71,13 @@ public:
|
|||
LLAppViewer();
|
||||
virtual ~LLAppViewer();
|
||||
|
||||
/**
|
||||
* @brief Access to the LLAppViewer singleton.
|
||||
*
|
||||
* The LLAppViewer singleton is created in main()/WinMain().
|
||||
* So don't use it in pre-entry (static initialization) code.
|
||||
*/
|
||||
static LLAppViewer* instance() {return sInstance; }
|
||||
/**
|
||||
* @brief Access to the LLAppViewer singleton.
|
||||
*
|
||||
* The LLAppViewer singleton is created in main()/WinMain().
|
||||
* So don't use it in pre-entry (static initialization) code.
|
||||
*/
|
||||
static LLAppViewer* instance() {return sInstance; }
|
||||
|
||||
//
|
||||
// Main application logic
|
||||
|
|
@ -93,12 +95,12 @@ public:
|
|||
void earlyExit(const std::string& name,
|
||||
const LLSD& substitutions = LLSD()); // Display an error dialog and forcibly quit.
|
||||
void earlyExitNoNotify(); // Do not display error dialog then forcibly quit.
|
||||
void abortQuit(); // Called to abort a quit request.
|
||||
void abortQuit(); // Called to abort a quit request.
|
||||
|
||||
bool quitRequested() { return mQuitRequested; }
|
||||
bool logoutRequestSent() { return mLogoutRequestSent; }
|
||||
bool quitRequested() { return mQuitRequested; }
|
||||
bool logoutRequestSent() { return mLogoutRequestSent; }
|
||||
bool isSecondInstance() { return mSecondInstance; }
|
||||
bool isUpdaterMissing() { return mUpdaterNotFound; }
|
||||
bool isUpdaterMissing() { return mUpdaterNotFound; }
|
||||
|
||||
void writeDebugInfo(bool isStatic=true);
|
||||
|
||||
|
|
@ -112,7 +114,7 @@ public:
|
|||
virtual bool restoreErrorTrap() = 0; // Require platform specific override to reset error handling mechanism.
|
||||
// return false if the error trap needed restoration.
|
||||
static void handleViewerCrash(); // Hey! The viewer crashed. Do this, soon.
|
||||
void checkForCrash();
|
||||
void checkForCrash();
|
||||
|
||||
// Thread accessors
|
||||
static LLTextureCache* getTextureCache() { return sTextureCache; }
|
||||
|
|
@ -124,34 +126,34 @@ public:
|
|||
static U32 getObjectCacheVersion() ;
|
||||
|
||||
const std::string& getSerialNumber() { return mSerialNumber; }
|
||||
|
||||
|
||||
bool getPurgeCache() const { return mPurgeCache; }
|
||||
|
||||
|
||||
std::string getSecondLifeTitle() const; // The Second Life title.
|
||||
std::string getWindowTitle() const; // The window display name.
|
||||
|
||||
void forceDisconnect(const std::string& msg); // Force disconnection, with a message to the user.
|
||||
void badNetworkHandler(); // Cause a crash state due to bad network packet.
|
||||
void forceDisconnect(const std::string& msg); // Force disconnection, with a message to the user.
|
||||
void badNetworkHandler(); // Cause a crash state due to bad network packet.
|
||||
|
||||
bool hasSavedFinalSnapshot() { return mSavedFinalSnapshot; }
|
||||
void saveFinalSnapshot();
|
||||
|
||||
void loadNameCache();
|
||||
void saveNameCache();
|
||||
void loadNameCache();
|
||||
void saveNameCache();
|
||||
|
||||
void removeMarkerFiles();
|
||||
|
||||
|
||||
void removeDumpDir();
|
||||
// LLAppViewer testing helpers.
|
||||
// *NOTE: These will potentially crash the viewer. Only for debugging.
|
||||
virtual void forceErrorLLError();
|
||||
virtual void forceErrorBreakpoint();
|
||||
virtual void forceErrorBadMemoryAccess();
|
||||
virtual void forceErrorInfiniteLoop();
|
||||
virtual void forceErrorSoftwareException();
|
||||
virtual void forceErrorDriverCrash();
|
||||
virtual void forceErrorCoroutineCrash();
|
||||
virtual void forceErrorThreadCrash();
|
||||
// LLAppViewer testing helpers.
|
||||
// *NOTE: These will potentially crash the viewer. Only for debugging.
|
||||
virtual void forceErrorLLError();
|
||||
virtual void forceErrorBreakpoint();
|
||||
virtual void forceErrorBadMemoryAccess();
|
||||
virtual void forceErrorInfiniteLoop();
|
||||
virtual void forceErrorSoftwareException();
|
||||
virtual void forceErrorDriverCrash();
|
||||
virtual void forceErrorCoroutineCrash();
|
||||
virtual void forceErrorThreadCrash();
|
||||
|
||||
// The list is found in app_settings/settings_files.xml
|
||||
// but since they are used explicitly in code,
|
||||
|
|
@ -199,22 +201,32 @@ public:
|
|||
void handleLoginComplete();
|
||||
|
||||
// <FS:Ansariel> Get rid of unused LLAllocator
|
||||
//LLAllocator & getAllocator() { return mAlloc; }
|
||||
//LLAllocator & getAllocator() { return mAlloc; }
|
||||
|
||||
// On LoginCompleted callback
|
||||
typedef boost::signals2::signal<void (void)> login_completed_signal_t;
|
||||
login_completed_signal_t mOnLoginCompleted;
|
||||
boost::signals2::connection setOnLoginCompletedCallback( const login_completed_signal_t::slot_type& cb ) { return mOnLoginCompleted.connect(cb); }
|
||||
boost::signals2::connection setOnLoginCompletedCallback( const login_completed_signal_t::slot_type& cb )
|
||||
{
|
||||
return mOnLoginCompleted.connect(cb);
|
||||
}
|
||||
|
||||
void addOnIdleCallback(const boost::function<void()>& cb); // add a callback to fire (once) when idle
|
||||
|
||||
typedef boost::signals2::signal<void()> cleanup_signal_t;
|
||||
cleanup_signal_t mOnCleanup;
|
||||
boost::signals2::connection onCleanup(const cleanup_signal_t::slot_type& cb)
|
||||
{
|
||||
return mOnCleanup.connect(cb);
|
||||
}
|
||||
|
||||
void purgeUserDataOnExit() { mPurgeUserDataOnExit = true; }
|
||||
void purgeCache(); // Clear the local cache.
|
||||
void purgeCacheImmediate(); //clear local cache immediately.
|
||||
S32 updateTextureThreads(F32 max_time);
|
||||
|
||||
void loadKeyBindings();
|
||||
|
||||
|
||||
// mute/unmute the system's master audio
|
||||
virtual void setMasterSystemAudioMute(bool mute);
|
||||
virtual bool getMasterSystemAudioMute();
|
||||
|
|
@ -226,7 +238,7 @@ public:
|
|||
// llcorehttp init/shutdown/config information.
|
||||
LLAppCoreHttp & getAppCoreHttp() { return mAppCoreHttp; }
|
||||
|
||||
void updateNameLookupUrl(const LLViewerRegion* regionp);
|
||||
void updateNameLookupUrl(const LLViewerRegion* regionp);
|
||||
|
||||
protected:
|
||||
virtual bool initWindow(); // Initialize the viewer's window.
|
||||
|
|
@ -237,7 +249,7 @@ protected:
|
|||
virtual bool sendURLToOtherInstance(const std::string& url);
|
||||
|
||||
virtual bool initParseCommandLine(LLCommandLineParser& clp)
|
||||
{ return true; } // Allow platforms to specify the command line args.
|
||||
{ return true; } // Allow platforms to specify the command line args.
|
||||
|
||||
virtual std::string generateSerialNumber() = 0; // Platforms specific classes generate this.
|
||||
|
||||
|
|
@ -265,21 +277,21 @@ private:
|
|||
void processMarkerFiles();
|
||||
static void recordMarkerVersion(LLAPRFile& marker_file);
|
||||
bool markerIsSameVersion(const std::string& marker_name) const;
|
||||
|
||||
void idle();
|
||||
void idleShutdown();
|
||||
|
||||
void idle();
|
||||
void idleShutdown();
|
||||
// update avatar SLID and display name caches
|
||||
void idleNameCache();
|
||||
void idleNetwork();
|
||||
void idleNetwork();
|
||||
|
||||
void sendLogoutRequest();
|
||||
void disconnectViewer();
|
||||
void sendLogoutRequest();
|
||||
void disconnectViewer();
|
||||
|
||||
// *FIX: the app viewer class should be some sort of singleton, no?
|
||||
// Perhaps its child class is the singleton and this should be an abstract base.
|
||||
static LLAppViewer* sInstance;
|
||||
|
||||
bool mSecondInstance; // Is this a second instance of the app?
|
||||
bool mSecondInstance; // Is this a second instance of the app?
|
||||
bool mUpdaterNotFound; // True when attempt to start updater failed
|
||||
|
||||
std::string mMarkerFileName;
|
||||
|
|
@ -320,8 +332,8 @@ private:
|
|||
|
||||
boost::optional<U32> mForceGraphicsLevel;
|
||||
|
||||
bool mQuitRequested; // User wants to quit, may have modified documents open.
|
||||
bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim.
|
||||
bool mQuitRequested; // User wants to quit, may have modified documents open.
|
||||
bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim.
|
||||
U32 mLastAgentControlFlags;
|
||||
F32 mLastAgentForceUpdate;
|
||||
struct SettingsFiles* mSettingsLocationList;
|
||||
|
|
@ -336,12 +348,12 @@ private:
|
|||
LLUUID mAgentRegionLastID;
|
||||
|
||||
// <FS:Ansariel> Get rid of unused LLAllocator
|
||||
//LLAllocator mAlloc;
|
||||
//LLAllocator mAlloc;
|
||||
|
||||
// llcorehttp library init/shutdown helper
|
||||
LLAppCoreHttp mAppCoreHttp;
|
||||
|
||||
bool mIsFirstRun;
|
||||
bool mIsFirstRun;
|
||||
// <FS:Zi> Backup Settings
|
||||
public:
|
||||
void setSaveSettingsOnExit(bool state) {mSaveSettingsOnExit = state; };
|
||||
|
|
|
|||
|
|
@ -527,7 +527,7 @@ void LLRenderPass::pushRiggedMaskBatches(U32 type, U32 mask, BOOL texture, BOOL
|
|||
}
|
||||
else
|
||||
{
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, pparams->mAlphaMaskCutoff);
|
||||
gGL.flush();
|
||||
}
|
||||
|
||||
if (lastAvatar != pparams->mAvatar || lastMeshId != pparams->mSkinInfo->mHash)
|
||||
|
|
|
|||
|
|
@ -511,11 +511,8 @@ void LLDrawPoolAvatar::beginImpostor()
|
|||
LLVOAvatar::sNumVisibleAvatars = 0;
|
||||
}
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gImpostorProgram.bind();
|
||||
gImpostorProgram.setMinimumAlpha(0.01f);
|
||||
}
|
||||
gImpostorProgram.bind();
|
||||
gImpostorProgram.setMinimumAlpha(0.01f);
|
||||
|
||||
gPipeline.enableLightsFullbright();
|
||||
sDiffuseChannel = 0;
|
||||
|
|
@ -525,10 +522,7 @@ void LLDrawPoolAvatar::endImpostor()
|
|||
{
|
||||
LL_PROFILE_ZONE_SCOPED
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gImpostorProgram.unbind();
|
||||
}
|
||||
gImpostorProgram.unbind();
|
||||
gPipeline.enableLightsDynamic();
|
||||
}
|
||||
|
||||
|
|
@ -536,7 +530,7 @@ void LLDrawPoolAvatar::beginRigid()
|
|||
{
|
||||
LL_PROFILE_ZONE_SCOPED
|
||||
|
||||
if (gPipeline.canUseVertexShaders())
|
||||
if (gPipeline.shadersLoaded())
|
||||
{
|
||||
if (LLPipeline::sUnderWaterRender)
|
||||
{
|
||||
|
|
@ -684,7 +678,7 @@ void LLDrawPoolAvatar::beginSkinned()
|
|||
}
|
||||
else
|
||||
{
|
||||
if(gPipeline.canUseVertexShaders())
|
||||
if(gPipeline.shadersLoaded())
|
||||
{
|
||||
// software skinning, use a basic shader for windlight.
|
||||
// TODO: find a better fallback method for software skinning.
|
||||
|
|
@ -700,10 +694,7 @@ void LLDrawPoolAvatar::beginSkinned()
|
|||
}
|
||||
}
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha);
|
||||
}
|
||||
sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha);
|
||||
}
|
||||
|
||||
void LLDrawPoolAvatar::endSkinned()
|
||||
|
|
@ -721,7 +712,7 @@ void LLDrawPoolAvatar::endSkinned()
|
|||
}
|
||||
else
|
||||
{
|
||||
if(gPipeline.canUseVertexShaders())
|
||||
if(gPipeline.shadersLoaded())
|
||||
{
|
||||
// software skinning, use a basic shader for windlight.
|
||||
// TODO: find a better fallback method for software skinning.
|
||||
|
|
@ -827,11 +818,8 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
|
|||
LLGLSLShader* current_shader_program = NULL;
|
||||
|
||||
// load the debug output shader
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
current_shader_program = LLGLSLShader::sCurBoundShaderPtr;
|
||||
gDebugProgram.bind();
|
||||
}
|
||||
current_shader_program = LLGLSLShader::sCurBoundShaderPtr;
|
||||
gDebugProgram.bind();
|
||||
|
||||
// set up drawing mode and remove any textures used
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
|
|
@ -893,13 +881,10 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
|
|||
gGL.end();
|
||||
|
||||
// unload debug shader
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
gDebugProgram.unbind();
|
||||
if (current_shader_program)
|
||||
{
|
||||
gDebugProgram.unbind();
|
||||
if (current_shader_program)
|
||||
{
|
||||
current_shader_program->bind();
|
||||
}
|
||||
current_shader_program->bind();
|
||||
}
|
||||
}
|
||||
}// </FS:Zi>
|
||||
|
|
|
|||
|
|
@ -391,7 +391,6 @@ void LLDrawPoolBump::bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& di
|
|||
// the cube map in the one pass shiny shaders
|
||||
cube_channel = shader->enableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
|
||||
cube_map->enableTexture(cube_channel);
|
||||
cube_map->enableTextureCoords(1);
|
||||
diffuse_channel = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
|
||||
}
|
||||
else
|
||||
|
|
@ -410,9 +409,6 @@ void LLDrawPoolBump::bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& di
|
|||
gGL.getTexUnit(0)->disable();
|
||||
cube_map->enable(0);
|
||||
gGL.getTexUnit(0)->bind(cube_map);
|
||||
|
||||
gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_COLOR);
|
||||
gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_VERT_ALPHA);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -545,7 +541,6 @@ void LLDrawPoolBump::beginFullbrightShiny()
|
|||
gGL.getTexUnit(1)->disable();
|
||||
cube_channel = shader->enableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
|
||||
cube_map->enableTexture(cube_channel);
|
||||
cube_map->enableTextureCoords(1);
|
||||
diffuse_channel = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
|
||||
|
||||
gGL.getTexUnit(cube_channel)->bind(cube_map);
|
||||
|
|
@ -601,21 +596,9 @@ void LLDrawPoolBump::endFullbrightShiny()
|
|||
if( cube_map )
|
||||
{
|
||||
cube_map->disable();
|
||||
|
||||
/*if (diffuse_channel != 0)
|
||||
{
|
||||
shader->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
|
||||
}
|
||||
gGL.getTexUnit(0)->activate();
|
||||
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);*/
|
||||
|
||||
shader->unbind();
|
||||
//gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
}
|
||||
|
||||
//gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
//gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
|
||||
diffuse_channel = -1;
|
||||
cube_channel = 0;
|
||||
mShiny = FALSE;
|
||||
|
|
@ -762,23 +745,9 @@ void LLDrawPoolBump::renderBump(U32 pass)
|
|||
//static
|
||||
void LLDrawPoolBump::endBump(U32 pass)
|
||||
{
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gObjectBumpProgram.unbind();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Disable texture blending on unit 1
|
||||
gGL.getTexUnit(1)->activate();
|
||||
gGL.getTexUnit(1)->disable();
|
||||
gGL.getTexUnit(1)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
gObjectBumpProgram.unbind();
|
||||
|
||||
// Disable texture blending on unit 0
|
||||
gGL.getTexUnit(0)->activate();
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
}
|
||||
|
||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
}
|
||||
|
||||
S32 LLDrawPoolBump::getNumDeferredPasses()
|
||||
|
|
@ -1591,7 +1560,7 @@ void LLDrawPoolInvisible::render(S32 pass)
|
|||
{ //render invisiprims
|
||||
LL_RECORD_BLOCK_TIME(FTM_RENDER_INVISIBLE);
|
||||
|
||||
if (gPipeline.canUseVertexShaders())
|
||||
if (gPipeline.shadersLoaded())
|
||||
{
|
||||
gOcclusionProgram.bind();
|
||||
}
|
||||
|
|
@ -1603,7 +1572,7 @@ void LLDrawPoolInvisible::render(S32 pass)
|
|||
gGL.setColorMask(true, false);
|
||||
glStencilMask(0xFFFFFFFF);
|
||||
|
||||
if (gPipeline.canUseVertexShaders())
|
||||
if (gPipeline.shadersLoaded())
|
||||
{
|
||||
gOcclusionProgram.unbind();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -591,7 +591,7 @@ void LLDrawPoolGrass::beginRenderPass(S32 pass)
|
|||
}
|
||||
else
|
||||
{
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
|
||||
gGL.flush();
|
||||
LLGLSLShader::bindNoShader();
|
||||
}
|
||||
}
|
||||
|
|
@ -607,7 +607,7 @@ void LLDrawPoolGrass::endRenderPass(S32 pass)
|
|||
}
|
||||
else
|
||||
{
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
gGL.flush();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,16 +76,8 @@ void LLDrawPoolSky::render(S32 pass)
|
|||
}
|
||||
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{ //just use the UI shader (generic single texture no lighting)
|
||||
gOneTextureNoColorProgram.bind();
|
||||
}
|
||||
else
|
||||
{
|
||||
LLGLSLShader::bindNoShader();
|
||||
mShader = NULL;
|
||||
}
|
||||
|
||||
//just use the UI shader (generic single texture no lighting)
|
||||
gOneTextureNoColorProgram.bind();
|
||||
|
||||
LLGLSPipelineDepthTestSkyBox gls_skybox(true, false);
|
||||
|
||||
|
|
|
|||
|
|
@ -499,8 +499,6 @@ void LLDrawPoolTerrain::renderFull4TU()
|
|||
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
|
||||
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
|
||||
|
||||
gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_COLOR);
|
||||
|
||||
//
|
||||
// Stage 1: Generate alpha ramp for detail0/detail1 transition
|
||||
//
|
||||
|
|
@ -509,10 +507,6 @@ void LLDrawPoolTerrain::renderFull4TU()
|
|||
gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
|
||||
gGL.getTexUnit(1)->activate();
|
||||
|
||||
// Care about alpha only
|
||||
gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
|
||||
gGL.getTexUnit(1)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA);
|
||||
|
||||
//
|
||||
// Stage 2: Interpolate detail1 with existing based on ramp
|
||||
//
|
||||
|
|
@ -527,8 +521,6 @@ void LLDrawPoolTerrain::renderFull4TU()
|
|||
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
|
||||
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
|
||||
|
||||
gGL.getTexUnit(2)->setTextureColorBlend(LLTexUnit::TBO_LERP_PREV_ALPHA, LLTexUnit::TBS_PREV_COLOR, LLTexUnit::TBS_TEX_COLOR);
|
||||
|
||||
//
|
||||
// Stage 3: Modulate with primary (vertex) color for lighting
|
||||
//
|
||||
|
|
@ -536,9 +528,6 @@ void LLDrawPoolTerrain::renderFull4TU()
|
|||
gGL.getTexUnit(3)->enable(LLTexUnit::TT_TEXTURE);
|
||||
gGL.getTexUnit(3)->activate();
|
||||
|
||||
// Set alpha texture and do lighting modulation
|
||||
gGL.getTexUnit(3)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_PREV_COLOR, LLTexUnit::TBS_VERT_COLOR);
|
||||
|
||||
gGL.getTexUnit(0)->activate();
|
||||
|
||||
// GL_BLEND disabled by default
|
||||
|
|
@ -559,8 +548,6 @@ void LLDrawPoolTerrain::renderFull4TU()
|
|||
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
|
||||
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
|
||||
|
||||
gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_COLOR);
|
||||
|
||||
//
|
||||
// Stage 1: Generate alpha ramp for detail2/detail3 transition
|
||||
//
|
||||
|
|
@ -573,10 +560,6 @@ void LLDrawPoolTerrain::renderFull4TU()
|
|||
gGL.loadIdentity();
|
||||
gGL.translatef(-2.f, 0.f, 0.f);
|
||||
|
||||
// Care about alpha only
|
||||
gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
|
||||
gGL.getTexUnit(1)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA);
|
||||
|
||||
//
|
||||
// Stage 2: Interpolate detail2 with existing based on ramp
|
||||
//
|
||||
|
|
@ -591,8 +574,6 @@ void LLDrawPoolTerrain::renderFull4TU()
|
|||
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
|
||||
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
|
||||
|
||||
gGL.getTexUnit(2)->setTextureColorBlend(LLTexUnit::TBO_LERP_PREV_ALPHA, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_PREV_COLOR);
|
||||
|
||||
//
|
||||
// Stage 3: Generate alpha ramp for detail1/detail2 transition
|
||||
//
|
||||
|
|
@ -606,10 +587,6 @@ void LLDrawPoolTerrain::renderFull4TU()
|
|||
gGL.translatef(-1.f, 0.f, 0.f);
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
|
||||
// Set alpha texture and do lighting modulation
|
||||
gGL.getTexUnit(3)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_PREV_COLOR, LLTexUnit::TBS_VERT_COLOR);
|
||||
gGL.getTexUnit(3)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA);
|
||||
|
||||
gGL.getTexUnit(0)->activate();
|
||||
{
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
|
|
@ -659,8 +636,6 @@ void LLDrawPoolTerrain::renderFull4TU()
|
|||
gGL.matrixMode(LLRender::MM_TEXTURE);
|
||||
gGL.loadIdentity();
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
}
|
||||
|
||||
void LLDrawPoolTerrain::renderFull2TU()
|
||||
|
|
@ -705,8 +680,6 @@ void LLDrawPoolTerrain::renderFull2TU()
|
|||
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
|
||||
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
|
||||
|
||||
gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR);
|
||||
|
||||
drawLoop();
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
@ -720,11 +693,6 @@ void LLDrawPoolTerrain::renderFull2TU()
|
|||
glDisable(GL_TEXTURE_GEN_S);
|
||||
glDisable(GL_TEXTURE_GEN_T);
|
||||
|
||||
// Care about alpha only
|
||||
gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
|
||||
gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA);
|
||||
|
||||
|
||||
//
|
||||
// Stage 1: Write detail1
|
||||
//
|
||||
|
|
@ -739,9 +707,6 @@ void LLDrawPoolTerrain::renderFull2TU()
|
|||
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
|
||||
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
|
||||
|
||||
gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR);
|
||||
gGL.getTexUnit(1)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_ALPHA);
|
||||
|
||||
gGL.getTexUnit(0)->activate();
|
||||
{
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
|
|
@ -761,10 +726,6 @@ void LLDrawPoolTerrain::renderFull2TU()
|
|||
gGL.translatef(-1.f, 0.f, 0.f);
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
|
||||
// Care about alpha only
|
||||
gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
|
||||
gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA);
|
||||
|
||||
//
|
||||
// Stage 1: Write detail2
|
||||
//
|
||||
|
|
@ -779,9 +740,6 @@ void LLDrawPoolTerrain::renderFull2TU()
|
|||
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
|
||||
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
|
||||
|
||||
gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR);
|
||||
gGL.getTexUnit(1)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_ALPHA);
|
||||
|
||||
{
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
drawLoop();
|
||||
|
|
@ -801,10 +759,6 @@ void LLDrawPoolTerrain::renderFull2TU()
|
|||
gGL.translatef(-2.f, 0.f, 0.f);
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
|
||||
// Care about alpha only
|
||||
gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
|
||||
gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA);
|
||||
|
||||
// Stage 1: Write detail3
|
||||
gGL.getTexUnit(1)->bind(detail_texture3p);
|
||||
gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
|
||||
|
|
@ -817,9 +771,6 @@ void LLDrawPoolTerrain::renderFull2TU()
|
|||
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
|
||||
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
|
||||
|
||||
gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR);
|
||||
gGL.getTexUnit(1)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_ALPHA);
|
||||
|
||||
gGL.getTexUnit(0)->activate();
|
||||
{
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
|
|
@ -852,7 +803,6 @@ void LLDrawPoolTerrain::renderFull2TU()
|
|||
gGL.matrixMode(LLRender::MM_TEXTURE);
|
||||
gGL.loadIdentity();
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -875,22 +825,8 @@ void LLDrawPoolTerrain::renderSimple()
|
|||
tp0.setVec(tscale, 0.f, 0.0f, -1.f*(origin_agent.mV[0]/256.f));
|
||||
tp1.setVec(0.f, tscale, 0.0f, -1.f*(origin_agent.mV[1]/256.f));
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
sShader->uniform4fv(LLShaderMgr::OBJECT_PLANE_S, 1, tp0.mV);
|
||||
sShader->uniform4fv(LLShaderMgr::OBJECT_PLANE_T, 1, tp1.mV);
|
||||
}
|
||||
else
|
||||
{
|
||||
glEnable(GL_TEXTURE_GEN_S);
|
||||
glEnable(GL_TEXTURE_GEN_T);
|
||||
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
|
||||
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
|
||||
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
|
||||
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
|
||||
}
|
||||
|
||||
gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR);
|
||||
sShader->uniform4fv(LLShaderMgr::OBJECT_PLANE_S, 1, tp0.mV);
|
||||
sShader->uniform4fv(LLShaderMgr::OBJECT_PLANE_T, 1, tp1.mV);
|
||||
|
||||
drawLoop();
|
||||
|
||||
|
|
@ -899,15 +835,9 @@ void LLDrawPoolTerrain::renderSimple()
|
|||
|
||||
gGL.getTexUnit(0)->activate();
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glDisable(GL_TEXTURE_GEN_S);
|
||||
glDisable(GL_TEXTURE_GEN_T);
|
||||
}
|
||||
gGL.matrixMode(LLRender::MM_TEXTURE);
|
||||
gGL.loadIdentity();
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ void LLDrawPoolTree::beginRenderPass(S32 pass)
|
|||
shader = &gTreeProgram;
|
||||
}
|
||||
|
||||
if (gPipeline.canUseVertexShaders())
|
||||
if (gPipeline.shadersLoaded())
|
||||
{
|
||||
shader->bind();
|
||||
shader->setMinimumAlpha(0.5f);
|
||||
|
|
@ -77,7 +77,7 @@ void LLDrawPoolTree::beginRenderPass(S32 pass)
|
|||
else
|
||||
{
|
||||
gPipeline.enableLightsDynamic();
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
|
||||
gGL.flush();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ void LLDrawPoolTree::render(S32 pass)
|
|||
return;
|
||||
}
|
||||
|
||||
LLGLState test(GL_ALPHA_TEST, LLGLSLShader::sNoFixedFunction ? 0 : 1);
|
||||
LLGLState test(GL_ALPHA_TEST, 0);
|
||||
|
||||
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
|
||||
if( (LLPipeline::sRenderTextures) )
|
||||
|
|
@ -140,7 +140,7 @@ void LLDrawPoolTree::endRenderPass(S32 pass)
|
|||
|
||||
if (mShaderLevel <= 0)
|
||||
{
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
gGL.flush();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -243,9 +243,6 @@ void LLDrawPoolWater::render(S32 pass)
|
|||
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0);
|
||||
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1);
|
||||
|
||||
gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_PREV_COLOR);
|
||||
gGL.getTexUnit(1)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_ALPHA);
|
||||
|
||||
gGL.getTexUnit(0)->activate();
|
||||
|
||||
glClearStencil(1);
|
||||
|
|
@ -303,8 +300,6 @@ void LLDrawPoolWater::render(S32 pass)
|
|||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
LLOverrideFaceColor overrid(this, 1.f, 1.f, 1.f, 0.5f*up_dot);
|
||||
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
|
||||
for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
|
||||
iter != mDrawFace.end(); iter++)
|
||||
{
|
||||
|
|
@ -321,8 +316,6 @@ void LLDrawPoolWater::render(S32 pass)
|
|||
}
|
||||
}
|
||||
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
|
||||
gSky.mVOSkyp->getCubeMap()->disable();
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
|
@ -340,8 +333,6 @@ void LLDrawPoolWater::render(S32 pass)
|
|||
glStencilFunc(GL_NOTEQUAL, 0, 0xFFFFFFFF);
|
||||
renderReflection(refl_face);
|
||||
}
|
||||
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
}
|
||||
|
||||
// for low end hardware
|
||||
|
|
@ -356,19 +347,16 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
|
|||
}
|
||||
|
||||
LLGLSLShader* shader = NULL;
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
if (LLPipeline::sUnderWaterRender)
|
||||
{
|
||||
if (LLPipeline::sUnderWaterRender)
|
||||
{
|
||||
shader = &gObjectSimpleNonIndexedTexGenWaterProgram;
|
||||
}
|
||||
else
|
||||
{
|
||||
shader = &gObjectSimpleNonIndexedTexGenProgram;
|
||||
}
|
||||
|
||||
shader->bind();
|
||||
shader = &gObjectSimpleNonIndexedTexGenWaterProgram;
|
||||
}
|
||||
else
|
||||
{
|
||||
shader = &gObjectSimpleNonIndexedTexGenProgram;
|
||||
}
|
||||
|
||||
shader->bind();
|
||||
|
||||
stop_glerror();
|
||||
|
||||
|
|
@ -454,7 +442,6 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
|
|||
}
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -266,33 +266,14 @@ void LLDrawPoolWLSky::renderStars(const LLVector3& camPosLocal) const
|
|||
gGL.pushMatrix();
|
||||
gGL.translatef(camPosLocal.mV[0], camPosLocal.mV[1], camPosLocal.mV[2]);
|
||||
gGL.rotatef(gFrameTimeSeconds*0.01f, 0.f, 0.f, 1.f);
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gCustomAlphaProgram.bind();
|
||||
gCustomAlphaProgram.uniform1f(sCustomAlpha, star_alpha.mV[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR);
|
||||
gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT_X2, LLTexUnit::TBS_CONST_ALPHA, LLTexUnit::TBS_TEX_ALPHA);
|
||||
glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, star_alpha.mV);
|
||||
}
|
||||
gCustomAlphaProgram.bind();
|
||||
gCustomAlphaProgram.uniform1f(sCustomAlpha, star_alpha.mV[3]);
|
||||
|
||||
gSky.mVOWLSkyp->drawStars();
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
||||
gGL.popMatrix();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gCustomAlphaProgram.unbind();
|
||||
}
|
||||
else
|
||||
{
|
||||
// and disable the combiner states
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
}
|
||||
gCustomAlphaProgram.unbind();
|
||||
}
|
||||
|
||||
void LLDrawPoolWLSky::renderStarsDeferred(const LLVector3& camPosLocal) const
|
||||
|
|
@ -479,7 +460,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
|
|||
LLFace * face = gSky.mVOSkyp->mFace[LLVOSky::FACE_SUN];
|
||||
|
||||
F32 blend_factor = LLEnvironment::instance().getCurrentSky()->getBlendFactor();
|
||||
bool can_use_vertex_shaders = gPipeline.canUseVertexShaders();
|
||||
bool can_use_vertex_shaders = gPipeline.shadersLoaded();
|
||||
bool can_use_windlight_shaders = gPipeline.canUseWindLightShaders();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -604,26 +604,18 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
|
|||
gGL.multMatrix((F32*) volume->getRelativeXform().mMatrix);
|
||||
const LLVolumeFace& vol_face = rigged->getVolumeFace(getTEOffset());
|
||||
// <FS:Ansariel> Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES, vol_face.mPositions, vol_face.mTexCoords, vol_face.mNumIndices, vol_face.mIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
// </FS:Ansariel>
|
||||
LLVertexBuffer::unbind();
|
||||
glVertexPointer(3, GL_FLOAT, 16, vol_face.mPositions);
|
||||
if (vol_face.mTexCoords)
|
||||
{
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, 8, vol_face.mTexCoords);
|
||||
}
|
||||
gGL.syncMatrices();
|
||||
LL_PROFILER_GPU_ZONEC( "gl.DrawElements", 0x00FF00 );
|
||||
glDrawElements(GL_TRIANGLES, vol_face.mNumIndices, GL_UNSIGNED_SHORT, vol_face.mIndices);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
// <FS:Ansariel> Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr
|
||||
}
|
||||
//LLVertexBuffer::unbind();
|
||||
//glVertexPointer(3, GL_FLOAT, 16, vol_face.mPositions);
|
||||
//if (vol_face.mTexCoords)
|
||||
//{
|
||||
// glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
// glTexCoordPointer(2, GL_FLOAT, 8, vol_face.mTexCoords);
|
||||
//}
|
||||
//gGL.syncMatrices();
|
||||
//LL_PROFILER_GPU_ZONEC("gl.DrawElements", 0x00FF00);
|
||||
//glDrawElements(GL_TRIANGLES, vol_face.mNumIndices, GL_UNSIGNED_SHORT, vol_face.mIndices);
|
||||
//glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES, vol_face.mPositions, vol_face.mTexCoords, vol_face.mNumIndices, vol_face.mIndices);
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
}
|
||||
|
|
@ -687,10 +679,6 @@ void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wirefram
|
|||
}
|
||||
else
|
||||
{
|
||||
// <FS:Ansariel> Don't use fixed functions when using shader renderer; found by Drake Arconis
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
// </FS:Ansariel>
|
||||
LLGLEnable fog(GL_FOG);
|
||||
glFogi(GL_FOG_MODE, GL_LINEAR);
|
||||
float d = (LLViewerCamera::getInstance()->getPointOfInterest() - LLViewerCamera::getInstance()->getOrigin()).magVec();
|
||||
|
|
@ -698,11 +686,8 @@ void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wirefram
|
|||
glFogf(GL_FOG_START, d);
|
||||
glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV())));
|
||||
glFogfv(GL_FOG_COLOR, fogCol.mV);
|
||||
// <FS:Ansariel> Don't use fixed functions when using shader renderer; found by Drake Arconis
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
gGL.flush();
|
||||
{
|
||||
gGL.diffuseColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f);
|
||||
renderFace(mDrawablep, this);
|
||||
|
|
|
|||
|
|
@ -1530,10 +1530,7 @@ BOOL LLPreviewAnimation::render()
|
|||
gGL.pushMatrix();
|
||||
gGL.loadIdentity();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
|
||||
LLGLSUIDefault def;
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
|
|
|||
|
|
@ -731,10 +731,7 @@ BOOL LLImagePreviewAvatar::render()
|
|||
LLGLSUIDefault def;
|
||||
gGL.color4f(0.15f, 0.2f, 0.3f, 1.f);
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
|
||||
gl_rect_2d_simple( mFullWidth, mFullHeight );
|
||||
|
||||
|
|
@ -933,10 +930,7 @@ BOOL LLImagePreviewSculpted::render()
|
|||
|
||||
gGL.color4f(0.15f, 0.2f, 0.3f, 1.f);
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
|
||||
gl_rect_2d_simple( mFullWidth, mFullHeight );
|
||||
|
||||
|
|
@ -970,10 +964,7 @@ BOOL LLImagePreviewSculpted::render()
|
|||
|
||||
gPipeline.enableLightsAvatar();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gObjectPreviewProgram.bind();
|
||||
}
|
||||
gObjectPreviewProgram.bind();
|
||||
gPipeline.enableLightsPreview();
|
||||
|
||||
gGL.pushMatrix();
|
||||
|
|
@ -987,10 +978,7 @@ BOOL LLImagePreviewSculpted::render()
|
|||
|
||||
gGL.popMatrix();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gObjectPreviewProgram.unbind();
|
||||
}
|
||||
gObjectPreviewProgram.unbind();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2098,7 +2098,6 @@ void LLFloaterPreference::refreshEnabledState()
|
|||
// bumpshiny &&
|
||||
// shaders &&
|
||||
// gGLManager.mHasFramebufferObject &&
|
||||
// gSavedSettings.getBOOL("RenderAvatarVP") &&
|
||||
// (ctrl_wind_light->get()) ? TRUE : FALSE;
|
||||
|
||||
//ctrl_deferred->setEnabled(enabled);
|
||||
|
|
@ -2185,29 +2184,9 @@ void LLFloaterPreference::refreshEnabledState()
|
|||
// </FS:Ansariel>
|
||||
|
||||
// Avatar Mode
|
||||
// Enable Avatar Shaders
|
||||
LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram");
|
||||
// Avatar Render Mode
|
||||
LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth");
|
||||
|
||||
bool avatar_vp_enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP");
|
||||
if (LLViewerShaderMgr::sInitialized)
|
||||
{
|
||||
S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel;
|
||||
avatar_vp_enabled = (max_avatar_shader > 0) ? TRUE : FALSE;
|
||||
}
|
||||
getChild<LLCheckBoxCtrl>("AvatarCloth")->setEnabled(TRUE);
|
||||
|
||||
ctrl_avatar_vp->setEnabled(avatar_vp_enabled);
|
||||
|
||||
if (gSavedSettings.getBOOL("RenderAvatarVP") == FALSE)
|
||||
{
|
||||
ctrl_avatar_cloth->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ctrl_avatar_cloth->setEnabled(true);
|
||||
}
|
||||
|
||||
/* <FS:LO> remove orphaned code left over from EEP
|
||||
// Vertex Shaders, Global Shader Enable
|
||||
LLRadioGroup* terrain_detail = getChild<LLRadioGroup>("TerrainDetailRadio"); // can be linked with control var
|
||||
|
|
@ -2233,7 +2212,6 @@ void LLFloaterPreference::refreshEnabledState()
|
|||
BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
|
||||
((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? TRUE : FALSE) &&
|
||||
gGLManager.mHasFramebufferObject &&
|
||||
gSavedSettings.getBOOL("RenderAvatarVP") &&
|
||||
(ctrl_wind_light->get()) ? TRUE : FALSE;
|
||||
|
||||
ctrl_deferred->setEnabled(enabled);
|
||||
|
|
@ -2341,7 +2319,6 @@ void LLAvatarComplexityControls::setIndirectMaxArc()
|
|||
void LLFloaterPreference::disableUnavailableSettings()
|
||||
{
|
||||
LLComboBox* ctrl_reflections = getChild<LLComboBox>("Reflections");
|
||||
LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram");
|
||||
LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth");
|
||||
LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
|
||||
LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
|
||||
|
|
@ -2410,29 +2387,6 @@ void LLFloaterPreference::disableUnavailableSettings()
|
|||
ctrl_reflections->setValue(FALSE);
|
||||
}
|
||||
|
||||
// disabled av
|
||||
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP"))
|
||||
{
|
||||
ctrl_avatar_vp->setEnabled(FALSE);
|
||||
ctrl_avatar_vp->setValue(FALSE);
|
||||
|
||||
ctrl_avatar_cloth->setEnabled(FALSE);
|
||||
ctrl_avatar_cloth->setValue(FALSE);
|
||||
|
||||
//deferred needs AvatarVP, disable deferred
|
||||
ctrl_shadows->setEnabled(FALSE);
|
||||
ctrl_shadows->setValue(0);
|
||||
|
||||
ctrl_ssao->setEnabled(FALSE);
|
||||
ctrl_ssao->setValue(FALSE);
|
||||
|
||||
ctrl_dof->setEnabled(FALSE);
|
||||
ctrl_dof->setValue(FALSE);
|
||||
|
||||
ctrl_deferred->setEnabled(FALSE);
|
||||
ctrl_deferred->setValue(FALSE);
|
||||
}
|
||||
|
||||
// disabled cloth
|
||||
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarCloth"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -935,10 +935,7 @@ void LLViewerObjectList::renderObjectBeacons()
|
|||
|
||||
LLGLSUIDefault gls_ui;
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
|
||||
{
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
|
@ -1032,10 +1029,7 @@ void LLViewerObjectList::renderObjectBeacons()
|
|||
void LLSky::renderSunMoonBeacons(const LLVector3& pos_agent, const LLVector3& direction, LLColor4 color)
|
||||
{
|
||||
LLGLSUIDefault gls_ui;
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
||||
LLVector3 pos_end;
|
||||
|
|
|
|||
|
|
@ -333,8 +333,6 @@ void LLHUDNameTag::renderText(BOOL for_select)
|
|||
|
||||
// Render label
|
||||
{
|
||||
//gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
|
||||
for(std::vector<LLHUDTextSegment>::iterator segment_iter = mLabelSegments.begin();
|
||||
segment_iter != mLabelSegments.end(); ++segment_iter )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -204,9 +204,6 @@ void LLHUDText::renderText()
|
|||
F32 y_offset = (F32)mOffsetY;
|
||||
|
||||
// Render label
|
||||
{
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
}
|
||||
|
||||
// Render text
|
||||
{
|
||||
|
|
@ -614,7 +611,6 @@ void LLHUDText::renderAllHUD()
|
|||
{
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
LLGLState::checkClientArrays();
|
||||
|
||||
{
|
||||
LLGLEnable color_mat(GL_COLOR_MATERIAL);
|
||||
|
|
@ -632,7 +628,6 @@ void LLHUDText::renderAllHUD()
|
|||
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
LLGLState::checkClientArrays();
|
||||
}
|
||||
|
||||
void LLHUDText::shiftAll(const LLVector3& offset)
|
||||
|
|
|
|||
|
|
@ -383,12 +383,6 @@ void LLAtmospherics::updateFog(const F32 distance, const LLVector3& tosun_in)
|
|||
|
||||
if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOG))
|
||||
{
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glFogf(GL_FOG_DENSITY, 0);
|
||||
glFogfv(GL_FOG_COLOR, (F32 *) &LLColor4::white.mV);
|
||||
glFogf(GL_FOG_END, 1000000.f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -484,10 +478,6 @@ void LLAtmospherics::updateFog(const F32 distance, const LLVector3& tosun_in)
|
|||
if (camera_height > water_height)
|
||||
{
|
||||
LLColor4 fog(render_fog_color);
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glFogfv(GL_FOG_COLOR, fog.mV);
|
||||
}
|
||||
mGLFogCol = fog;
|
||||
|
||||
if (hide_clip_plane)
|
||||
|
|
@ -495,19 +485,11 @@ void LLAtmospherics::updateFog(const F32 distance, const LLVector3& tosun_in)
|
|||
// For now, set the density to extend to the cull distance.
|
||||
const F32 f_log = 2.14596602628934723963618357029f; // sqrt(fabs(log(0.01f)))
|
||||
fog_density = f_log/fog_distance;
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glFogi(GL_FOG_MODE, GL_EXP2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const F32 f_log = 4.6051701859880913680359829093687f; // fabs(log(0.01f))
|
||||
fog_density = (f_log)/fog_distance;
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glFogi(GL_FOG_MODE, GL_EXP);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -533,12 +515,6 @@ void LLAtmospherics::updateFog(const F32 distance, const LLVector3& tosun_in)
|
|||
|
||||
// set the density based on what the shaders use
|
||||
fog_density = water_fog_density * gSavedSettings.getF32("WaterGLFogDensityScale");
|
||||
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glFogfv(GL_FOG_COLOR, (F32 *) &fogCol.mV);
|
||||
glFogi(GL_FOG_MODE, GL_EXP2);
|
||||
}
|
||||
}
|
||||
|
||||
mFogColor = sky_fog_color;
|
||||
|
|
@ -546,13 +522,6 @@ void LLAtmospherics::updateFog(const F32 distance, const LLVector3& tosun_in)
|
|||
|
||||
LLDrawPoolWater::sWaterFogEnd = fog_distance*2.2f;
|
||||
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
LLGLSFog gls_fog;
|
||||
glFogf(GL_FOG_END, fog_distance*2.2f);
|
||||
glFogf(GL_FOG_DENSITY, fog_density);
|
||||
glHint(GL_FOG_HINT, GL_NICEST);
|
||||
}
|
||||
stop_glerror();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -157,10 +157,7 @@ void LLManipRotate::render()
|
|||
}
|
||||
else
|
||||
{
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gDebugProgram.bind();
|
||||
}
|
||||
gDebugProgram.bind();
|
||||
|
||||
LLGLEnable cull_face(GL_CULL_FACE);
|
||||
LLGLDepthTest gls_depth(GL_FALSE);
|
||||
|
|
@ -213,10 +210,7 @@ void LLManipRotate::render()
|
|||
}
|
||||
gGL.popMatrix();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
}
|
||||
|
||||
gGL.translatef( center.mV[VX], center.mV[VY], center.mV[VZ] );
|
||||
|
|
@ -234,10 +228,7 @@ void LLManipRotate::render()
|
|||
gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z);
|
||||
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gDebugProgram.bind();
|
||||
}
|
||||
gDebugProgram.bind();
|
||||
|
||||
if (mManipPart == LL_ROT_Z)
|
||||
{
|
||||
|
|
@ -355,11 +346,7 @@ void LLManipRotate::render()
|
|||
|
||||
}
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gGL.popMatrix();
|
||||
gGL.popMatrix();
|
||||
|
|
|
|||
|
|
@ -1592,11 +1592,6 @@ void LLManipTranslate::renderSnapGuides()
|
|||
LLGLEnable stipple(GL_LINE_STIPPLE);
|
||||
gGL.flush();
|
||||
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glLineStipple(1, 0x3333);
|
||||
}
|
||||
|
||||
switch (mManipPart)
|
||||
{
|
||||
case LL_YZ_PLANE:
|
||||
|
|
@ -1660,7 +1655,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
|
|||
LLQuaternion grid_rotation,
|
||||
LLColor4 inner_color)
|
||||
{
|
||||
if (!gSavedSettings.getBOOL("GridCrossSections") || !LLGLSLShader::sNoFixedFunction)
|
||||
if (!gSavedSettings.getBOOL("GridCrossSections"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3225,8 +3225,6 @@ BOOL LLModelPreview::render()
|
|||
LLMutexLock lock(this);
|
||||
mNeedsUpdate = FALSE;
|
||||
|
||||
bool use_shaders = LLGLSLShader::sNoFixedFunction;
|
||||
|
||||
bool edges = mViewOption["show_edges"];
|
||||
bool joint_overrides = mViewOption["show_joint_overrides"];
|
||||
bool joint_positions = mViewOption["show_joint_positions"];
|
||||
|
|
@ -3263,10 +3261,8 @@ BOOL LLModelPreview::render()
|
|||
LLGLDisable fog(GL_FOG);
|
||||
|
||||
{
|
||||
if (use_shaders)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
|
||||
//clear background to grey
|
||||
gGL.matrixMode(LLRender::MM_PROJECTION);
|
||||
gGL.pushMatrix();
|
||||
|
|
@ -3285,10 +3281,7 @@ BOOL LLModelPreview::render()
|
|||
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
gGL.popMatrix();
|
||||
if (use_shaders)
|
||||
{
|
||||
gUIProgram.unbind();
|
||||
}
|
||||
gUIProgram.unbind();
|
||||
}
|
||||
|
||||
LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance;
|
||||
|
|
@ -3469,10 +3462,7 @@ BOOL LLModelPreview::render()
|
|||
refresh();
|
||||
}
|
||||
|
||||
if (use_shaders)
|
||||
{
|
||||
gObjectPreviewProgram.bind();
|
||||
}
|
||||
gObjectPreviewProgram.bind();
|
||||
|
||||
gGL.loadIdentity();
|
||||
gPipeline.enableLightsPreview();
|
||||
|
|
@ -4024,10 +4014,7 @@ BOOL LLModelPreview::render()
|
|||
}
|
||||
}
|
||||
|
||||
if (use_shaders)
|
||||
{
|
||||
gObjectPreviewProgram.unbind();
|
||||
}
|
||||
gObjectPreviewProgram.unbind();
|
||||
|
||||
gGL.popMatrix();
|
||||
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ void LLNetMap::draw()
|
|||
// </FS:Ansariel>
|
||||
|
||||
// Draw water
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, ABOVE_WATERLINE_ALPHA / 255.f);
|
||||
gGL.flush();
|
||||
{
|
||||
if (regionp->getLand().getWaterTexture())
|
||||
{
|
||||
|
|
@ -538,10 +538,10 @@ void LLNetMap::draw()
|
|||
// </FS:Ansariel>
|
||||
}
|
||||
}
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
gGL.flush();
|
||||
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-07-26 (Catznip-3.3)
|
||||
}
|
||||
// [/SL:KB]
|
||||
gGL.flush();
|
||||
}
|
||||
|
||||
// Redraw object layer periodically
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ void LLSceneMonitor::capture()
|
|||
static LLCachedControl<F32> scene_load_sample_time(gSavedSettings, "SceneLoadingMonitorSampleTime");
|
||||
static bool force_capture = true;
|
||||
|
||||
bool enabled = LLGLSLShader::sNoFixedFunction && (monitor_enabled || mDebugViewerVisible);
|
||||
bool enabled = monitor_enabled || mDebugViewerVisible;
|
||||
if(mEnabled != enabled)
|
||||
{
|
||||
if(mEnabled)
|
||||
|
|
@ -724,13 +724,6 @@ void LLSceneMonitorView::onTeleportFinished()
|
|||
|
||||
void LLSceneMonitorView::onVisibilityChange(BOOL visible)
|
||||
{
|
||||
if (!LLGLSLShader::sNoFixedFunction && visible)
|
||||
{
|
||||
visible = false;
|
||||
// keep Scene monitor and its view in sycn
|
||||
setVisible(false);
|
||||
LL_WARNS("SceneMonitor") << "Incompatible graphical settings, Scene Monitor can't be turned on" << LL_ENDL;
|
||||
}
|
||||
LLSceneMonitor::getInstance()->setDebugViewerVisible(visible);
|
||||
|
||||
// <FS:Ansariel> FIRE-14144 / MAINT-4256 / BUG-6664: Crash when opening stats after closing via X
|
||||
|
|
|
|||
|
|
@ -6094,8 +6094,6 @@ void LLSelectMgr::updateSilhouettes()
|
|||
LLViewerObject* objectp = *iter;
|
||||
objectp->clearChanged(LLXform::MOVED | LLXform::SILHOUETTE);
|
||||
}
|
||||
|
||||
//gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
}
|
||||
|
||||
void LLSelectMgr::updateSelectionSilhouette(LLObjectSelectionHandle object_handle, S32& num_sils_genned, std::vector<LLViewerObject*>& changed_objects)
|
||||
|
|
@ -6801,7 +6799,6 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
|
|||
{
|
||||
// <FS:Ansariel> Performance improvement
|
||||
LLViewerCamera& camera = LLViewerCamera::instance();
|
||||
LLSelectMgr& selectmgr = LLSelectMgr::instance();
|
||||
|
||||
F32 silhouette_thickness;
|
||||
if (isAgentAvatarValid() && is_hud_object)
|
||||
|
|
@ -6824,22 +6821,17 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
|
|||
gGL.flush();
|
||||
gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE);
|
||||
// <FS:Ansariel> Don't use fixed functions when using shader renderer; found by Drake Arconis
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
// </FS:Ansariel>
|
||||
LLGLEnable fog(GL_FOG);
|
||||
glFogi(GL_FOG_MODE, GL_LINEAR);
|
||||
float d = (camera.getPointOfInterest()-camera.getOrigin()).magVec();
|
||||
LLColor4 fogCol = color * (F32)llclamp((selectmgr.getSelectionCenterGlobal()-gAgentCamera.getCameraPositionGlobal()).magVec()/(selectmgr.getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0);
|
||||
glFogf(GL_FOG_START, d);
|
||||
glFogf(GL_FOG_END, d*(1 + (camera.getView() / camera.getDefaultFOV())));
|
||||
glFogfv(GL_FOG_COLOR, fogCol.mV);
|
||||
// <FS:Ansariel> Don't use fixed functions when using shader renderer; found by Drake Arconis
|
||||
}
|
||||
//LLGLEnable fog(GL_FOG);
|
||||
//glFogi(GL_FOG_MODE, GL_LINEAR);
|
||||
//float d = (camera.getPointOfInterest()-camera.getOrigin()).magVec();
|
||||
//LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal() - gAgentCamera.getCameraPositionGlobal()).magVec() / (LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec() * 4), 0.0, 1.0);
|
||||
//glFogf(GL_FOG_START, d);
|
||||
//glFogf(GL_FOG_END, d*(1 + (camera.getView() / camera.getDefaultFOV())));
|
||||
//glFogfv(GL_FOG_COLOR, fogCol.mV);
|
||||
// </FS:Ansariel>
|
||||
|
||||
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL);
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
gGL.flush();
|
||||
gGL.begin(LLRender::LINES);
|
||||
{
|
||||
gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f);
|
||||
|
|
|
|||
|
|
@ -2662,7 +2662,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
|
|||
gGL.diffuseColor4fv(line_color.mV);
|
||||
LLVertexBuffer::unbind();
|
||||
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0);
|
||||
llassert(LLGLSLShader::sCurBoundShader != 0);
|
||||
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
|
||||
|
||||
|
|
@ -2744,38 +2744,30 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
|
|||
if (phys_volume->mHullPoints && phys_volume->mHullIndices)
|
||||
{
|
||||
// <FS:Ansariel> Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gGL.diffuseColor4fv(line_color.mV);
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES,phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
|
||||
//glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
//llassert(LLGLSLShader::sCurBoundShader != 0);
|
||||
//LLVertexBuffer::unbind();
|
||||
//glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints);
|
||||
//gGL.diffuseColor4fv(line_color.mV);
|
||||
//gGL.syncMatrices();
|
||||
//{
|
||||
// LL_PROFILER_GPU_ZONEC("gl.DrawElements", 0x20FF20)
|
||||
// glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
|
||||
//}
|
||||
|
||||
gGL.diffuseColor4fv(color.mV);
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
// </FS:Ansariel>
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0);
|
||||
LLVertexBuffer::unbind();
|
||||
glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints);
|
||||
gGL.diffuseColor4fv(line_color.mV);
|
||||
gGL.syncMatrices();
|
||||
{
|
||||
LL_PROFILER_GPU_ZONEC( "gl.DrawElements", 0x20FF20 )
|
||||
glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
|
||||
}
|
||||
|
||||
gGL.diffuseColor4fv(color.mV);
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
{
|
||||
LL_PROFILER_GPU_ZONEC( "gl.DrawElements", 0x40FF40 )
|
||||
glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
|
||||
// <FS:Ansariel> Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr
|
||||
}
|
||||
}
|
||||
//gGL.diffuseColor4fv(color.mV);
|
||||
//glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
//{
|
||||
// LL_PROFILER_GPU_ZONEC("gl.DrawElements", 0x40FF40)
|
||||
// glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
|
||||
//}
|
||||
gGL.diffuseColor4fv(line_color.mV);
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES,phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
|
||||
|
||||
gGL.diffuseColor4fv(color.mV);
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
else
|
||||
|
|
@ -3307,22 +3299,14 @@ void renderRaycast(LLDrawable* drawablep)
|
|||
{
|
||||
//render face positions
|
||||
// <FS:Ansariel> Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gGL.diffuseColor4f(0.f, 1.f, 1.f, 0.5f);
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, NULL, face.mNumIndices, face.mIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
// </FS:Ansariel>
|
||||
LLVertexBuffer::unbind();
|
||||
gGL.diffuseColor4f(0,1,1,0.5f);
|
||||
glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions);
|
||||
gGL.syncMatrices();
|
||||
LL_PROFILER_GPU_ZONEC( "gl.DrawElements", 0x60FF60 );
|
||||
glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices);
|
||||
// <FS:Ansariel> Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr
|
||||
}
|
||||
//LLVertexBuffer::unbind();
|
||||
//gGL.diffuseColor4f(0, 1, 1, 0.5f);
|
||||
//glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions);
|
||||
//gGL.syncMatrices();
|
||||
//LL_PROFILER_GPU_ZONEC("gl.DrawElements", 0x60FF60);
|
||||
//glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices);
|
||||
gGL.diffuseColor4f(0.f, 1.f, 1.f, 0.5f);
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, NULL, face.mNumIndices, face.mIndices);
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
|
|
@ -3875,10 +3859,7 @@ void LLSpatialPartition::renderDebug()
|
|||
return;
|
||||
}
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gDebugProgram.bind();
|
||||
}
|
||||
gDebugProgram.bind();
|
||||
|
||||
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
|
||||
{
|
||||
|
|
@ -3927,10 +3908,7 @@ void LLSpatialPartition::renderDebug()
|
|||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
}
|
||||
}
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gDebugProgram.unbind();
|
||||
}
|
||||
gDebugProgram.unbind();
|
||||
}
|
||||
|
||||
void LLSpatialGroup::drawObjectBox(LLColor4 col)
|
||||
|
|
|
|||
|
|
@ -304,7 +304,6 @@ const F32 STATE_AGENT_WAIT_TIMEOUT = 240; //seconds
|
|||
std::unique_ptr<LLEventPump> LLStartUp::sStateWatcher(new LLEventStream("StartupState"));
|
||||
std::unique_ptr<LLStartupListener> LLStartUp::sListener(new LLStartupListener());
|
||||
std::unique_ptr<LLViewerStats::PhaseMap> LLStartUp::sPhases(new LLViewerStats::PhaseMap);
|
||||
std::unique_ptr<LL::ThreadPool> gGeneralThreadPool;
|
||||
|
||||
//
|
||||
// local function declaration
|
||||
|
|
@ -2213,15 +2212,19 @@ bool idle_startup()
|
|||
display_startup();
|
||||
|
||||
// start up the ThreadPool we'll use for textures et al.
|
||||
LLSD poolSizes{ gSavedSettings.getLLSD("ThreadPoolSizes") };
|
||||
LLSD sizeSpec{ poolSizes["General"] };
|
||||
LLSD::Integer poolSize{ sizeSpec.isInteger()? sizeSpec.asInteger() : 3 };
|
||||
LL_DEBUGS("ThreadPool") << "Instantiating General pool with "
|
||||
<< poolSize << " threads" << LL_ENDL;
|
||||
// We don't want anyone, especially the main thread, to have to block
|
||||
// due to this ThreadPool being full.
|
||||
gGeneralThreadPool.reset(new LL::ThreadPool("General", poolSize, 1024*1024));
|
||||
gGeneralThreadPool->start();
|
||||
{
|
||||
LLSD poolSizes{ gSavedSettings.getLLSD("ThreadPoolSizes") };
|
||||
LLSD sizeSpec{ poolSizes["General"] };
|
||||
LLSD::Integer poolSize{ sizeSpec.isInteger()? sizeSpec.asInteger() : 3 };
|
||||
LL_DEBUGS("ThreadPool") << "Instantiating General pool with "
|
||||
<< poolSize << " threads" << LL_ENDL;
|
||||
// We don't want anyone, especially the main thread, to have to block
|
||||
// due to this ThreadPool being full.
|
||||
auto pool = new LL::ThreadPool("General", poolSize, 1024*1024);
|
||||
pool->start();
|
||||
// Once we start shutting down, destroy this ThreadPool.
|
||||
LLAppViewer::instance()->onCleanup([pool](){ delete pool; });
|
||||
}
|
||||
|
||||
// Initialize global class data needed for surfaces (i.e. textures)
|
||||
LL_DEBUGS("AppInit") << "Initializing sky..." << LL_ENDL;
|
||||
|
|
|
|||
|
|
@ -199,10 +199,7 @@ BOOL LLVisualParamHint::render()
|
|||
gGL.pushMatrix();
|
||||
gGL.loadIdentity();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
|
||||
LLGLSUIDefault gls_ui;
|
||||
//LLGLState::verify(TRUE);
|
||||
|
|
@ -251,11 +248,11 @@ BOOL LLVisualParamHint::render()
|
|||
{
|
||||
LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)gAgentAvatarp->mDrawable->getFace(0)->getPool();
|
||||
LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE);
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_ALWAYS);
|
||||
gGL.flush();
|
||||
gGL.setSceneBlendType(LLRender::BT_REPLACE);
|
||||
avatarPoolp->renderAvatars(gAgentAvatarp); // renders only one avatar
|
||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
gGL.flush();
|
||||
}
|
||||
gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight);
|
||||
// <FS:Ansariel> [Legacy Bake]
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ static bool handleJoystickChanged(const LLSD& newvalue)
|
|||
|
||||
static bool handleUseOcclusionChanged(const LLSD& newvalue)
|
||||
{
|
||||
LLPipeline::sUseOcclusion = (newvalue.asBoolean() && gGLManager.mHasOcclusionQuery && LLGLSLShader::sNoFixedFunction
|
||||
LLPipeline::sUseOcclusion = (newvalue.asBoolean() && gGLManager.mHasOcclusionQuery
|
||||
&& LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion") && !gUseWireframe) ? 2 : 0;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1132,7 +1132,6 @@ void settings_setup_listeners()
|
|||
gSavedSettings.getControl("OctreeAttachmentSizeFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
gSavedSettings.getControl("RenderMaxTextureIndex")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("RenderUseTriStrips")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
|
||||
gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("RenderUIBuffer")->getSignal()->connect(boost::bind(&handleWindowResized, _2));
|
||||
gSavedSettings.getControl("RenderDepthOfField")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
|
||||
gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
|
||||
|
|
|
|||
|
|
@ -179,8 +179,6 @@ void display_startup()
|
|||
|
||||
if (gViewerWindow)
|
||||
gViewerWindow->setup2DRender();
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
|
||||
gGL.color4f(1,1,1,1);
|
||||
if (gViewerWindow)
|
||||
gViewerWindow->draw();
|
||||
|
|
@ -832,7 +830,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
|
|||
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
LLGLState::checkClientArrays();
|
||||
|
||||
static LLCullResult result;
|
||||
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
|
||||
|
|
@ -842,8 +839,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
|
|||
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
LLGLState::checkClientArrays();
|
||||
|
||||
|
||||
LLAppViewer::instance()->pingMainloopTimeout("Display:Swap");
|
||||
|
||||
{
|
||||
|
|
@ -859,7 +855,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
|
|||
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
LLGLState::checkClientArrays();
|
||||
|
||||
if (!for_snapshot)
|
||||
{
|
||||
|
|
@ -873,7 +868,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
|
|||
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
LLGLState::checkClientArrays();
|
||||
|
||||
glh::matrix4f proj = get_current_projection();
|
||||
glh::matrix4f mod = get_current_modelview();
|
||||
|
|
@ -892,14 +886,12 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
|
|||
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
LLGLState::checkClientArrays();
|
||||
|
||||
}
|
||||
glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
}
|
||||
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkClientArrays();
|
||||
|
||||
//if (!for_snapshot)
|
||||
{
|
||||
|
|
@ -911,7 +903,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
|
|||
}
|
||||
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkClientArrays();
|
||||
|
||||
//////////////////////////////////////
|
||||
//
|
||||
|
|
@ -951,7 +942,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
|
|||
}
|
||||
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkClientArrays();
|
||||
|
||||
///////////////////////////////////
|
||||
//
|
||||
|
|
@ -983,7 +973,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
|
|||
LLSceneMonitor::getInstance()->fetchQueryResult();
|
||||
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkClientArrays();
|
||||
|
||||
LLPipeline::sUseOcclusion = occlusion;
|
||||
|
||||
|
|
@ -1048,7 +1037,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
|
|||
}
|
||||
// </FS:CR> Aurora Sim
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkClientArrays();
|
||||
|
||||
stop_glerror();
|
||||
|
||||
|
|
@ -1082,9 +1070,9 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
|
|||
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
|
||||
|
||||
// <FS:Ansariel> gSavedSettings replacement
|
||||
//if (gSavedSettings.getBOOL("RenderDepthPrePass") && LLGLSLShader::sNoFixedFunction)
|
||||
//if (gSavedSettings.getBOOL("RenderDepthPrePass"))
|
||||
static LLCachedControl<bool> renderDepthPrePass(gSavedSettings, "RenderDepthPrePass");
|
||||
if (renderDepthPrePass && LLGLSLShader::sNoFixedFunction)
|
||||
if (renderDepthPrePass)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
gGL.setColorMask(false, false);
|
||||
|
|
@ -1601,10 +1589,7 @@ void render_ui_3d()
|
|||
|
||||
stop_glerror();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
|
||||
// Coordinate axes
|
||||
// <FS:Ansariel> gSavedSettings replacement
|
||||
|
|
@ -1653,7 +1638,6 @@ void render_ui_2d()
|
|||
}
|
||||
|
||||
stop_glerror();
|
||||
//gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
|
||||
// render outline for HUD
|
||||
if (isAgentAvatarValid() && gAgentCamera.mHUDCurZoom < 0.98f)
|
||||
|
|
@ -1754,10 +1738,7 @@ void render_ui_2d()
|
|||
|
||||
void render_disconnected_background()
|
||||
{
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
|
||||
gGL.color4f(1,1,1,1);
|
||||
if (!gDisconnectedImagep && gDisconnected)
|
||||
|
|
@ -1829,11 +1810,7 @@ void render_disconnected_background()
|
|||
}
|
||||
gGL.flush();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.unbind();
|
||||
}
|
||||
|
||||
gUIProgram.unbind();
|
||||
}
|
||||
|
||||
void display_cleanup()
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
|
|||
if (!mValid || !mMesh || !mFace || !mVisible ||
|
||||
!mFace->getVertexBuffer() ||
|
||||
mMesh->getNumFaces() == 0 ||
|
||||
(LLGLSLShader::sNoFixedFunction && LLGLSLShader::sCurBoundShaderPtr == NULL))
|
||||
LLGLSLShader::sCurBoundShaderPtr == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -257,7 +257,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
|
|||
|
||||
stop_glerror();
|
||||
|
||||
LLGLSSpecular specular(LLColor4(1.f,1.f,1.f,1.f), (mFace->getPool()->getShaderLevel() > 0 || LLGLSLShader::sNoFixedFunction) ? 0.f : mShiny);
|
||||
LLGLSSpecular specular(LLColor4(1.f,1.f,1.f,1.f), 0.f);
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// setup current texture
|
||||
|
|
@ -276,7 +276,6 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
|
|||
else
|
||||
{
|
||||
gGL.diffuseColor4f(0.7f, 0.6f, 0.3f, 1.f);
|
||||
gGL.getTexUnit(diffuse_channel)->setTextureColorBlend(LLTexUnit::TBO_LERP_TEX_ALPHA, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_PREV_COLOR);
|
||||
}
|
||||
}
|
||||
else if( !is_dummy && layerset )
|
||||
|
|
@ -339,11 +338,6 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
|
|||
|
||||
triangle_count += count;
|
||||
|
||||
if (mTestImageName)
|
||||
{
|
||||
gGL.getTexUnit(diffuse_channel)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
}
|
||||
|
||||
return triangle_count;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -478,7 +478,6 @@ void LLViewerShaderMgr::setShaders()
|
|||
}
|
||||
mMaxAvatarShaderLevel = 0;
|
||||
|
||||
LLGLSLShader::sNoFixedFunction = false;
|
||||
LLVertexBuffer::unbind();
|
||||
|
||||
llassert((gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 10));
|
||||
|
|
@ -487,10 +486,7 @@ void LLViewerShaderMgr::setShaders()
|
|||
bool hasWindLightShaders = LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders");
|
||||
S32 shadow_detail = gSavedSettings.getS32("RenderShadowDetail");
|
||||
bool doingWindLight = hasWindLightShaders && gSavedSettings.getBOOL("WindLightUseAtmosShaders");
|
||||
bool useRenderDeferred = doingWindLight && canRenderDeferred && gSavedSettings.getBOOL("RenderDeferred") && gSavedSettings.getBOOL("RenderAvatarVP");
|
||||
|
||||
//using shaders, disable fixed function
|
||||
LLGLSLShader::sNoFixedFunction = true;
|
||||
bool useRenderDeferred = doingWindLight && canRenderDeferred && gSavedSettings.getBOOL("RenderDeferred");
|
||||
|
||||
S32 light_class = 3;
|
||||
S32 interface_class = 2;
|
||||
|
|
@ -563,194 +559,168 @@ void LLViewerShaderMgr::setShaders()
|
|||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Failed to load basic shaders." << LL_ENDL;
|
||||
LL_ERRS() << "Unable to load basic shaders, verify graphics driver installed and current." << LL_ENDL;
|
||||
llassert(loaded);
|
||||
reentrance = false; // For hygiene only, re-try probably helps nothing
|
||||
return;
|
||||
}
|
||||
|
||||
gPipeline.mShadersLoaded = true;
|
||||
|
||||
// Load all shaders to set max levels
|
||||
loaded = loadShadersEnvironment();
|
||||
|
||||
if (loaded)
|
||||
{
|
||||
LL_INFOS() << "Loaded environment shaders." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Failed to load environment shaders." << LL_ENDL;
|
||||
llassert(loaded);
|
||||
}
|
||||
|
||||
if (loaded)
|
||||
{
|
||||
gPipeline.mVertexShadersEnabled = TRUE;
|
||||
gPipeline.mVertexShadersLoaded = 1;
|
||||
|
||||
// Load all shaders to set max levels
|
||||
loaded = loadShadersEnvironment();
|
||||
|
||||
loaded = loadShadersWater();
|
||||
if (loaded)
|
||||
{
|
||||
LL_INFOS() << "Loaded environment shaders." << LL_ENDL;
|
||||
LL_INFOS() << "Loaded water shaders." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Failed to load environment shaders." << LL_ENDL;
|
||||
LL_WARNS() << "Failed to load water shaders." << LL_ENDL;
|
||||
llassert(loaded);
|
||||
}
|
||||
}
|
||||
|
||||
if (loaded)
|
||||
{
|
||||
loaded = loadShadersWindLight();
|
||||
if (loaded)
|
||||
{
|
||||
loaded = loadShadersWater();
|
||||
if (loaded)
|
||||
{
|
||||
LL_INFOS() << "Loaded water shaders." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Failed to load water shaders." << LL_ENDL;
|
||||
llassert(loaded);
|
||||
}
|
||||
LL_INFOS() << "Loaded windlight shaders." << LL_ENDL;
|
||||
}
|
||||
|
||||
if (loaded)
|
||||
else
|
||||
{
|
||||
loaded = loadShadersWindLight();
|
||||
if (loaded)
|
||||
{
|
||||
LL_INFOS() << "Loaded windlight shaders." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Failed to load windlight shaders." << LL_ENDL;
|
||||
llassert(loaded);
|
||||
}
|
||||
LL_WARNS() << "Failed to load windlight shaders." << LL_ENDL;
|
||||
llassert(loaded);
|
||||
}
|
||||
}
|
||||
|
||||
if (loaded)
|
||||
{
|
||||
loaded = loadShadersEffects();
|
||||
if (loaded)
|
||||
{
|
||||
loaded = loadShadersEffects();
|
||||
if (loaded)
|
||||
{
|
||||
LL_INFOS() << "Loaded effects shaders." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Failed to load effects shaders." << LL_ENDL;
|
||||
llassert(loaded);
|
||||
}
|
||||
LL_INFOS() << "Loaded effects shaders." << LL_ENDL;
|
||||
}
|
||||
|
||||
if (loaded)
|
||||
else
|
||||
{
|
||||
loaded = loadShadersInterface();
|
||||
if (loaded)
|
||||
{
|
||||
LL_INFOS() << "Loaded interface shaders." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Failed to load interface shaders." << LL_ENDL;
|
||||
llassert(loaded);
|
||||
}
|
||||
LL_WARNS() << "Failed to load effects shaders." << LL_ENDL;
|
||||
llassert(loaded);
|
||||
}
|
||||
}
|
||||
|
||||
if (loaded)
|
||||
{
|
||||
loaded = loadShadersInterface();
|
||||
if (loaded)
|
||||
|
||||
{
|
||||
loaded = loadTransformShaders();
|
||||
if (loaded)
|
||||
{
|
||||
LL_INFOS() << "Loaded transform shaders." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Failed to load transform shaders." << LL_ENDL;
|
||||
llassert(loaded);
|
||||
}
|
||||
LL_INFOS() << "Loaded interface shaders." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Failed to load interface shaders." << LL_ENDL;
|
||||
llassert(loaded);
|
||||
}
|
||||
}
|
||||
|
||||
if (loaded)
|
||||
|
||||
{
|
||||
loaded = loadTransformShaders();
|
||||
if (loaded)
|
||||
{
|
||||
// Load max avatar shaders to set the max level
|
||||
mShaderLevel[SHADER_AVATAR] = 3;
|
||||
mMaxAvatarShaderLevel = 3;
|
||||
LL_INFOS() << "Loaded transform shaders." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Failed to load transform shaders." << LL_ENDL;
|
||||
llassert(loaded);
|
||||
}
|
||||
}
|
||||
|
||||
if (loaded)
|
||||
{
|
||||
// Load max avatar shaders to set the max level
|
||||
mShaderLevel[SHADER_AVATAR] = 3;
|
||||
mMaxAvatarShaderLevel = 3;
|
||||
|
||||
if (gSavedSettings.getBOOL("RenderAvatarVP") && loadShadersObject())
|
||||
{ //hardware skinning is enabled and rigged attachment shaders loaded correctly
|
||||
BOOL avatar_cloth = gSavedSettings.getBOOL("RenderAvatarCloth");
|
||||
if (loadShadersObject())
|
||||
{ //hardware skinning is enabled and rigged attachment shaders loaded correctly
|
||||
BOOL avatar_cloth = gSavedSettings.getBOOL("RenderAvatarCloth");
|
||||
|
||||
// cloth is a class3 shader
|
||||
S32 avatar_class = avatar_cloth ? 3 : 1;
|
||||
// cloth is a class3 shader
|
||||
S32 avatar_class = avatar_cloth ? 3 : 1;
|
||||
|
||||
// Set the actual level
|
||||
mShaderLevel[SHADER_AVATAR] = avatar_class;
|
||||
// Set the actual level
|
||||
mShaderLevel[SHADER_AVATAR] = avatar_class;
|
||||
|
||||
loaded = loadShadersAvatar();
|
||||
llassert(loaded);
|
||||
loaded = loadShadersAvatar();
|
||||
llassert(loaded);
|
||||
|
||||
if (mShaderLevel[SHADER_AVATAR] != avatar_class)
|
||||
if (mShaderLevel[SHADER_AVATAR] != avatar_class)
|
||||
{
|
||||
if(llmax(mShaderLevel[SHADER_AVATAR]-1,0) >= 3)
|
||||
{
|
||||
if (mShaderLevel[SHADER_AVATAR] == 0)
|
||||
{
|
||||
gSavedSettings.setBOOL("RenderAvatarVP", FALSE);
|
||||
}
|
||||
if(llmax(mShaderLevel[SHADER_AVATAR]-1,0) >= 3)
|
||||
{
|
||||
LL_WARNS() << "Couldn't load object shaders - Deferred rendering disabled" << LL_ENDL; // FS:Ansariel> FIRE-20305: Debug output
|
||||
gSavedSettings.setBOOL("RenderDeferred", FALSE);
|
||||
avatar_cloth = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
avatar_cloth = false;
|
||||
}
|
||||
gSavedSettings.setBOOL("RenderAvatarCloth", avatar_cloth);
|
||||
avatar_cloth = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ //hardware skinning not possible, neither is deferred rendering
|
||||
mShaderLevel[SHADER_AVATAR] = 0;
|
||||
mShaderLevel[SHADER_DEFERRED] = 0;
|
||||
|
||||
if (gSavedSettings.getBOOL("RenderAvatarVP"))
|
||||
else
|
||||
{
|
||||
gSavedSettings.setBOOL("RenderDeferred", FALSE);
|
||||
gSavedSettings.setBOOL("RenderAvatarCloth", FALSE);
|
||||
gSavedSettings.setBOOL("RenderAvatarVP", FALSE);
|
||||
avatar_cloth = false;
|
||||
}
|
||||
|
||||
loadShadersAvatar(); // unloads
|
||||
|
||||
loaded = loadShadersObject();
|
||||
llassert(loaded);
|
||||
gSavedSettings.setBOOL("RenderAvatarCloth", avatar_cloth);
|
||||
}
|
||||
}
|
||||
else
|
||||
{ //hardware skinning not possible, neither is deferred rendering
|
||||
mShaderLevel[SHADER_AVATAR] = 0;
|
||||
mShaderLevel[SHADER_DEFERRED] = 0;
|
||||
|
||||
if (!loaded)
|
||||
{ //some shader absolutely could not load, try to fall back to a simpler setting
|
||||
if (gSavedSettings.getBOOL("WindLightUseAtmosShaders"))
|
||||
{ //disable windlight and try again
|
||||
gSavedSettings.setBOOL("WindLightUseAtmosShaders", FALSE);
|
||||
LL_WARNS() << "Falling back to no windlight shaders." << LL_ENDL;
|
||||
reentrance = false;
|
||||
setShaders();
|
||||
return;
|
||||
}
|
||||
}
|
||||
gSavedSettings.setBOOL("RenderDeferred", FALSE);
|
||||
gSavedSettings.setBOOL("RenderAvatarCloth", FALSE);
|
||||
|
||||
llassert(loaded);
|
||||
loadShadersAvatar(); // unloads
|
||||
|
||||
if (loaded && !loadShadersDeferred())
|
||||
{ //everything else succeeded but deferred failed, disable deferred and try again
|
||||
gSavedSettings.setBOOL("RenderDeferred", FALSE);
|
||||
LL_WARNS() << "Falling back to no deferred shaders." << LL_ENDL;
|
||||
loaded = loadShadersObject();
|
||||
llassert(loaded);
|
||||
}
|
||||
}
|
||||
|
||||
if (!loaded)
|
||||
{ //some shader absolutely could not load, try to fall back to a simpler setting
|
||||
if (gSavedSettings.getBOOL("WindLightUseAtmosShaders"))
|
||||
{ //disable windlight and try again
|
||||
gSavedSettings.setBOOL("WindLightUseAtmosShaders", FALSE);
|
||||
LL_WARNS() << "Falling back to no windlight shaders." << LL_ENDL;
|
||||
reentrance = false;
|
||||
setShaders();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
llassert(loaded);
|
||||
|
||||
if (loaded && !loadShadersDeferred())
|
||||
{ //everything else succeeded but deferred failed, disable deferred and try again
|
||||
gSavedSettings.setBOOL("RenderDeferred", FALSE);
|
||||
LL_WARNS() << "Falling back to no deferred shaders." << LL_ENDL;
|
||||
reentrance = false;
|
||||
setShaders();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
LLGLSLShader::sNoFixedFunction = false;
|
||||
gPipeline.mVertexShadersEnabled = FALSE;
|
||||
gPipeline.mVertexShadersLoaded = 0;
|
||||
mShaderLevel[SHADER_LIGHTING] = 0;
|
||||
mShaderLevel[SHADER_INTERFACE] = 0;
|
||||
mShaderLevel[SHADER_ENVIRONMENT] = 0;
|
||||
mShaderLevel[SHADER_WATER] = 0;
|
||||
mShaderLevel[SHADER_OBJECT] = 0;
|
||||
mShaderLevel[SHADER_EFFECT] = 0;
|
||||
mShaderLevel[SHADER_WINDLIGHT] = 0;
|
||||
mShaderLevel[SHADER_AVATAR] = 0;
|
||||
}
|
||||
|
||||
|
||||
if (gViewerWindow)
|
||||
{
|
||||
gViewerWindow->setCursor(UI_CURSOR_ARROW);
|
||||
|
|
@ -881,7 +851,7 @@ void LLViewerShaderMgr::unloadShaders()
|
|||
mShaderLevel[SHADER_WINDLIGHT] = 0;
|
||||
mShaderLevel[SHADER_TRANSFORM] = 0;
|
||||
|
||||
gPipeline.mVertexShadersLoaded = 0;
|
||||
gPipeline.mShadersLoaded = false;
|
||||
}
|
||||
|
||||
BOOL LLViewerShaderMgr::loadBasicShaders()
|
||||
|
|
|
|||
|
|
@ -544,7 +544,7 @@ void send_viewer_stats(bool include_preferences)
|
|||
{
|
||||
shader_level = 2;
|
||||
}
|
||||
else if (gPipeline.canUseVertexShaders())
|
||||
else if (gPipeline.shadersLoaded())
|
||||
{
|
||||
shader_level = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -654,12 +654,6 @@ public:
|
|||
{
|
||||
LLTrace::Recording& last_frame_recording = LLTrace::get_frame_recording().getLastRecording();
|
||||
|
||||
if (gPipeline.getUseVertexShaders() == 0)
|
||||
{
|
||||
addText(xpos, ypos, "Shaders Disabled");
|
||||
ypos += y_inc;
|
||||
}
|
||||
|
||||
if (gGLManager.mHasATIMemInfo)
|
||||
{
|
||||
S32 meminfo[4];
|
||||
|
|
@ -2209,20 +2203,6 @@ void LLViewerWindow::initGLDefaults()
|
|||
{
|
||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{ //initialize fixed function state
|
||||
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
|
||||
|
||||
glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT,LLColor4::black.mV);
|
||||
glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,LLColor4::white.mV);
|
||||
|
||||
// lights for objects
|
||||
glShadeModel( GL_SMOOTH );
|
||||
|
||||
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
}
|
||||
|
||||
glPixelStorei(GL_PACK_ALIGNMENT,1);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
|
||||
|
||||
|
|
@ -3006,10 +2986,7 @@ void LLViewerWindow::drawDebugText()
|
|||
gGL.color4f(1,1,1,1);
|
||||
gGL.pushMatrix();
|
||||
gGL.pushUIMatrix();
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
{
|
||||
// scale view by UI global scale factor and aspect ratio correction factor
|
||||
gGL.scaleUI(mDisplayScale.mV[VX], mDisplayScale.mV[VY], 1.f);
|
||||
|
|
@ -3019,10 +2996,7 @@ void LLViewerWindow::drawDebugText()
|
|||
gGL.popMatrix();
|
||||
|
||||
gGL.flush();
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.unbind();
|
||||
}
|
||||
gUIProgram.unbind();
|
||||
}
|
||||
|
||||
void LLViewerWindow::draw()
|
||||
|
|
@ -3071,10 +3045,7 @@ void LLViewerWindow::draw()
|
|||
// Draw all nested UI views.
|
||||
// No translation needed, this view is glued to 0,0
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
|
||||
gGL.pushMatrix();
|
||||
LLUI::pushMatrix();
|
||||
|
|
@ -3250,14 +3221,9 @@ void LLViewerWindow::draw()
|
|||
LLUI::popMatrix();
|
||||
gGL.popMatrix();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.unbind();
|
||||
}
|
||||
gUIProgram.unbind();
|
||||
|
||||
//#if LL_DEBUG
|
||||
LLView::sIsDrawing = FALSE;
|
||||
//#endif
|
||||
}
|
||||
|
||||
// <FS:TT> Window Title Access
|
||||
|
|
@ -4566,25 +4532,10 @@ void renderMeshPhysicsTriangles(const LLColor4& color, const LLColor4& line_colo
|
|||
gGL.diffuseColor4fv(line_color.mV);
|
||||
LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// <FS:Ansariel> Don't use fixed functions when using shader renderer; found by Drake Arconis
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
// </FS:Ansariel>
|
||||
LLGLEnable fog(GL_FOG);
|
||||
glFogi(GL_FOG_MODE, GL_LINEAR);
|
||||
float d = (LLViewerCamera::getInstance()->getPointOfInterest() - LLViewerCamera::getInstance()->getOrigin()).magVec();
|
||||
LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal() - gAgentCamera.getCameraPositionGlobal()).magVec() / (LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec() * 4), 0.0, 1.0);
|
||||
glFogf(GL_FOG_START, d);
|
||||
glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV())));
|
||||
glFogfv(GL_FOG_COLOR, fogCol.mV);
|
||||
// <FS:Ansariel> Don't use fixed functions when using shader renderer; found by Drake Arconis
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
gGL.flush();
|
||||
{
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
gGL.diffuseColor4fv(color.mV);
|
||||
|
|
@ -4620,21 +4571,7 @@ void renderMeshPhysicsTriangles(const LLColor4& color, const LLColor4& line_colo
|
|||
}
|
||||
else
|
||||
{
|
||||
// <FS:Ansariel> Don't use fixed functions when using shader renderer; found by Drake Arconis
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
// </FS:Ansariel>
|
||||
LLGLEnable fog(GL_FOG);
|
||||
glFogi(GL_FOG_MODE, GL_LINEAR);
|
||||
float d = (LLViewerCamera::getInstance()->getPointOfInterest() - LLViewerCamera::getInstance()->getOrigin()).magVec();
|
||||
LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal() - gAgentCamera.getCameraPositionGlobal()).magVec() / (LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec() * 4), 0.0, 1.0);
|
||||
glFogf(GL_FOG_START, d);
|
||||
glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV())));
|
||||
glFogfv(GL_FOG_COLOR, fogCol.mV);
|
||||
// <FS:Ansariel> Don't use fixed functions when using shader renderer; found by Drake Arconis
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
gGL.flush();
|
||||
{
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
gGL.diffuseColor4fv(color.mV);
|
||||
|
|
@ -4769,7 +4706,7 @@ void renderNonMeshHullPhysics(LLVOVolume* vovolume, LLVolume* volume, LLColor4 c
|
|||
gGL.diffuseColor4fv(line_color.mV);
|
||||
LLVertexBuffer::unbind();
|
||||
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0);
|
||||
llassert(LLGLSLShader::sCurBoundShader != 0);
|
||||
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
|
||||
|
||||
|
|
@ -5043,32 +4980,24 @@ void renderOnePhysicsShape(LLViewerObject* objectp)
|
|||
{
|
||||
// TODO: (Beq) refactor this!! yet another flavour of drawing the same crap. Can we ratioanlise the arguments
|
||||
// <FS:Ansariel> Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gGL.diffuseColor4fv(line_color.mV);
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
|
||||
//glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
//llassert(LLGLSLShader::sCurBoundShader != 0);
|
||||
//LLVertexBuffer::unbind();
|
||||
//glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints);
|
||||
//gGL.diffuseColor4fv(line_color.mV);
|
||||
//gGL.syncMatrices();
|
||||
//glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
|
||||
|
||||
gGL.diffuseColor4fv(color.mV);
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
// </FS:Ansariel>
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0);
|
||||
LLVertexBuffer::unbind();
|
||||
glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints);
|
||||
gGL.diffuseColor4fv(line_color.mV);
|
||||
gGL.syncMatrices();
|
||||
glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
|
||||
//gGL.diffuseColor4fv(color.mV);
|
||||
//glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
//glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
|
||||
gGL.diffuseColor4fv(line_color.mV);
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
|
||||
|
||||
gGL.diffuseColor4fv(color.mV);
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices);
|
||||
// <FS:Ansariel> Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr
|
||||
}
|
||||
gGL.diffuseColor4fv(color.mV);
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -5750,11 +5750,6 @@ U32 LLVOAvatar::renderSkinned()
|
|||
bool should_alpha_mask = shouldAlphaMask();
|
||||
LLGLState test(GL_ALPHA_TEST, should_alpha_mask);
|
||||
|
||||
if (should_alpha_mask && !LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
|
||||
}
|
||||
|
||||
BOOL first_pass = TRUE;
|
||||
if (!LLDrawPoolAvatar::sSkipOpaque)
|
||||
{
|
||||
|
|
@ -5801,11 +5796,6 @@ U32 LLVOAvatar::renderSkinned()
|
|||
}
|
||||
}
|
||||
|
||||
if (should_alpha_mask && !LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
}
|
||||
|
||||
if (!LLDrawPoolAvatar::sSkipTransparent || LLPipeline::sImpostorRender)
|
||||
{
|
||||
LLGLState blend(GL_BLEND, !mIsDummy);
|
||||
|
|
@ -5822,21 +5812,21 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass)
|
|||
U32 num_indices = 0;
|
||||
if( isWearingWearableType( LLWearableType::WT_SKIRT ) && (isUIAvatar() || isTextureVisible(TEX_SKIRT_BAKED)) )
|
||||
{
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.25f);
|
||||
gGL.flush();
|
||||
LLViewerJoint* skirt_mesh = getViewerJoint(MESH_ID_SKIRT);
|
||||
if (skirt_mesh)
|
||||
{
|
||||
num_indices += skirt_mesh->render(mAdjustedPixelArea, FALSE);
|
||||
}
|
||||
first_pass = FALSE;
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
gGL.flush();
|
||||
}
|
||||
|
||||
if (!isSelf() || gAgent.needsRenderHead() || LLPipeline::sShadowRender)
|
||||
{
|
||||
if (LLPipeline::sImpostorRender)
|
||||
{
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
|
||||
gGL.flush();
|
||||
}
|
||||
|
||||
if (isTextureVisible(TEX_HEAD_BAKED))
|
||||
|
|
@ -5859,7 +5849,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass)
|
|||
}
|
||||
if (LLPipeline::sImpostorRender)
|
||||
{
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
gGL.flush();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5892,11 +5882,6 @@ U32 LLVOAvatar::renderRigid()
|
|||
bool should_alpha_mask = shouldAlphaMask();
|
||||
LLGLState test(GL_ALPHA_TEST, should_alpha_mask);
|
||||
|
||||
if (should_alpha_mask && !LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
|
||||
}
|
||||
|
||||
if (isTextureVisible(TEX_EYES_BAKED) || (getOverallAppearance() == AOA_JELLYDOLL && !isControlAvatar()) || isUIAvatar())
|
||||
{
|
||||
LLViewerJoint* eyeball_left = getViewerJoint(MESH_ID_EYEBALL_LEFT);
|
||||
|
|
@ -5911,11 +5896,6 @@ U32 LLVOAvatar::renderRigid()
|
|||
}
|
||||
}
|
||||
|
||||
if (should_alpha_mask && !LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
}
|
||||
|
||||
return num_indices;
|
||||
}
|
||||
|
||||
|
|
@ -5967,7 +5947,7 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel)
|
|||
}
|
||||
{
|
||||
LLGLEnable test(GL_ALPHA_TEST);
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f);
|
||||
gGL.flush();
|
||||
|
||||
gGL.color4ubv(color.mV);
|
||||
gGL.getTexUnit(diffuse_channel)->bind(&mImpostor);
|
||||
|
|
|
|||
|
|
@ -59,63 +59,7 @@ public:
|
|||
// virtual
|
||||
void setupVertexBuffer(U32 data_mask)
|
||||
{
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{ //just use default if shaders are in play
|
||||
LLVertexBuffer::setupVertexBuffer(data_mask & ~(MAP_TEXCOORD2 | MAP_TEXCOORD3));
|
||||
return;
|
||||
}
|
||||
|
||||
volatile U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData;
|
||||
|
||||
//assume tex coords 2 and 3 are present
|
||||
U32 type_mask = mTypeMask | MAP_TEXCOORD2 | MAP_TEXCOORD3;
|
||||
|
||||
if ((data_mask & type_mask) != data_mask)
|
||||
{
|
||||
LL_ERRS() << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask." << LL_ENDL;
|
||||
}
|
||||
|
||||
if (data_mask & MAP_NORMAL)
|
||||
{
|
||||
glNormalPointer(GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_NORMAL], (void*)(base + mOffsets[TYPE_NORMAL]));
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD3)
|
||||
{ //substitute tex coord 1 for tex coord 3
|
||||
glClientActiveTextureARB(GL_TEXTURE3_ARB);
|
||||
glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], (void*)(base + mOffsets[TYPE_TEXCOORD1]));
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD2)
|
||||
{ //substitute tex coord 0 for tex coord 2
|
||||
glClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], (void*)(base + mOffsets[TYPE_TEXCOORD0]));
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD1)
|
||||
{
|
||||
glClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], (void*)(base + mOffsets[TYPE_TEXCOORD1]));
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
}
|
||||
if (data_mask & MAP_TANGENT)
|
||||
{
|
||||
glClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glTexCoordPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TANGENT], (void*)(base + mOffsets[TYPE_TANGENT]));
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
}
|
||||
if (data_mask & MAP_TEXCOORD0)
|
||||
{
|
||||
glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], (void*)(base + mOffsets[TYPE_TEXCOORD0]));
|
||||
}
|
||||
if (data_mask & MAP_COLOR)
|
||||
{
|
||||
glColorPointer(4, GL_UNSIGNED_BYTE, LLVertexBuffer::sTypeSize[TYPE_COLOR], (void*)(base + mOffsets[TYPE_COLOR]));
|
||||
}
|
||||
|
||||
if (data_mask & MAP_VERTEX)
|
||||
{
|
||||
glVertexPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_VERTEX], (void*)(base + 0));
|
||||
}
|
||||
LLVertexBuffer::setupVertexBuffer(data_mask & ~(MAP_TEXCOORD2 | MAP_TEXCOORD3));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -6907,7 +6907,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
{
|
||||
registerFace(group, facep, LLRenderPass::PASS_ALPHA);
|
||||
}
|
||||
else if (gPipeline.canUseVertexShaders()
|
||||
else if (gPipeline.shadersLoaded()
|
||||
&& LLPipeline::sRenderBump
|
||||
&& te->getShiny()
|
||||
&& can_be_shiny)
|
||||
|
|
@ -6946,7 +6946,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
registerFace(group, facep, LLRenderPass::PASS_ALPHA);
|
||||
}
|
||||
}
|
||||
else if (gPipeline.canUseVertexShaders()
|
||||
else if (gPipeline.shadersLoaded()
|
||||
&& LLPipeline::sRenderBump
|
||||
&& te->getShiny()
|
||||
&& can_be_shiny)
|
||||
|
|
@ -7027,7 +7027,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
}
|
||||
|
||||
|
||||
if (!gPipeline.canUseVertexShaders() &&
|
||||
if (!gPipeline.shadersLoaded() &&
|
||||
!is_alpha &&
|
||||
te->getShiny() &&
|
||||
LLPipeline::sRenderBump)
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
|
|||
static const unsigned int vertices_per_quad = 4;
|
||||
static const unsigned int indices_per_quad = 6;
|
||||
|
||||
const S32 size = LLPipeline::sRenderTransparentWater && LLGLSLShader::sNoFixedFunction ? 16 : 1;
|
||||
const S32 size = LLPipeline::sRenderTransparentWater ? 16 : 1;
|
||||
|
||||
const S32 num_quads = size * size;
|
||||
face->setSize(vertices_per_quad * num_quads,
|
||||
|
|
|
|||
|
|
@ -347,15 +347,13 @@ void LLWorldMapView::draw()
|
|||
// Clear the background alpha to 0
|
||||
gGL.flush();
|
||||
gGL.setColorMask(false, true);
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.f);
|
||||
gGL.flush();
|
||||
gGL.setSceneBlendType(LLRender::BT_REPLACE);
|
||||
gGL.color4f(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
gl_rect_2d(0, height, width, 0);
|
||||
}
|
||||
|
||||
gGL.flush();
|
||||
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
gGL.setColorMask(true, true);
|
||||
|
||||
// Draw the image tiles
|
||||
|
|
@ -371,7 +369,6 @@ void LLWorldMapView::draw()
|
|||
|
||||
gGL.flush();
|
||||
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
gGL.setColorMask(true, true);
|
||||
|
||||
// Draw per sim overlayed information (names, mature, offline...)
|
||||
|
|
@ -610,13 +607,13 @@ void LLWorldMapView::draw()
|
|||
LLGLSUIDefault gls_ui;
|
||||
{
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.f);
|
||||
gGL.flush();
|
||||
gGL.blendFunc(LLRender::BF_ONE_MINUS_DEST_ALPHA, LLRender::BF_DEST_ALPHA);
|
||||
gGL.color4fv( mBackgroundColor.mV );
|
||||
gl_rect_2d(0, height, width, 0);
|
||||
}
|
||||
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
gGL.flush();
|
||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
|
||||
// Draw item infos if we're not zoomed out too much and there's something to draw
|
||||
|
|
|
|||
|
|
@ -150,7 +150,6 @@
|
|||
bool gShiftFrame = false;
|
||||
|
||||
//cached settings
|
||||
bool LLPipeline::RenderAvatarVP;
|
||||
bool LLPipeline::WindLightUseAtmosShaders;
|
||||
bool LLPipeline::RenderDeferred;
|
||||
F32 LLPipeline::RenderDeferredSunWash;
|
||||
|
|
@ -405,8 +404,7 @@ LLPipeline::LLPipeline() :
|
|||
mNumVisibleFaces(0),
|
||||
|
||||
mInitialized(false),
|
||||
mVertexShadersEnabled(false),
|
||||
mVertexShadersLoaded(0),
|
||||
mShadersLoaded(false),
|
||||
mTransformFeedbackPrimitives(0),
|
||||
mRenderDebugFeatureMask(0),
|
||||
mRenderDebugMask(0),
|
||||
|
|
@ -586,7 +584,6 @@ void LLPipeline::init()
|
|||
connectRefreshCachedSettingsSafe("RenderAvatarMaxNonImpostors");
|
||||
connectRefreshCachedSettingsSafe("RenderDelayVBUpdate");
|
||||
connectRefreshCachedSettingsSafe("UseOcclusion");
|
||||
connectRefreshCachedSettingsSafe("RenderAvatarVP");
|
||||
connectRefreshCachedSettingsSafe("WindLightUseAtmosShaders");
|
||||
connectRefreshCachedSettingsSafe("RenderDeferred");
|
||||
connectRefreshCachedSettingsSafe("RenderDeferredSunWash");
|
||||
|
|
@ -810,7 +807,7 @@ void LLPipeline::resizeShadowTexture()
|
|||
|
||||
void LLPipeline::resizeScreenTexture()
|
||||
{
|
||||
if (gPipeline.canUseVertexShaders() && assertInitialized())
|
||||
if (gPipeline.shadersLoaded())
|
||||
{
|
||||
GLuint resX = gViewerWindow->getWorldViewWidthRaw();
|
||||
GLuint resY = gViewerWindow->getWorldViewHeightRaw();
|
||||
|
|
@ -839,8 +836,8 @@ void LLPipeline::resizeScreenTexture()
|
|||
releaseShadowTargets();
|
||||
allocateScreenBuffer(resX,resY);
|
||||
gResizeScreenTexture = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLPipeline::allocatePhysicsBuffer()
|
||||
|
|
@ -1172,7 +1169,6 @@ void LLPipeline::updateRenderDeferred()
|
|||
RenderDeferred &&
|
||||
LLRenderTarget::sUseFBO &&
|
||||
LLPipeline::sRenderBump &&
|
||||
RenderAvatarVP &&
|
||||
WindLightUseAtmosShaders &&
|
||||
(bool) LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred");
|
||||
|
||||
|
|
@ -1204,12 +1200,10 @@ void LLPipeline::refreshCachedSettings()
|
|||
|
||||
LLPipeline::sUseOcclusion =
|
||||
(!gUseWireframe
|
||||
&& LLGLSLShader::sNoFixedFunction
|
||||
&& LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion")
|
||||
&& gSavedSettings.getBOOL("UseOcclusion")
|
||||
&& gGLManager.mHasOcclusionQuery) ? 2 : 0;
|
||||
|
||||
RenderAvatarVP = gSavedSettings.getBOOL("RenderAvatarVP");
|
||||
WindLightUseAtmosShaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders");
|
||||
RenderDeferred = gSavedSettings.getBOOL("RenderDeferred");
|
||||
RenderDeferredSunWash = gSavedSettings.getF32("RenderDeferredSunWash");
|
||||
|
|
@ -1524,10 +1518,7 @@ void LLPipeline::restoreGL()
|
|||
{
|
||||
assertInitialized();
|
||||
|
||||
if (mVertexShadersEnabled)
|
||||
{
|
||||
LLViewerShaderMgr::instance()->setShaders();
|
||||
}
|
||||
LLViewerShaderMgr::instance()->setShaders();
|
||||
|
||||
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
|
||||
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
|
||||
|
|
@ -1544,17 +1535,9 @@ void LLPipeline::restoreGL()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
bool LLPipeline::canUseVertexShaders()
|
||||
bool LLPipeline::shadersLoaded()
|
||||
{
|
||||
if ((assertInitialized() && mVertexShadersLoaded != 1) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return (assertInitialized() && mShadersLoaded);
|
||||
}
|
||||
|
||||
bool LLPipeline::canUseWindLightShaders() const
|
||||
|
|
@ -1577,8 +1560,7 @@ bool LLPipeline::canUseAntiAliasing() const
|
|||
void LLPipeline::unloadShaders()
|
||||
{
|
||||
LLViewerShaderMgr::instance()->unloadShaders();
|
||||
|
||||
mVertexShadersLoaded = 0;
|
||||
mShadersLoaded = false;
|
||||
}
|
||||
|
||||
void LLPipeline::assertInitializedDoError()
|
||||
|
|
@ -2506,8 +2488,7 @@ static LLTrace::BlockTimerStatHandle FTM_CULL("Object Culling");
|
|||
void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_clip, LLPlane* planep, bool hud_attachments)
|
||||
{
|
||||
static LLCachedControl<bool> use_occlusion(gSavedSettings,"UseOcclusion");
|
||||
static bool can_use_occlusion = LLGLSLShader::sNoFixedFunction
|
||||
&& LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion")
|
||||
static bool can_use_occlusion = LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion")
|
||||
&& gGLManager.mHasOcclusionQuery;
|
||||
|
||||
LL_RECORD_BLOCK_TIME(FTM_CULL);
|
||||
|
|
@ -2528,7 +2509,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
|
|||
|
||||
sCull->clear();
|
||||
|
||||
bool to_texture = LLPipeline::sUseOcclusion > 1 && gPipeline.canUseVertexShaders();
|
||||
bool to_texture = LLPipeline::sUseOcclusion > 1 && gPipeline.shadersLoaded();
|
||||
|
||||
if (to_texture)
|
||||
{
|
||||
|
|
@ -2562,7 +2543,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
|
|||
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
|
||||
|
||||
bool bound_shader = false;
|
||||
if (gPipeline.canUseVertexShaders() && LLGLSLShader::sCurBoundShader == 0)
|
||||
if (gPipeline.shadersLoaded() && LLGLSLShader::sCurBoundShader == 0)
|
||||
{ //if no shader is currently bound, use the occlusion shader instead of fixed function if we can
|
||||
// (shadow render uses a special shader that clamps to clip planes)
|
||||
bound_shader = true;
|
||||
|
|
@ -2821,7 +2802,7 @@ void LLPipeline::doOcclusion(LLCamera& camera)
|
|||
LLGLDisable cull(GL_CULL_FACE);
|
||||
|
||||
|
||||
bool bind_shader = LLGLSLShader::sNoFixedFunction && LLGLSLShader::sCurBoundShader == 0;
|
||||
bool bind_shader = (LLGLSLShader::sCurBoundShader == 0);
|
||||
if (bind_shader)
|
||||
{
|
||||
if (LLPipeline::sShadowRender)
|
||||
|
|
@ -4204,10 +4185,7 @@ void render_hud_elements()
|
|||
|
||||
gGL.color4f(1,1,1,1);
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
|
||||
|
||||
if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
|
||||
|
|
@ -4239,10 +4217,7 @@ void render_hud_elements()
|
|||
LLHUDText::renderAllHUD();
|
||||
}
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.unbind();
|
||||
}
|
||||
gUIProgram.unbind();
|
||||
gGL.flush();
|
||||
}
|
||||
|
||||
|
|
@ -4274,10 +4249,7 @@ void LLPipeline::renderHighlights()
|
|||
|
||||
gGL.setColorMask(false, false);
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gHighlightProgram.bind();
|
||||
}
|
||||
gHighlightProgram.bind();
|
||||
|
||||
for (std::set<HighlightItem>::iterator iter = mHighlightSet.begin(); iter != mHighlightSet.end(); ++iter)
|
||||
{
|
||||
|
|
@ -4509,7 +4481,6 @@ void LLPipeline::renderGeom(LLCamera& camera, bool forceVBOUpdate)
|
|||
// Do verification of GL state
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
LLGLState::checkClientArrays();
|
||||
if (mRenderDebugMask & RENDER_DEBUG_VERIFY)
|
||||
{
|
||||
if (!verify())
|
||||
|
|
@ -4768,7 +4739,6 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera)
|
|||
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
LLGLState::checkClientArrays();
|
||||
|
||||
U32 cur_type = 0;
|
||||
|
||||
|
|
@ -5042,10 +5012,7 @@ void LLPipeline::renderPhysicsDisplay()
|
|||
|
||||
gGL.setColorMask(true, false);
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gDebugProgram.bind();
|
||||
}
|
||||
gDebugProgram.bind();
|
||||
|
||||
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
|
||||
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
|
||||
|
|
@ -5066,11 +5033,7 @@ void LLPipeline::renderPhysicsDisplay()
|
|||
|
||||
gGL.flush();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gDebugProgram.unbind();
|
||||
}
|
||||
|
||||
gDebugProgram.unbind();
|
||||
mPhysicsDisplay.flush();
|
||||
}
|
||||
|
||||
|
|
@ -5097,13 +5060,10 @@ void LLPipeline::renderDebug()
|
|||
|
||||
if ( pathfindingCharacter->getVisible() || gAgentCamera.cameraMouselook() )
|
||||
{
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gPathfindingProgram.bind();
|
||||
gPathfindingProgram.uniform1f(sTint, 1.f);
|
||||
gPathfindingProgram.uniform1f(sAmbiance, 1.f);
|
||||
gPathfindingProgram.uniform1f(sAlphaScale, 1.f);
|
||||
}
|
||||
gPathfindingProgram.bind();
|
||||
gPathfindingProgram.uniform1f(sTint, 1.f);
|
||||
gPathfindingProgram.uniform1f(sAmbiance, 1.f);
|
||||
gPathfindingProgram.uniform1f(sAlphaScale, 1.f);
|
||||
|
||||
//Requried character physics capsule render parameters
|
||||
LLUUID id;
|
||||
|
|
@ -5112,21 +5072,14 @@ void LLPipeline::renderDebug()
|
|||
|
||||
if ( pathfindingCharacter->isPhysicsCapsuleEnabled( id, pos, rot ) )
|
||||
{
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
//remove blending artifacts
|
||||
gGL.setColorMask(false, false);
|
||||
llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot );
|
||||
gGL.setColorMask(true, false);
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
gPathfindingProgram.uniform1f(sAlphaScale, 0.90f);
|
||||
llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot );
|
||||
gPathfindingProgram.bind();
|
||||
}
|
||||
else
|
||||
{
|
||||
llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot );
|
||||
}
|
||||
//remove blending artifacts
|
||||
gGL.setColorMask(false, false);
|
||||
llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot );
|
||||
gGL.setColorMask(true, false);
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
gPathfindingProgram.uniform1f(sAlphaScale, 0.90f);
|
||||
llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot );
|
||||
gPathfindingProgram.bind();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5142,14 +5095,11 @@ void LLPipeline::renderDebug()
|
|||
{
|
||||
F32 ambiance = gSavedSettings.getF32("PathfindingAmbiance");
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gPathfindingProgram.bind();
|
||||
gPathfindingProgram.bind();
|
||||
|
||||
gPathfindingProgram.uniform1f(sTint, 1.f);
|
||||
gPathfindingProgram.uniform1f(sAmbiance, ambiance);
|
||||
gPathfindingProgram.uniform1f(sAlphaScale, 1.f);
|
||||
}
|
||||
gPathfindingProgram.uniform1f(sTint, 1.f);
|
||||
gPathfindingProgram.uniform1f(sAmbiance, ambiance);
|
||||
gPathfindingProgram.uniform1f(sAlphaScale, 1.f);
|
||||
|
||||
if ( !pathfindingConsole->isRenderWorld() )
|
||||
{
|
||||
|
|
@ -5181,18 +5131,11 @@ void LLPipeline::renderDebug()
|
|||
}
|
||||
|
||||
//render edges
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gPathfindingNoNormalsProgram.bind();
|
||||
gPathfindingNoNormalsProgram.uniform1f(sTint, 1.f);
|
||||
gPathfindingNoNormalsProgram.uniform1f(sAlphaScale, 1.f);
|
||||
llPathingLibInstance->renderNavMeshEdges();
|
||||
gPathfindingProgram.bind();
|
||||
}
|
||||
else
|
||||
{
|
||||
llPathingLibInstance->renderNavMeshEdges();
|
||||
}
|
||||
gPathfindingNoNormalsProgram.bind();
|
||||
gPathfindingNoNormalsProgram.uniform1f(sTint, 1.f);
|
||||
gPathfindingNoNormalsProgram.uniform1f(sAlphaScale, 1.f);
|
||||
llPathingLibInstance->renderNavMeshEdges();
|
||||
gPathfindingProgram.bind();
|
||||
|
||||
gGL.flush();
|
||||
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
|
||||
|
|
@ -5203,53 +5146,31 @@ void LLPipeline::renderDebug()
|
|||
if ( LLPathfindingPathTool::getInstance()->isRenderPath() )
|
||||
{
|
||||
//The path
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep);
|
||||
llPathingLibInstance->renderPath();
|
||||
gPathfindingProgram.bind();
|
||||
}
|
||||
else
|
||||
{
|
||||
llPathingLibInstance->renderPath();
|
||||
}
|
||||
//The bookends
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
//remove blending artifacts
|
||||
gGL.setColorMask(false, false);
|
||||
llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_START );
|
||||
llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_END );
|
||||
gUIProgram.bind();
|
||||
gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep);
|
||||
llPathingLibInstance->renderPath();
|
||||
gPathfindingProgram.bind();
|
||||
|
||||
//The bookends
|
||||
//remove blending artifacts
|
||||
gGL.setColorMask(false, false);
|
||||
llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_START );
|
||||
llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_END );
|
||||
|
||||
gGL.setColorMask(true, false);
|
||||
//render the bookends
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
gPathfindingProgram.uniform1f(sAlphaScale, 0.90f);
|
||||
llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_START );
|
||||
llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_END );
|
||||
gPathfindingProgram.bind();
|
||||
}
|
||||
else
|
||||
{
|
||||
llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_START );
|
||||
llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_END );
|
||||
}
|
||||
|
||||
gGL.setColorMask(true, false);
|
||||
//render the bookends
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
gPathfindingProgram.uniform1f(sAlphaScale, 0.90f);
|
||||
llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_START );
|
||||
llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_END );
|
||||
gPathfindingProgram.bind();
|
||||
}
|
||||
|
||||
if ( pathfindingConsole->isRenderWaterPlane() )
|
||||
{
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
gPathfindingProgram.uniform1f(sAlphaScale, 0.90f);
|
||||
llPathingLibInstance->renderSimpleShapes( gGL, gAgent.getRegion()->getWaterHeight() );
|
||||
}
|
||||
else
|
||||
{
|
||||
llPathingLibInstance->renderSimpleShapes( gGL, gAgent.getRegion()->getWaterHeight() );
|
||||
}
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
gPathfindingProgram.uniform1f(sAlphaScale, 0.90f);
|
||||
llPathingLibInstance->renderSimpleShapes( gGL, gAgent.getRegion()->getWaterHeight() );
|
||||
}
|
||||
//physics/exclusion shapes
|
||||
if ( pathfindingConsole->isRenderAnyShapes() )
|
||||
|
|
@ -5380,18 +5301,11 @@ void LLPipeline::renderDebug()
|
|||
}
|
||||
|
||||
//render edges
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gPathfindingNoNormalsProgram.bind();
|
||||
gPathfindingNoNormalsProgram.uniform1f(sTint, gSavedSettings.getF32("PathfindingXRayTint"));
|
||||
gPathfindingNoNormalsProgram.uniform1f(sAlphaScale, gSavedSettings.getF32("PathfindingXRayOpacity"));
|
||||
llPathingLibInstance->renderNavMeshEdges();
|
||||
gPathfindingProgram.bind();
|
||||
}
|
||||
else
|
||||
{
|
||||
llPathingLibInstance->renderNavMeshEdges();
|
||||
}
|
||||
gPathfindingNoNormalsProgram.bind();
|
||||
gPathfindingNoNormalsProgram.uniform1f(sTint, gSavedSettings.getF32("PathfindingXRayTint"));
|
||||
gPathfindingNoNormalsProgram.uniform1f(sAlphaScale, gSavedSettings.getF32("PathfindingXRayOpacity"));
|
||||
llPathingLibInstance->renderNavMeshEdges();
|
||||
gPathfindingProgram.bind();
|
||||
|
||||
gGL.flush();
|
||||
gGL.setLineWidth(1.0f); // <FS> Line width OGL core profile fix by Rye Mutt
|
||||
|
|
@ -5400,10 +5314,7 @@ void LLPipeline::renderDebug()
|
|||
glPolygonOffset(0.f, 0.f);
|
||||
|
||||
gGL.flush();
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gPathfindingProgram.unbind();
|
||||
}
|
||||
gPathfindingProgram.unbind();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5418,10 +5329,7 @@ void LLPipeline::renderDebug()
|
|||
|
||||
if (!hud_only && !mDebugBlips.empty())
|
||||
{ //render debug blips
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
|
||||
gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep, true);
|
||||
|
||||
|
|
@ -5485,7 +5393,7 @@ void LLPipeline::renderDebug()
|
|||
}
|
||||
}
|
||||
|
||||
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION) && LLGLSLShader::sNoFixedFunction)
|
||||
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION))
|
||||
{ //render visible selected group occlusion geometry
|
||||
gDebugProgram.bind();
|
||||
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
|
||||
|
|
@ -5507,44 +5415,38 @@ void LLPipeline::renderDebug()
|
|||
|
||||
visible_selected_groups.clear();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
|
||||
if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RAYCAST) && !hud_only)
|
||||
{ //draw crosshairs on particle intersection
|
||||
if (gDebugRaycastParticle)
|
||||
{
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{ //this debug display requires shaders
|
||||
gDebugProgram.bind();
|
||||
gDebugProgram.bind();
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
||||
LLVector3 center(gDebugRaycastParticleIntersection.getF32ptr());
|
||||
LLVector3 size(0.1f, 0.1f, 0.1f);
|
||||
LLVector3 center(gDebugRaycastParticleIntersection.getF32ptr());
|
||||
LLVector3 size(0.1f, 0.1f, 0.1f);
|
||||
|
||||
LLVector3 p[6];
|
||||
LLVector3 p[6];
|
||||
|
||||
p[0] = center + size.scaledVec(LLVector3(1,0,0));
|
||||
p[1] = center + size.scaledVec(LLVector3(-1,0,0));
|
||||
p[2] = center + size.scaledVec(LLVector3(0,1,0));
|
||||
p[3] = center + size.scaledVec(LLVector3(0,-1,0));
|
||||
p[4] = center + size.scaledVec(LLVector3(0,0,1));
|
||||
p[5] = center + size.scaledVec(LLVector3(0,0,-1));
|
||||
p[0] = center + size.scaledVec(LLVector3(1,0,0));
|
||||
p[1] = center + size.scaledVec(LLVector3(-1,0,0));
|
||||
p[2] = center + size.scaledVec(LLVector3(0,1,0));
|
||||
p[3] = center + size.scaledVec(LLVector3(0,-1,0));
|
||||
p[4] = center + size.scaledVec(LLVector3(0,0,1));
|
||||
p[5] = center + size.scaledVec(LLVector3(0,0,-1));
|
||||
|
||||
gGL.begin(LLRender::LINES);
|
||||
gGL.diffuseColor3f(1.f, 1.f, 0.f);
|
||||
for (U32 i = 0; i < 6; i++)
|
||||
{
|
||||
gGL.vertex3fv(p[i].mV);
|
||||
}
|
||||
gGL.end();
|
||||
gGL.flush();
|
||||
|
||||
gDebugProgram.unbind();
|
||||
gGL.begin(LLRender::LINES);
|
||||
gGL.diffuseColor3f(1.f, 1.f, 0.f);
|
||||
for (U32 i = 0; i < 6; i++)
|
||||
{
|
||||
gGL.vertex3fv(p[i].mV);
|
||||
}
|
||||
gGL.end();
|
||||
gGL.flush();
|
||||
|
||||
gDebugProgram.unbind();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5777,10 +5679,7 @@ void LLPipeline::renderDebug()
|
|||
}
|
||||
|
||||
gGL.flush();
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.unbind();
|
||||
}
|
||||
gUIProgram.unbind();
|
||||
}
|
||||
|
||||
void LLPipeline::rebuildPools()
|
||||
|
|
@ -6449,11 +6348,6 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
|
|||
LLEnvironment& environment = LLEnvironment::instance();
|
||||
LLSettingsSky::ptr_t psky = environment.getCurrentSky();
|
||||
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gGL.syncMatrices();
|
||||
}
|
||||
|
||||
// Ambient
|
||||
LLColor4 ambient = psky->getTotalAmbient();
|
||||
gGL.setAmbientLightColor(ambient);
|
||||
|
|
@ -6652,11 +6546,6 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
|
|||
// prev site of forward (non-deferred) character light injection, removed by SL-13522 09/20
|
||||
|
||||
// Init GL state
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glDisable(GL_LIGHTING);
|
||||
}
|
||||
|
||||
for (S32 i = 0; i < 8; ++i)
|
||||
{
|
||||
gGL.getLight(i)->disable();
|
||||
|
|
@ -6675,13 +6564,6 @@ void LLPipeline::enableLights(U32 mask)
|
|||
if (mLightMask != mask)
|
||||
{
|
||||
stop_glerror();
|
||||
if (!mLightMask)
|
||||
{
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glEnable(GL_LIGHTING);
|
||||
}
|
||||
}
|
||||
if (mask)
|
||||
{
|
||||
stop_glerror();
|
||||
|
|
@ -6701,13 +6583,6 @@ void LLPipeline::enableLights(U32 mask)
|
|||
}
|
||||
stop_glerror();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glDisable(GL_LIGHTING);
|
||||
}
|
||||
}
|
||||
mLightMask = mask;
|
||||
stop_glerror();
|
||||
}
|
||||
|
|
@ -6758,11 +6633,6 @@ void LLPipeline::enableLightsPreview()
|
|||
{
|
||||
disableLights();
|
||||
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glEnable(GL_LIGHTING);
|
||||
}
|
||||
|
||||
LLColor4 ambient = PreviewAmbientColor;
|
||||
gGL.setAmbientLightColor(ambient);
|
||||
|
||||
|
|
@ -8436,18 +8306,7 @@ void LLPipeline::renderFinalize()
|
|||
|
||||
LLGLDisable blend(GL_BLEND);
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gGlowCombineProgram.bind();
|
||||
}
|
||||
else
|
||||
{
|
||||
// tex unit 0
|
||||
gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_COLOR);
|
||||
// tex unit 1
|
||||
gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_ADD, LLTexUnit::TBS_TEX_COLOR,
|
||||
LLTexUnit::TBS_PREV_COLOR);
|
||||
}
|
||||
gGlowCombineProgram.bind();
|
||||
|
||||
gGL.getTexUnit(0)->bind(&mGlow[1]);
|
||||
// [RLVa:KB] - @setsphere
|
||||
|
|
@ -8460,28 +8319,14 @@ void LLPipeline::renderFinalize()
|
|||
buff->setBuffer(mask);
|
||||
buff->drawArrays(LLRender::TRIANGLE_STRIP, 0, 3);
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gGlowCombineProgram.unbind();
|
||||
}
|
||||
else
|
||||
{
|
||||
gGL.getTexUnit(1)->disable();
|
||||
gGL.getTexUnit(1)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
|
||||
gGL.getTexUnit(0)->activate();
|
||||
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
|
||||
}
|
||||
gGlowCombineProgram.unbind();
|
||||
}
|
||||
|
||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
|
||||
if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PHYSICS_SHAPES))
|
||||
{
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gSplatTextureRectProgram.bind();
|
||||
}
|
||||
gSplatTextureRectProgram.bind();
|
||||
|
||||
gGL.setColorMask(true, false);
|
||||
|
||||
|
|
@ -8510,10 +8355,7 @@ void LLPipeline::renderFinalize()
|
|||
drawAuxiliaryVB(tc1, tc2, LLColor4(1.f, 1.f, 1.f, 0.75f));
|
||||
// </FS:Ansariel>
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gSplatTextureRectProgram.unbind();
|
||||
}
|
||||
gSplatTextureRectProgram.unbind();
|
||||
}
|
||||
|
||||
if (LLRenderTarget::sUseFBO)
|
||||
|
|
@ -9855,17 +9697,11 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
|
|||
renderGeom(camera);
|
||||
}
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
|
||||
LLWorld::getInstance()->renderPropertyLines();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.unbind();
|
||||
}
|
||||
gUIProgram.unbind();
|
||||
|
||||
mWaterDis.flush();
|
||||
}
|
||||
|
|
@ -10419,10 +10255,7 @@ void LLPipeline::generateHighlight(LLCamera& camera)
|
|||
gGL.setColorMask(true, true);
|
||||
mHighlight.clear();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gHighlightProgram.bind();
|
||||
}
|
||||
gHighlightProgram.bind();
|
||||
|
||||
gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep);
|
||||
for (std::set<HighlightItem>::iterator iter = mHighlightSet.begin(); iter != mHighlightSet.end(); )
|
||||
|
|
@ -11304,7 +11137,6 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
|
|||
LL_RECORD_BLOCK_TIME(FTM_GENERATE_IMPOSTOR);
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
LLGLState::checkClientArrays();
|
||||
|
||||
static LLCullResult result;
|
||||
result.clear();
|
||||
|
|
@ -11565,11 +11397,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
|
|||
|
||||
static const F32 clip_plane = 0.99999f;
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gDebugProgram.bind();
|
||||
}
|
||||
|
||||
gDebugProgram.bind();
|
||||
|
||||
if (visually_muted)
|
||||
{ // Visually muted avatar
|
||||
|
|
@ -11583,7 +11411,6 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
|
|||
gGL.diffuseColor4fv(LLColor4::pink.mV );
|
||||
}
|
||||
|
||||
{
|
||||
// <FS:Ansariel> Remove QUADS rendering mode
|
||||
//gGL.begin(LLRender::QUADS);
|
||||
//gGL.vertex3f(-1, -1, clip_plane);
|
||||
|
|
@ -11604,12 +11431,8 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
|
|||
gGL.end();
|
||||
// </FS:Ansariel>
|
||||
gGL.flush();
|
||||
}
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gDebugProgram.unbind();
|
||||
}
|
||||
gDebugProgram.unbind();
|
||||
|
||||
gGL.popMatrix();
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
|
|
@ -11638,7 +11461,6 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
|
|||
LLVertexBuffer::unbind();
|
||||
LLGLState::checkStates();
|
||||
LLGLState::checkTextureChannels();
|
||||
LLGLState::checkClientArrays();
|
||||
}
|
||||
|
||||
bool LLPipeline::hasRenderBatches(const U32 type) const
|
||||
|
|
|
|||
|
|
@ -225,9 +225,7 @@ public:
|
|||
S32 getLightingDetail() const { return mLightingDetail; }
|
||||
S32 getMaxLightingDetail() const;
|
||||
|
||||
void setUseVertexShaders(bool use_shaders);
|
||||
bool getUseVertexShaders() const { return mVertexShadersEnabled; }
|
||||
bool canUseVertexShaders();
|
||||
bool shadersLoaded();
|
||||
bool canUseWindLightShaders() const;
|
||||
bool canUseWindLightShadersOnObjects() const;
|
||||
bool canUseAntiAliasing() const;
|
||||
|
|
@ -733,8 +731,7 @@ public:
|
|||
LLVector4 mTransformedMoonDir;
|
||||
|
||||
bool mInitialized;
|
||||
bool mVertexShadersEnabled;
|
||||
S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed
|
||||
bool mShadersLoaded;
|
||||
|
||||
U32 mTransformFeedbackPrimitives; //number of primitives expected to be generated by transform feedback
|
||||
protected:
|
||||
|
|
@ -938,7 +935,6 @@ public:
|
|||
|
||||
//cached settings
|
||||
static bool WindLightUseAtmosShaders;
|
||||
static bool RenderAvatarVP;
|
||||
static bool RenderDeferred;
|
||||
static F32 RenderDeferredSunWash;
|
||||
static U32 RenderFSAASamples;
|
||||
|
|
|
|||
|
|
@ -208,7 +208,6 @@ void FloaterQuickPrefs::initCallbacks()
|
|||
gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&FloaterQuickPrefs::refreshSettings, this));
|
||||
gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&FloaterQuickPrefs::refreshSettings, this));
|
||||
gSavedSettings.getControl("RenderDeferred")->getSignal()->connect(boost::bind(&FloaterQuickPrefs::refreshSettings, this));
|
||||
gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&FloaterQuickPrefs::refreshSettings, this));
|
||||
gSavedSettings.getControl("RenderShadowDetail")->getSignal()->connect(boost::bind(&FloaterQuickPrefs::refreshSettings, this));
|
||||
gSavedSettings.getControl("FSRenderVignette")->getSignal()->connect(boost::bind(&FloaterQuickPrefs::refreshSettings, this));
|
||||
gSavedSettings.getControl("RenderShadowSplitExponent")->getSignal()->connect(boost::bind(&FloaterQuickPrefs::refreshSettings, this));
|
||||
|
|
@ -1044,7 +1043,6 @@ void FloaterQuickPrefs::refreshSettings()
|
|||
bumpshiny &&
|
||||
shaders &&
|
||||
gGLManager.mHasFramebufferObject &&
|
||||
gSavedSettings.getBOOL("RenderAvatarVP") &&
|
||||
(mCtrlWindLight->get()) ? TRUE : FALSE;
|
||||
|
||||
mCtrlDeferred->setEnabled(enabled);
|
||||
|
|
@ -1121,23 +1119,6 @@ void FloaterQuickPrefs::refreshSettings()
|
|||
mCtrlReflectionDetail->setValue(FALSE);
|
||||
}
|
||||
|
||||
// disabled av
|
||||
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP"))
|
||||
{
|
||||
//deferred needs AvatarVP, disable deferred
|
||||
mCtrlShadowDetail->setEnabled(FALSE);
|
||||
mCtrlShadowDetail->setValue(0);
|
||||
|
||||
mCtrlUseSSAO->setEnabled(FALSE);
|
||||
mCtrlUseSSAO->setValue(FALSE);
|
||||
|
||||
mCtrlUseDoF->setEnabled(FALSE);
|
||||
mCtrlUseDoF->setValue(FALSE);
|
||||
|
||||
mCtrlDeferred->setEnabled(FALSE);
|
||||
mCtrlDeferred->setValue(FALSE);
|
||||
}
|
||||
|
||||
// <FS:CR> FIRE-9630 - Vignette UI controls
|
||||
if (getIsPhototools())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -114,10 +114,7 @@ void RlvOverlayEffect::run(const LLVisualEffectParams*)
|
|||
{
|
||||
if (m_pImage)
|
||||
{
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.bind();
|
||||
}
|
||||
gUIProgram.bind();
|
||||
|
||||
int nWidth = gViewerWindow->getWorldViewWidthScaled();
|
||||
int nHeight = gViewerWindow->getWorldViewHeightScaled();
|
||||
|
|
@ -144,10 +141,7 @@ void RlvOverlayEffect::run(const LLVisualEffectParams*)
|
|||
gGL.flush();
|
||||
gViewerWindow->setup3DRender();
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gUIProgram.unbind();
|
||||
}
|
||||
gUIProgram.unbind();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -661,20 +661,6 @@
|
|||
Low
|
||||
</text>
|
||||
|
||||
<check_box
|
||||
control_name="RenderAvatarVP"
|
||||
height="16"
|
||||
initial_value="true"
|
||||
label="Avatar Hardware skinning"
|
||||
layout="topleft"
|
||||
left="440"
|
||||
name="AvatarVertexProgram"
|
||||
top_delta="16"
|
||||
width="280">
|
||||
<check_box.commit_callback
|
||||
function="Pref.RenderOptionUpdate" />
|
||||
</check_box>
|
||||
|
||||
<check_box
|
||||
control_name="RenderAvatarCloth"
|
||||
height="16"
|
||||
|
|
@ -886,7 +872,7 @@
|
|||
layout="topleft"
|
||||
left="13"
|
||||
name="horiz_border"
|
||||
top_pad="5"
|
||||
top_pad="21"
|
||||
top_delta="5"
|
||||
width="774"/>
|
||||
<button
|
||||
|
|
|
|||
|
|
@ -739,19 +739,6 @@
|
|||
width="128">
|
||||
Avatar Rendering:
|
||||
</text>
|
||||
<check_box
|
||||
control_name="RenderAvatarVP"
|
||||
height="16"
|
||||
initial_value="true"
|
||||
label="Hardware skinning"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
name="AvatarVertexProgram"
|
||||
top_pad="5"
|
||||
width="256">
|
||||
<check_box.commit_callback
|
||||
function="Pref.RenderOptionUpdate" />
|
||||
</check_box>
|
||||
<check_box
|
||||
control_name="RenderAvatarCloth"
|
||||
height="16"
|
||||
|
|
@ -760,7 +747,7 @@
|
|||
layout="topleft"
|
||||
left_delta="0"
|
||||
name="AvatarCloth"
|
||||
top_pad="1"
|
||||
top_pad="5"
|
||||
width="256" />
|
||||
<!-- <FS:LO> remove orphaned code left over from EEP
|
||||
<text
|
||||
|
|
|
|||
Loading…
Reference in New Issue