SL-10952 - Look at performance impact of selection outline changes
SL-10973 - [Love Me Render] Mesh Child Prims in Linkset are now Yellow instead of Blue - Fixedmeow-7.2.2
parent
459601625d
commit
f3f75acb23
|
|
@ -608,15 +608,10 @@ void renderFace(LLDrawable* drawable, LLFace *face)
|
|||
LLVOVolume* vobj = drawable->getVOVolume();
|
||||
if (vobj)
|
||||
{
|
||||
LLVertexBuffer::unbind();
|
||||
gGL.pushMatrix();
|
||||
gGL.multMatrix((F32*)vobj->getRelativeXform().mMatrix);
|
||||
|
||||
LLVolume* volume = NULL;
|
||||
|
||||
if (drawable->isState(LLDrawable::RIGGED))
|
||||
{
|
||||
vobj->updateRiggedVolume();
|
||||
volume = vobj->getRiggedVolume();
|
||||
}
|
||||
else
|
||||
|
|
@ -629,44 +624,11 @@ void renderFace(LLDrawable* drawable, LLFace *face)
|
|||
const LLVolumeFace& vol_face = volume->getVolumeFace(face->getTEOffset());
|
||||
LLVertexBuffer::drawElements(LLRender::TRIANGLES, vol_face.mPositions, NULL, vol_face.mNumIndices, vol_face.mIndices);
|
||||
}
|
||||
|
||||
gGL.popMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wireframe_selection, bool bRenderHiddenSelections)
|
||||
void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wireframe_selection, bool bRenderHiddenSelections, bool shader)
|
||||
{
|
||||
//Need to because crash on ATI 3800 (and similar cards) MAINT-5018
|
||||
LLGLDisable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0);
|
||||
|
||||
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
|
||||
|
||||
if (shader)
|
||||
{
|
||||
gDebugProgram.bind();
|
||||
}
|
||||
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
gGL.pushMatrix();
|
||||
|
||||
BOOL is_hud_object = mVObjp->isHUDAttachment();
|
||||
|
||||
if (mDrawablep->isActive())
|
||||
{
|
||||
gGL.loadMatrix(gGLModelView);
|
||||
gGL.multMatrix((F32*)mVObjp->getRenderMatrix().mMatrix);
|
||||
}
|
||||
else if (!is_hud_object)
|
||||
{
|
||||
gGL.loadIdentity();
|
||||
gGL.multMatrix(gGLModelView);
|
||||
LLVector3 trans = mVObjp->getRegion()->getOriginAgent();
|
||||
gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);
|
||||
}
|
||||
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
|
||||
|
||||
if (bRenderHiddenSelections)
|
||||
{
|
||||
gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE);
|
||||
|
|
@ -715,15 +677,6 @@ void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wirefram
|
|||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
renderFace(mDrawablep, this);
|
||||
}
|
||||
|
||||
glLineWidth(1.f);
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
gGL.popMatrix();
|
||||
|
||||
if (shader)
|
||||
{
|
||||
shader->bind();
|
||||
}
|
||||
}
|
||||
|
||||
/* removed in lieu of raycast uv detection
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ public:
|
|||
void renderSelectedUV();
|
||||
|
||||
void renderSelected(LLViewerTexture *image, const LLColor4 &color);
|
||||
void renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wireframe_selection, bool bRenderHiddenSelections);
|
||||
void renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wireframe_selection, bool bRenderHiddenSelections, bool shader);
|
||||
|
||||
F32 getKey() const { return mDistance; }
|
||||
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ LLSelectMgr::LLSelectMgr()
|
|||
sHighlightThickness = gSavedSettings.getF32("SelectionHighlightThickness");
|
||||
sHighlightUScale = gSavedSettings.getF32("SelectionHighlightUScale");
|
||||
sHighlightVScale = gSavedSettings.getF32("SelectionHighlightVScale");
|
||||
sHighlightAlpha = gSavedSettings.getF32("SelectionHighlightAlpha");
|
||||
sHighlightAlpha = gSavedSettings.getF32("SelectionHighlightAlpha") * 2;
|
||||
sHighlightAlphaTest = gSavedSettings.getF32("SelectionHighlightAlphaTest");
|
||||
sHighlightUAnim = gSavedSettings.getF32("SelectionHighlightUAnim");
|
||||
sHighlightVAnim = gSavedSettings.getF32("SelectionHighlightVAnim");
|
||||
|
|
@ -5858,6 +5858,9 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
|
|||
bool wireframe_selection = (gFloaterTools && gFloaterTools->getVisible()) || LLSelectMgr::sRenderHiddenSelections;
|
||||
F32 fogCfx = (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal() - gAgentCamera.getCameraPositionGlobal()).magVec() / (LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec() * 4), 0.0, 1.0);
|
||||
|
||||
static LLColor4 sParentColor = LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha);
|
||||
static LLColor4 sChildColor = LLColor4(sSilhouetteChildColor[VRED], sSilhouetteChildColor[VGREEN], sSilhouetteChildColor[VBLUE], LLSelectMgr::sHighlightAlpha);
|
||||
|
||||
LLUUID focus_item_id = LLViewerMediaFocus::getInstance()->getFocusedObjectID();
|
||||
for (S32 pass = 0; pass < 2; pass++)
|
||||
{
|
||||
|
|
@ -5865,33 +5868,84 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
|
|||
iter != mSelectedObjects->end(); iter++)
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
|
||||
if (getTEMode() && !node->hasSelectedTE())
|
||||
continue;
|
||||
|
||||
LLViewerObject* objectp = node->getObject();
|
||||
if (!objectp)
|
||||
continue;
|
||||
|
||||
if(getTEMode() && !node->hasSelectedTE())
|
||||
continue;
|
||||
|
||||
if (objectp->mDrawable
|
||||
&& objectp->mDrawable->getVOVolume()
|
||||
&& objectp->mDrawable->getVOVolume()->isMesh())
|
||||
{
|
||||
//Need to because crash on ATI 3800 (and similar cards) MAINT-5018
|
||||
LLGLDisable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0);
|
||||
|
||||
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
|
||||
|
||||
if (shader)
|
||||
{
|
||||
gDebugProgram.bind();
|
||||
}
|
||||
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
gGL.pushMatrix();
|
||||
|
||||
BOOL is_hud_object = objectp->isHUDAttachment();
|
||||
|
||||
if (objectp->mDrawable->isActive())
|
||||
{
|
||||
gGL.loadMatrix(gGLModelView);
|
||||
gGL.multMatrix((F32*)objectp->getRenderMatrix().mMatrix);
|
||||
}
|
||||
else if (!is_hud_object)
|
||||
{
|
||||
gGL.loadIdentity();
|
||||
gGL.multMatrix(gGLModelView);
|
||||
LLVector3 trans = objectp->getRegion()->getOriginAgent();
|
||||
gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);
|
||||
}
|
||||
|
||||
LLColor4 hlColor = objectp->isRootEdit() ? sParentColor : sChildColor;
|
||||
bool bRenderHidenSelection = node->isTransient() ? false : LLSelectMgr::sRenderHiddenSelections;
|
||||
|
||||
|
||||
LLVOVolume* vobj = objectp->mDrawable->getVOVolume();
|
||||
if (vobj)
|
||||
{
|
||||
LLVertexBuffer::unbind();
|
||||
gGL.pushMatrix();
|
||||
gGL.multMatrix((F32*)vobj->getRelativeXform().mMatrix);
|
||||
|
||||
if (objectp->mDrawable->isState(LLDrawable::RIGGED))
|
||||
{
|
||||
vobj->updateRiggedVolume();
|
||||
}
|
||||
}
|
||||
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
|
||||
S32 num_tes = llmin((S32)objectp->getNumTEs(), (S32)objectp->getNumFaces()); // avatars have TEs but no faces
|
||||
for (S32 te = 0; te < num_tes; ++te)
|
||||
{
|
||||
if (!getTEMode())
|
||||
if (node->isTESelected(te))
|
||||
{
|
||||
objectp->mDrawable->getFace(te)->renderOneWireframe(
|
||||
LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha * 2)
|
||||
, fogCfx, wireframe_selection, node->isTransient() ? FALSE : LLSelectMgr::sRenderHiddenSelections);
|
||||
}
|
||||
else if(node->isTESelected(te))
|
||||
{
|
||||
objectp->mDrawable->getFace(te)->renderOneWireframe(
|
||||
LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha * 2)
|
||||
, fogCfx, wireframe_selection, node->isTransient() ? FALSE : LLSelectMgr::sRenderHiddenSelections);
|
||||
objectp->mDrawable->getFace(te)->renderOneWireframe(hlColor, fogCfx, wireframe_selection, bRenderHidenSelection, nullptr != shader);
|
||||
}
|
||||
}
|
||||
|
||||
gGL.popMatrix();
|
||||
gGL.popMatrix();
|
||||
|
||||
glLineWidth(1.f);
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
|
||||
if (shader)
|
||||
{
|
||||
shader->bind();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -6450,7 +6504,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
|
|||
gGL.texCoord2fv(tc[0].mV);
|
||||
gGL.vertex3fv( v[0].mV );
|
||||
|
||||
gGL.color4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2);
|
||||
gGL.color4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha);
|
||||
gGL.texCoord2fv( tc[1].mV );
|
||||
gGL.vertex3fv( v[1].mV );
|
||||
|
||||
|
|
@ -6460,7 +6514,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
|
|||
|
||||
gGL.vertex3fv( v[2].mV );
|
||||
|
||||
gGL.color4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2);
|
||||
gGL.color4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha);
|
||||
gGL.texCoord2fv( tc[1].mV );
|
||||
gGL.vertex3fv( v[1].mV );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue