summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2018-10-10 14:37:49 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2018-10-10 14:37:49 +0100
commitae041779ccc83b1acc8a01528918d52aab9f565f (patch)
tree081bb318a3219ac403581892ce7631b978c600ac
parent5bb57186350fe00ccdc3f28acc3a55861745e193 (diff)
SL-9849 - debug option for show impostor extents
-rw-r--r--indra/newview/llpipelinelistener.cpp6
-rw-r--r--indra/newview/llviewermenu.cpp10
-rw-r--r--indra/newview/llviewermenu.h2
-rw-r--r--indra/newview/llvoavatar.cpp62
-rw-r--r--indra/newview/pipeline.cpp4
-rw-r--r--indra/newview/pipeline.h79
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml10
7 files changed, 109 insertions, 64 deletions
diff --git a/indra/newview/llpipelinelistener.cpp b/indra/newview/llpipelinelistener.cpp
index dfbe689f56..f11cdcf876 100644
--- a/indra/newview/llpipelinelistener.cpp
+++ b/indra/newview/llpipelinelistener.cpp
@@ -87,7 +87,7 @@ namespace {
U32 render_feature = feature_from_string( iter->asString() );
if ( render_feature != 0 )
{
- LLPipeline::toggleRenderDebugControl( render_feature );
+ LLPipeline::toggleRenderDebugFeatureControl( render_feature );
}
}
}
@@ -123,7 +123,7 @@ namespace {
iter != request["displays"].endArray();
++iter)
{
- U32 info_display = info_display_from_string( iter->asString() );
+ U64 info_display = info_display_from_string( iter->asString() );
if ( info_display != 0 )
{
LLPipeline::toggleRenderDebug( info_display );
@@ -134,7 +134,7 @@ namespace {
void has_info_display_wrapper(LLSD const& request)
{
LLEventAPI::Response response(LLSD(), request);
- U32 info_display = info_display_from_string( request["display"].asString() );
+ U64 info_display = info_display_from_string( request["display"].asString() );
if ( info_display != 0 )
{
response["value"] = gPipeline.hasRenderDebugMask(info_display);
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index d2c26dd6e7..6c52f118ad 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -964,7 +964,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t
//////////////////
// INFO DISPLAY //
//////////////////
-U32 info_display_from_string(std::string info_display)
+U64 info_display_from_string(std::string info_display)
{
if ("verify" == info_display)
{
@@ -1082,6 +1082,10 @@ U32 info_display_from_string(std::string info_display)
{
return LLPipeline::RENDER_DEBUG_TRIANGLE_COUNT;
}
+ else if ("impostors" == info_display)
+ {
+ return LLPipeline::RENDER_DEBUG_IMPOSTORS;
+ }
else
{
LL_WARNS() << "unrecognized feature name '" << info_display << "'" << LL_ENDL;
@@ -1093,7 +1097,7 @@ class LLAdvancedToggleInfoDisplay : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- U32 info_display = info_display_from_string( userdata.asString() );
+ U64 info_display = info_display_from_string( userdata.asString() );
LL_INFOS("ViewerMenu") << "toggle " << userdata.asString() << LL_ENDL;
@@ -1111,7 +1115,7 @@ class LLAdvancedCheckInfoDisplay : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- U32 info_display = info_display_from_string( userdata.asString() );
+ U64 info_display = info_display_from_string( userdata.asString() );
bool new_value = false;
if ( info_display != 0 )
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index 7abb0c8e74..6882405407 100644
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -143,7 +143,7 @@ void handle_export_selected( void * );
// Convert strings to internal types
U32 render_type_from_string(std::string render_type);
U32 feature_from_string(std::string feature);
-U32 info_display_from_string(std::string info_display);
+U64 info_display_from_string(std::string info_display);
class LLViewerMenuHolderGL : public LLMenuHolderGL
{
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 85019d5ae0..34e82d878a 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -4943,22 +4943,52 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel)
left *= mImpostorDim.mV[0];
up *= mImpostorDim.mV[1];
- LLGLEnable test(GL_ALPHA_TEST);
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f);
-
- gGL.color4ubv(color.mV);
- gGL.getTexUnit(diffuse_channel)->bind(&mImpostor);
- gGL.begin(LLRender::QUADS);
- gGL.texCoord2f(0,0);
- gGL.vertex3fv((pos+left-up).mV);
- gGL.texCoord2f(1,0);
- gGL.vertex3fv((pos-left-up).mV);
- gGL.texCoord2f(1,1);
- gGL.vertex3fv((pos-left+up).mV);
- gGL.texCoord2f(0,1);
- gGL.vertex3fv((pos+left+up).mV);
- gGL.end();
- gGL.flush();
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_IMPOSTORS))
+ {
+ LLGLEnable blend(GL_BLEND);
+ gGL.setSceneBlendType(LLRender::BT_ADD);
+ gGL.getTexUnit(diffuse_channel)->unbind(LLTexUnit::TT_TEXTURE);
+
+ // gGL.begin(LLRender::QUADS);
+ // gGL.vertex3fv((pos+left-up).mV);
+ // gGL.vertex3fv((pos-left-up).mV);
+ // gGL.vertex3fv((pos-left+up).mV);
+ // gGL.vertex3fv((pos+left+up).mV);
+ // gGL.end();
+
+
+ gGL.begin(LLRender::LINES);
+ gGL.color4f(1.f,1.f,1.f,1.f);
+ glLineWidth(2.f);
+ gGL.vertex3fv((pos+left-up).mV);
+ gGL.vertex3fv((pos-left-up).mV);
+ gGL.vertex3fv((pos-left-up).mV);
+ gGL.vertex3fv((pos-left+up).mV);
+ gGL.vertex3fv((pos-left+up).mV);
+ gGL.vertex3fv((pos+left+up).mV);
+ gGL.vertex3fv((pos+left+up).mV);
+ gGL.vertex3fv((pos+left-up).mV);
+ gGL.end();
+ gGL.flush();
+ }
+ {
+ LLGLEnable test(GL_ALPHA_TEST);
+ gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f);
+
+ gGL.color4ubv(color.mV);
+ gGL.getTexUnit(diffuse_channel)->bind(&mImpostor);
+ gGL.begin(LLRender::QUADS);
+ gGL.texCoord2f(0,0);
+ gGL.vertex3fv((pos+left-up).mV);
+ gGL.texCoord2f(1,0);
+ gGL.vertex3fv((pos-left-up).mV);
+ gGL.texCoord2f(1,1);
+ gGL.vertex3fv((pos-left+up).mV);
+ gGL.texCoord2f(0,1);
+ gGL.vertex3fv((pos+left+up).mV);
+ gGL.end();
+ gGL.flush();
+ }
return 6;
}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 4bfa749d9f..b493219851 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6856,7 +6856,7 @@ bool LLPipeline::toggleRenderTypeControlNegated(S32 type)
}
//static
-void LLPipeline::toggleRenderDebug(U32 bit)
+void LLPipeline::toggleRenderDebug(U64 bit)
{
if (gPipeline.hasRenderDebugMask(bit))
{
@@ -6871,7 +6871,7 @@ void LLPipeline::toggleRenderDebug(U32 bit)
//static
-bool LLPipeline::toggleRenderDebugControl(U32 bit)
+bool LLPipeline::toggleRenderDebugControl(U64 bit)
{
return gPipeline.hasRenderDebugMask(bit);
}
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 85c13487ee..29fe1cbd33 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -330,10 +330,10 @@ public:
void addTrianglesDrawn(S32 index_count, U32 render_type = LLRender::TRIANGLES);
bool hasRenderDebugFeatureMask(const U32 mask) const { return bool(mRenderDebugFeatureMask & mask); }
- bool hasRenderDebugMask(const U32 mask) const { return bool(mRenderDebugMask & mask); }
+ bool hasRenderDebugMask(const U64 mask) const { return bool(mRenderDebugMask & mask); }
void setAllRenderDebugFeatures() { mRenderDebugFeatureMask = 0xffffffff; }
void clearAllRenderDebugFeatures() { mRenderDebugFeatureMask = 0x0; }
- void setAllRenderDebugDisplays() { mRenderDebugMask = 0xffffffff; }
+ void setAllRenderDebugDisplays() { mRenderDebugMask = 0xffffffffffffffff; }
void clearAllRenderDebugDisplays() { mRenderDebugMask = 0x0; }
bool hasRenderType(const U32 type) const;
@@ -357,11 +357,11 @@ public:
// For UI control of render features
static bool hasRenderTypeControl(U32 data);
- static void toggleRenderDebug(U32 data);
+ static void toggleRenderDebug(U64 data);
static void toggleRenderDebugFeature(U32 data);
static void toggleRenderTypeControl(U32 data);
static bool toggleRenderTypeControlNegated(S32 data);
- static bool toggleRenderDebugControl(U32 data);
+ static bool toggleRenderDebugControl(U64 data);
static bool toggleRenderDebugFeatureControl(U32 data);
static void setRenderDebugFeatureControl(U32 bit, bool value);
@@ -500,40 +500,41 @@ public:
RENDER_DEBUG_FEATURE_FOOT_SHADOWS = 0x0100,
};
- enum LLRenderDebugMask
+ enum LLRenderDebugMask: U64
{
- RENDER_DEBUG_COMPOSITION = 0x00000001,
- RENDER_DEBUG_VERIFY = 0x00000002,
- RENDER_DEBUG_BBOXES = 0x00000004,
- RENDER_DEBUG_OCTREE = 0x00000008,
- RENDER_DEBUG_WIND_VECTORS = 0x00000010,
- RENDER_DEBUG_OCCLUSION = 0x00000020,
- RENDER_DEBUG_POINTS = 0x00000040,
- RENDER_DEBUG_TEXTURE_PRIORITY = 0x00000080,
- RENDER_DEBUG_TEXTURE_AREA = 0x00000100,
- RENDER_DEBUG_FACE_AREA = 0x00000200,
- RENDER_DEBUG_PARTICLES = 0x00000400,
- RENDER_DEBUG_GLOW = 0x00000800, // not used
- RENDER_DEBUG_TEXTURE_ANIM = 0x00001000,
- RENDER_DEBUG_LIGHTS = 0x00002000,
- RENDER_DEBUG_BATCH_SIZE = 0x00004000,
- RENDER_DEBUG_ALPHA_BINS = 0x00008000, // not used
- RENDER_DEBUG_RAYCAST = 0x00010000,
- RENDER_DEBUG_AVATAR_DRAW_INFO = 0x00020000,
- RENDER_DEBUG_SHADOW_FRUSTA = 0x00040000,
- RENDER_DEBUG_SCULPTED = 0x00080000,
- RENDER_DEBUG_AVATAR_VOLUME = 0x00100000,
- RENDER_DEBUG_AVATAR_JOINTS = 0x00200000,
- RENDER_DEBUG_BUILD_QUEUE = 0x00400000,
- RENDER_DEBUG_AGENT_TARGET = 0x00800000,
- RENDER_DEBUG_UPDATE_TYPE = 0x01000000,
- RENDER_DEBUG_PHYSICS_SHAPES = 0x02000000,
- RENDER_DEBUG_NORMALS = 0x04000000,
- RENDER_DEBUG_LOD_INFO = 0x08000000,
- RENDER_DEBUG_RENDER_COMPLEXITY = 0x10000000,
- RENDER_DEBUG_ATTACHMENT_BYTES = 0x20000000, // not used
- RENDER_DEBUG_TEXEL_DENSITY = 0x40000000,
- RENDER_DEBUG_TRIANGLE_COUNT = 0x80000000
+ RENDER_DEBUG_COMPOSITION = 0x00000001,
+ RENDER_DEBUG_VERIFY = 0x00000002,
+ RENDER_DEBUG_BBOXES = 0x00000004,
+ RENDER_DEBUG_OCTREE = 0x00000008,
+ RENDER_DEBUG_WIND_VECTORS = 0x00000010,
+ RENDER_DEBUG_OCCLUSION = 0x00000020,
+ RENDER_DEBUG_POINTS = 0x00000040,
+ RENDER_DEBUG_TEXTURE_PRIORITY = 0x00000080,
+ RENDER_DEBUG_TEXTURE_AREA = 0x00000100,
+ RENDER_DEBUG_FACE_AREA = 0x00000200,
+ RENDER_DEBUG_PARTICLES = 0x00000400,
+ RENDER_DEBUG_GLOW = 0x00000800, // not used
+ RENDER_DEBUG_TEXTURE_ANIM = 0x00001000,
+ RENDER_DEBUG_LIGHTS = 0x00002000,
+ RENDER_DEBUG_BATCH_SIZE = 0x00004000,
+ RENDER_DEBUG_ALPHA_BINS = 0x00008000, // not used
+ RENDER_DEBUG_RAYCAST = 0x00010000,
+ RENDER_DEBUG_AVATAR_DRAW_INFO = 0x00020000,
+ RENDER_DEBUG_SHADOW_FRUSTA = 0x00040000,
+ RENDER_DEBUG_SCULPTED = 0x00080000,
+ RENDER_DEBUG_AVATAR_VOLUME = 0x00100000,
+ RENDER_DEBUG_AVATAR_JOINTS = 0x00200000,
+ RENDER_DEBUG_BUILD_QUEUE = 0x00400000,
+ RENDER_DEBUG_AGENT_TARGET = 0x00800000,
+ RENDER_DEBUG_UPDATE_TYPE = 0x01000000,
+ RENDER_DEBUG_PHYSICS_SHAPES = 0x02000000,
+ RENDER_DEBUG_NORMALS = 0x04000000,
+ RENDER_DEBUG_LOD_INFO = 0x08000000,
+ RENDER_DEBUG_RENDER_COMPLEXITY = 0x10000000,
+ RENDER_DEBUG_ATTACHMENT_BYTES = 0x20000000, // not used
+ RENDER_DEBUG_TEXEL_DENSITY = 0x40000000,
+ RENDER_DEBUG_TRIANGLE_COUNT = 0x80000000,
+ RENDER_DEBUG_IMPOSTORS = 0x100000000
};
public:
@@ -670,10 +671,10 @@ protected:
std::stack<std::string> mRenderTypeEnableStack;
U32 mRenderDebugFeatureMask;
- U32 mRenderDebugMask;
+ U64 mRenderDebugMask;
+ U64 mOldRenderDebugMask;
std::stack<U32> mRenderDebugFeatureStack;
- U32 mOldRenderDebugMask;
/////////////////////////////////////////////
//
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 8490d792fa..42744b561f 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -3570,6 +3570,16 @@
function="Advanced.ToggleInfoDisplay"
parameter="agent target" />
</menu_item_check>
+ <menu_item_check
+ label="Show Impostor Extents"
+ name="Show Impostor Extents">
+ <menu_item_check.on_check
+ function="Advanced.CheckInfoDisplay"
+ parameter="impostors" />
+ <menu_item_check.on_click
+ function="Advanced.ToggleInfoDisplay"
+ parameter="impostors" />
+ </menu_item_check>
<!-- Appears not to exist anymore
<menu_item_check
label="Debug Rotation"