diff options
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index cfdbfd3f03..2e2614e429 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1574,6 +1574,12 @@ LLViewerWindow::LLViewerWindow( ignore_pixel_depth, gSavedSettings.getBOOL("RenderDeferred") ? 0 : gSavedSettings.getU32("RenderFSAASamples")); //don't use window level anti-aliasing if FBOs are enabled + if (!LLViewerShaderMgr::sInitialized) + { //immediately initialize shaders + LLViewerShaderMgr::sInitialized = TRUE; + LLViewerShaderMgr::instance()->setShaders(); + } + if (NULL == mWindow) { LLSplashScreen::update(LLTrans::getString("StartupRequireDriverUpdate")); @@ -1710,23 +1716,26 @@ LLViewerWindow::LLViewerWindow( void LLViewerWindow::initGLDefaults() { gGL.setSceneBlendType(LLRender::BT_ALPHA); - 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); - - glPixelStorei(GL_PACK_ALIGNMENT,1); - glPixelStorei(GL_UNPACK_ALIGNMENT,1); + if (!LLGLSLShader::sNoFixedFunction) + { //initialize fixed function state + glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ); - gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); + 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 ); + // lights for objects + glShadeModel( GL_SMOOTH ); - gGL.setAmbientLightColor(LLColor4::black); - - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); + gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + } + glPixelStorei(GL_PACK_ALIGNMENT,1); + glPixelStorei(GL_UNPACK_ALIGNMENT,1); + + gGL.setAmbientLightColor(LLColor4::black); + glCullFace(GL_BACK); // RN: Need this for translation and stretch manip. |