Don't use fixed functions when using shader renderer; found by Drake Arconis (Alchemy Viewer)

meow-7.2.2
Ansariel 2017-03-05 18:31:05 +01:00
parent c579ea0459
commit 0bb591c8aa
1 changed files with 28 additions and 14 deletions

View File

@ -6485,13 +6485,20 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color)
}
else
{
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
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);
{
@ -6613,13 +6620,20 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &aColor)
{
gGL.flush();
gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE);
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
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>
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL);
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);