diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index 8633fe00cb..d768f2bb49 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -540,10 +540,22 @@ void LLHeroProbeManager::updateUniforms() void LLHeroProbeManager::renderDebug() { gDebugProgram.bind(); + // Add a bit more metadata to the probe debug view + std::map groupCount; + std::map objCount; + std::map 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); // 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; } } - // + // } diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index b225fcee83..fc86d5f24f 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -1315,7 +1315,7 @@ void LLReflectionMapManager::setUniforms() } -void renderReflectionProbe(LLReflectionMap* probe) +void renderReflectionProbe(LLReflectionMap* probe, std::map groupCount, std::map objCount, std::map 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 groupCount; + std::map objCount; + std::map 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(); diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 0719c28134..623320a2c0 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -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 groupCount, std::map objCount, std::map locCount); // enhanced metadata render for probes class alignas(16) LLReflectionMapManager { LL_ALIGN_NEW