[FIRE-32132] Allow rigged mesh transparency to toggle independently

Also added different colours for rigged-blend (orange)/rigged-masked(cyan)
ctrl|alt|shift|T toggles the rigged mesh display on/off
meow-7.2.2
Beq 2022-10-18 02:14:53 +01:00
parent cd7293aecd
commit 7786f2bb9c
4 changed files with 66 additions and 14 deletions

View File

@ -52,6 +52,7 @@
#include "fsperfstats.h" // <FS:Beq> performance stats support
BOOL LLDrawPoolAlpha::sShowDebugAlpha = FALSE;
BOOL LLDrawPoolAlpha::sShowDebugAlphaRigged = FALSE;
#define current_shader (LLGLSLShader::sCurBoundShaderPtr)
@ -300,15 +301,17 @@ void LLDrawPoolAlpha::renderDebugAlpha()
gGL.diffuseColor4f(0, 1, 0, 1);
pushBatches(LLRenderPass::PASS_INVISIBLE, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
// <FS:Beq> FIRE-32132 et al. Allow rigged mesh transparency highlights to be toggled
if (sShowDebugAlphaRigged)
{
// </FS:Beq>
gHighlightProgram.mRiggedVariant->bind();
gGL.diffuseColor4f(1, 0, 0, 1);
gGL.diffuseColor4f(0, 1, 0, 1);// <FS:Beq/> FIRE-32132 et al. (can plain PASS_ALPHA_MASK_RIGGED exist?) paint it green if so.
pushRiggedBatches(LLRenderPass::PASS_ALPHA_MASK_RIGGED, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
pushRiggedBatches(LLRenderPass::PASS_ALPHA_INVISIBLE_RIGGED, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
// Material alpha mask
gGL.diffuseColor4f(0, 0, 1, 1);
gGL.diffuseColor4f(0, 1, 1, 1);// <FS:Beq/> FIRE-32132 et al. Allow rigged mesh transparency highlights to be toggled
pushRiggedBatches(LLRenderPass::PASS_MATERIAL_ALPHA_MASK_RIGGED, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
pushRiggedBatches(LLRenderPass::PASS_NORMMAP_MASK_RIGGED, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
pushRiggedBatches(LLRenderPass::PASS_SPECMAP_MASK_RIGGED, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
@ -317,6 +320,9 @@ void LLDrawPoolAlpha::renderDebugAlpha()
gGL.diffuseColor4f(0, 1, 0, 1);
pushRiggedBatches(LLRenderPass::PASS_INVISIBLE_RIGGED, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
// <FS:Beq> FIRE-32132 et al. Allow rigged mesh transparency highlights to be toggled
}
// </FS:Beq>
LLGLSLShader::sCurBoundShaderPtr->unbind();
}
}
@ -344,16 +350,6 @@ void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask)
for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k)
{
LLDrawInfo& params = **k;
// <FS:Beq> Capture render times
if(params.mFace)
{
LLViewerObject* vobj = (LLViewerObject *)params.mFace->getViewerObject();
if(vobj->isAttachment())
{
trackAttachments( vobj, params.mFace->isState(LLFace::RIGGED), &ratPtr );
}
}
// </FS:Beq>
if (params.mParticle)
{
@ -361,7 +357,30 @@ void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask)
}
bool rigged = (params.mAvatar != nullptr);
// <FS:Beq> Capture render times
if(params.mFace)
{
LLViewerObject* vobj = (LLViewerObject *)params.mFace->getViewerObject();
if(vobj->isAttachment())
{
trackAttachments( vobj, rigged, &ratPtr );
}
}
// </FS:Beq>
gHighlightProgram.bind(rigged);
// <FS:Beq> FIRE-32132 et al. Allow rigged mesh transparency highlights to be toggled
if (rigged && !sShowDebugAlphaRigged)
{
// if we don't want to show rigged alpha highlights then skip
continue;
}
else if (rigged && sShowDebugAlphaRigged)
{
// if we do and this is rigged then use a different colour
gGL.diffuseColor4f(1, 0.5, 0, 1);
}
else // NB dangling else to drop through to "normal behaviour"
// </FS:Beq>
gGL.diffuseColor4f(1, 0, 0, 1);
if (rigged)

View File

@ -66,6 +66,7 @@ public:
bool uploadMatrixPalette(const LLDrawInfo& params);
static BOOL sShowDebugAlpha;
static BOOL sShowDebugAlphaRigged;
private:
LLGLSLShader* target_shader;

View File

@ -11000,6 +11000,26 @@ class LLViewCheckHighlightTransparent : public view_listener_t
return new_value;
}
};
// <FS:Beq> FIRE-32132 et al. Allow rigged mesh transparency highlights to be toggled
class LLViewHighlightTransparentRigged : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
LLDrawPoolAlpha::sShowDebugAlphaRigged = !LLDrawPoolAlpha::sShowDebugAlphaRigged;
gPipeline.resetVertexBuffers();
return true;
}
};
class LLViewCheckHighlightTransparentRigged : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
bool new_value = LLDrawPoolAlpha::sShowDebugAlphaRigged;
return new_value;
}
};
// </FS:Beq>
class LLViewBeaconWidth : public view_listener_t
{
@ -12022,6 +12042,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLViewLookAtLastChatter(), "View.LookAtLastChatter");
view_listener_t::addMenu(new LLViewShowHoverTips(), "View.ShowHoverTips");
view_listener_t::addMenu(new LLViewHighlightTransparent(), "View.HighlightTransparent");
view_listener_t::addMenu(new LLViewHighlightTransparentRigged(), "View.HighlightTransparentRigged"); // <FS:Beq/> FIRE-32132 et al. Allow rigged mesh transparency highlights to be toggled
view_listener_t::addMenu(new LLViewToggleRenderType(), "View.ToggleRenderType");
view_listener_t::addMenu(new LLViewShowHUDAttachments(), "View.ShowHUDAttachments");
view_listener_t::addMenu(new LLZoomer(1.2f), "View.ZoomOut");
@ -12038,6 +12059,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLViewCheckJoystickFlycam(), "View.CheckJoystickFlycam");
view_listener_t::addMenu(new LLViewCheckShowHoverTips(), "View.CheckShowHoverTips");
view_listener_t::addMenu(new LLViewCheckHighlightTransparent(), "View.CheckHighlightTransparent");
view_listener_t::addMenu(new LLViewCheckHighlightTransparentRigged(), "View.CheckHighlightTransparentRigged");// <FS:Beq/> FIRE-32132 et al. Allow rigged mesh transparency highlights to be toggled
view_listener_t::addMenu(new LLViewCheckRenderType(), "View.CheckRenderType");
view_listener_t::addMenu(new LLViewStatusAway(), "View.Status.CheckAway");
view_listener_t::addMenu(new LLViewStatusDoNotDisturb(), "View.Status.CheckDoNotDisturb");

View File

@ -2971,6 +2971,16 @@
<menu_item_check.on_click
function="View.HighlightTransparent" />
</menu_item_check>
<menu_item_check
label="- include Rigged Transparent"
name="Include Transparent Rigged"
shortcut="control|alt|shift|T"
use_mac_ctrl="true">
<menu_item_check.on_check
function="View.CheckHighlightTransparentRigged" />
<menu_item_check.on_click
function="View.HighlightTransparentRigged" />
</menu_item_check>
<menu_item_check
label="Show Mouselook Crosshairs"
name="ShowCrosshairs">