Track glEnable states via static refs instead of map lookups.
Sync light state, bound shader, and various gl context states similarly to render matrices. Texture handles now refcounted, as multiple viewer textures could ref the same handle (cubemaps do this) Clean up gl extension loading a bit. Not necessary, but only look for ARB variants if not included in current core version. Removed unused extensions. Use core shader api if supported, else use ARB. (FN signatures are identical. Just doing some pointer substitution to ARB if not core.) Attempt at improving VBO update batching. Subdata updates better batched to gether per-frame. There's probably other stuff I forgot that is in this changeset, too. Todo: Fix lightstate assertion when toggling fullscreen with shaders off.
This commit is contained in:
@@ -5683,7 +5683,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
|
||||
|
||||
gGL.getTexUnit(0)->bind(mSilhouetteImagep);
|
||||
LLGLSPipelineSelection gls_select;
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
LLGLEnable<GL_BLEND> blend;
|
||||
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
|
||||
|
||||
if (isAgentAvatarValid() && for_hud)
|
||||
@@ -6188,7 +6188,7 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color)
|
||||
gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);
|
||||
}
|
||||
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
gGL.setPolygonMode(LLRender::PF_FRONT_AND_BACK, LLRender::PM_LINE);
|
||||
|
||||
//Singu Note: Diverges from v3. If sRenderHiddenSelections set, draw non-z-culled wireframe, else draw occluded 'thick' wireframe to create an outline.
|
||||
if (LLSelectMgr::sRenderHiddenSelections) // && gFloaterTools && gFloaterTools->getVisible())
|
||||
@@ -6205,7 +6205,7 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color)
|
||||
{
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
LLGLEnable fog(GL_FOG);
|
||||
LLGLEnable<GL_FOG> 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);
|
||||
@@ -6224,18 +6224,18 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color)
|
||||
}
|
||||
else
|
||||
{
|
||||
LLGLEnable cull_face(GL_CULL_FACE);
|
||||
LLGLEnable offset(GL_POLYGON_OFFSET_LINE);
|
||||
LLGLEnable<GL_CULL_FACE> cull_face;
|
||||
LLGLEnable<GL_POLYGON_OFFSET_LINE> offset;
|
||||
|
||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
gGL.diffuseColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2);
|
||||
glPolygonOffset(3.f, 3.f);
|
||||
glLineWidth(3.f);
|
||||
gGL.setPolygonOffset(3.f, 3.f);
|
||||
gGL.setLineWidth(3.f);
|
||||
pushWireframe(drawable);
|
||||
glLineWidth(1.f);
|
||||
gGL.setLineWidth(1.f);
|
||||
}
|
||||
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
gGL.setPolygonMode(LLRender::PF_FRONT_AND_BACK, LLRender::PM_FILL);
|
||||
gGL.popMatrix();
|
||||
|
||||
if (shader)
|
||||
@@ -6330,7 +6330,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
|
||||
gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE);
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
LLGLEnable fog(GL_FOG);
|
||||
LLGLEnable<GL_FOG> 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);
|
||||
|
||||
Reference in New Issue
Block a user