void LLDrawPoolSky::render(S32 pass) { if (mDrawFace.empty()) { return; } // Don't draw the sky box if we can and are rendering the WL sky dome. if (gPipeline.canUseWindLightShaders()) { return; } // use a shader only underwater if(mVertexShaderLevel > 0 && LLPipeline::sUnderWaterRender) { mShader = &gObjectFullbrightWaterProgram; mShader->bind(); } else { // don't use shaders! if (gGLManager.mHasShaderObjects) { // Ironically, we must support shader objects to be // able to use this call. LLGLSLShader::bindNoShader(); } mShader = NULL; } LLGLSPipelineSkyBox gls_skybox; LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); LLGLSquashToFarClip far_clip(glh_get_current_projection()); LLGLEnable fog_enable( (mVertexShaderLevel < 1 && LLViewerCamera::getInstance()->cameraUnderWater()) ? GL_FOG : 0); gPipeline.disableLights(); LLGLDisable clip(GL_CLIP_PLANE0); glPushMatrix(); LLVector3 origin = LLViewerCamera::getInstance()->getOrigin(); glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); S32 face_count = (S32)mDrawFace.size(); for (S32 i = 0; i < llmin(6, face_count); ++i) { renderSkyCubeFace(i); } LLGLEnable blend(GL_BLEND); glPopMatrix(); }
void LLDrawPoolSky::render(S32 pass) { gGL.flush(); if (mDrawFace.empty()) { return; } // Don't draw the sky box if we can and are rendering the WL sky dome. if (gPipeline.canUseWindLightShaders()) { return; } // don't render sky under water (background just gets cleared to fog color) if(mVertexShaderLevel > 0 && LLPipeline::sUnderWaterRender) { return; } if (LLGLSLShader::sNoFixedFunction) { //just use the UI shader (generic single texture no lighting) gOneTextureNoColorProgram.bind(); } else { // don't use shaders! if (gGLManager.mHasShaderObjects) { // Ironically, we must support shader objects to be // able to use this call. LLGLSLShader::bindNoShader(); } mShader = NULL; } LLGLSPipelineSkyBox gls_skybox; LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); LLGLSquashToFarClip far_clip(glh_get_current_projection()); LLGLEnable fog_enable( (mVertexShaderLevel < 1 && LLViewerCamera::getInstance()->cameraUnderWater()) ? GL_FOG : 0); gPipeline.disableLights(); LLGLDisable clip(GL_CLIP_PLANE0); gGL.pushMatrix(); LLVector3 origin = LLViewerCamera::getInstance()->getOrigin(); gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]); S32 face_count = (S32)mDrawFace.size(); LLVertexBuffer::unbind(); gGL.diffuseColor4f(1,1,1,1); for (S32 i = 0; i < llmin(6, face_count); ++i) { renderSkyCubeFace(i); } gGL.popMatrix(); }