Showing the changes to interface/src/Menu.cpp (1 of 5 files). Show all
Unified · Split
| @@ -1087,6 +1087,40 @@ void Menu::octreeStatsDetailsClosed() { · 1086 unmodified lines | ||
| 1087 | 1087 | } |
| 1088 | 1088 | } |
| 1089 | 1089 | |
| 1090 | +QString Menu::getLODFeedbackText() { | |
| 1091 | + // determine granularity feedback | |
| 1092 | + int boundaryLevelAdjust = getBoundaryLevelAdjust(); | |
| 1093 | + QString granularityFeedback; | |
| 1094 | + | |
| 1095 | + switch (boundaryLevelAdjust) { | |
| 1096 | + case 0: { | |
| 1097 | + granularityFeedback = QString("at standard granularity."); | |
| 1098 | + } break; | |
| 1099 | + case 1: { | |
| 1100 | + granularityFeedback = QString("at half of standard granularity."); | |
| 1101 | + } break; | |
| 1102 | + case 2: { | |
| 1103 | + granularityFeedback = QString("at a third of standard granularity."); | |
| 1104 | + } break; | |
| 1105 | + default: { | |
| 1106 | + granularityFeedback = QString("at 1/%1th of standard granularity.").arg(boundaryLevelAdjust + 1); | |
| 1107 | + } break; | |
| 1108 | + } | |
| 1109 | + | |
| 1110 | + // distance feedback | |
| 1111 | + float voxelSizeScale = getVoxelSizeScale(); | |
| 1112 | + float relativeToDefault = voxelSizeScale / DEFAULT_OCTREE_SIZE_SCALE; | |
| 1113 | + QString result; | |
| 1114 | + if (relativeToDefault > 1.01) { | |
| 1115 | + result = QString("%1 further %2").arg(relativeToDefault,8,'f',2).arg(granularityFeedback); | |
| 1116 | + } else if (relativeToDefault > 0.99) { | |
| 1117 | + result = QString("the default distance %1").arg(granularityFeedback); | |
| 1118 | + } else { | |
| 1119 | + result = QString("%1 of default %2").arg(relativeToDefault,8,'f',3).arg(granularityFeedback); | |
| 1120 | + } | |
| 1121 | + return result; | |
| 1122 | +} | |
| 1123 | + | |
| 1090 | 1124 | void Menu::autoAdjustLOD(float currentFPS) { |
| 1091 | 1125 | // NOTE: our first ~100 samples at app startup are completely all over the place, and we don't |
| 1092 | 1126 | // really want to count them in our average, so we will ignore the real frame rates and stuff |