Enhanced debug rendering for probes
parent
44bffc6b59
commit
1b2b80e203
|
|
@ -540,10 +540,22 @@ void LLHeroProbeManager::updateUniforms()
|
|||
void LLHeroProbeManager::renderDebug()
|
||||
{
|
||||
gDebugProgram.bind();
|
||||
// <FS:Beq> Add a bit more metadata to the probe debug view
|
||||
std::map<LLSpatialGroup*, int> groupCount;
|
||||
std::map<LLViewerObject*, int> objCount;
|
||||
std::map<F32*, int> locCount;
|
||||
|
||||
for (LLReflectionMap* probe : mProbes)
|
||||
{
|
||||
if (!probe->isRelevant()) continue;
|
||||
groupCount[ probe->mGroup ]++;
|
||||
objCount[ probe->mViewerObject ]++;
|
||||
locCount[ probe->mOrigin.getF32ptr() ]++;
|
||||
}
|
||||
// </FS:Beq>
|
||||
for (auto& probe : mProbes)
|
||||
{
|
||||
renderReflectionProbe(probe);
|
||||
renderReflectionProbe(probe, groupCount, objCount, locCount); // <FS:Beq/> Add a bit more metadata to the probe debug view
|
||||
}
|
||||
|
||||
gDebugProgram.unbind();
|
||||
|
|
@ -658,7 +670,7 @@ bool LLHeroProbeManager::registerViewerObject(LLVOVolume* drawablep)
|
|||
// Probe isn't in our list for consideration. Add it.
|
||||
mHeroVOList.push_back(drawablep);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -680,6 +692,6 @@ void LLHeroProbeManager::unregisterViewerObject(LLVOVolume* drawablep)
|
|||
mDefaultProbe->mViewerObject = nullptr;
|
||||
}
|
||||
}
|
||||
// </FS:Beq>
|
||||
// </FS:Beq>
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1315,7 +1315,7 @@ void LLReflectionMapManager::setUniforms()
|
|||
}
|
||||
|
||||
|
||||
void renderReflectionProbe(LLReflectionMap* probe)
|
||||
void renderReflectionProbe(LLReflectionMap* probe, std::map<LLSpatialGroup*, int> groupCount, std::map<LLViewerObject*, int> objCount, std::map<F32*, int> locCount)
|
||||
{
|
||||
if (probe->isRelevant())
|
||||
{
|
||||
|
|
@ -1338,7 +1338,7 @@ void renderReflectionProbe(LLReflectionMap* probe)
|
|||
gGL.end();
|
||||
gGL.flush();
|
||||
|
||||
gGL.diffuseColor4f(1, 1, 0, 1);
|
||||
gGL.diffuseColor4f(0, 1, 1, 1);
|
||||
gGL.begin(gGL.LINES);
|
||||
for (auto& neighbor : probe->mNeighbors)
|
||||
{
|
||||
|
|
@ -1350,6 +1350,45 @@ void renderReflectionProbe(LLReflectionMap* probe)
|
|||
}
|
||||
gGL.end();
|
||||
gGL.flush();
|
||||
|
||||
// --- New: draw a point at the probe origin color-coded by type ---
|
||||
bool dupByGroup = (probe->mGroup && groupCount[ probe->mGroup ] > 1);
|
||||
bool dupByObject= (probe->mViewerObject && objCount[ probe->mViewerObject ] > 1);
|
||||
bool dupByLoc = ( locCount[ probe->mOrigin.getF32ptr()] > 1);
|
||||
|
||||
const bool is_manual = probe->mViewerObject != nullptr;
|
||||
const bool is_automatic = (probe->mGroup != nullptr) && !is_manual;
|
||||
// terrain/water is when neither manual nor automatic
|
||||
// const bool is_terrain = !is_manual && !is_automatic;
|
||||
|
||||
if (is_manual)
|
||||
{
|
||||
// red dot for manual probes
|
||||
gGL.diffuseColor4f(1.f, 0.f, 0.f, 1.f);
|
||||
}
|
||||
else if (is_automatic)
|
||||
{
|
||||
// blue dot for automatic probes
|
||||
gGL.diffuseColor4f(0.f, 0.f, 1.f, 1.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
// green dot for terrain/water probes
|
||||
gGL.diffuseColor4f(0.f, 1.f, 0.f, 1.f);
|
||||
}
|
||||
|
||||
// use a bigger dot if *any* duplicate condition is true
|
||||
const float normalSize = 9.f;
|
||||
const float bigSize = 18.f;
|
||||
float pointSize = (dupByGroup || dupByObject || dupByLoc)
|
||||
? bigSize
|
||||
: normalSize;
|
||||
glPointSize(pointSize);
|
||||
gGL.begin(gGL.POINTS);
|
||||
gGL.vertex3fv(po);
|
||||
gGL.end();
|
||||
gGL.flush();
|
||||
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
@ -1403,10 +1442,21 @@ void renderReflectionProbe(LLReflectionMap* probe)
|
|||
void LLReflectionMapManager::renderDebug()
|
||||
{
|
||||
gDebugProgram.bind();
|
||||
|
||||
std::map<LLSpatialGroup*, int> groupCount;
|
||||
std::map<LLViewerObject*, int> objCount;
|
||||
std::map<F32*, int> locCount;
|
||||
|
||||
for (LLReflectionMap* probe : mProbes)
|
||||
{
|
||||
if (!probe->isRelevant()) continue;
|
||||
groupCount[ probe->mGroup ]++;
|
||||
objCount[ probe->mViewerObject ]++;
|
||||
locCount[ probe->mOrigin.getF32ptr() ]++;
|
||||
}
|
||||
for (auto& probe : mProbes)
|
||||
{
|
||||
renderReflectionProbe(probe);
|
||||
renderReflectionProbe(probe, groupCount, objCount, locCount);
|
||||
}
|
||||
|
||||
gDebugProgram.unbind();
|
||||
|
|
|
|||
|
|
@ -43,8 +43,7 @@ class LLViewerObject;
|
|||
// reflection probe mininum scale
|
||||
#define LL_REFLECTION_PROBE_MINIMUM_SCALE 1.f;
|
||||
|
||||
void renderReflectionProbe(LLReflectionMap* probe);
|
||||
|
||||
void renderReflectionProbe(LLReflectionMap* probe, std::map<LLSpatialGroup*, int> groupCount, std::map<LLViewerObject*, int> objCount, std::map<F32*, int> locCount); // <FS:Beq/> enhanced metadata render for probes
|
||||
class alignas(16) LLReflectionMapManager
|
||||
{
|
||||
LL_ALIGN_NEW
|
||||
|
|
|
|||
Loading…
Reference in New Issue