Skip to content

Commit 2bb93a1

Browse files
committed
LODgen: Fixed help messages, fixed linear-interpolation end-point behavior, updated version
1 parent 4edc53f commit 2bb93a1

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

include/DzBridgeAction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ namespace DzBridgeNameSpace
193193
};
194194
Q_INVOKABLE virtual int getELodMethodMin() { return 0; }
195195
Q_INVOKABLE virtual int getELodMethodMax() { return 1; }
196-
ELodMethod m_eLodMethod = ELodMethod::Undefined; //
196+
ELodMethod m_eLodMethod = ELodMethod::Undefined; // WARNING: May need to change this to type int to support additional values in subclasses, depending on compiler handling of enum
197197
virtual ELodMethod getLodMethod() const { return m_eLodMethod; }
198198
int m_nNumberOfLods = -1; // number of LOD levels to generate
199199
bool m_bCreateLodGroup = false;

include/common_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
#define COMMON_MAJOR 2023
66
#define COMMON_MINOR 1
77
#define COMMON_REV 2
8-
#define COMMON_BUILD 60
8+
#define COMMON_BUILD 69
99

1010
#define COMMON_VERSION DZ_MAKE_VERSION( COMMON_MAJOR, COMMON_MINOR, COMMON_REV, COMMON_BUILD )

src/DzBridgeLodSettingsDialog.cpp

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ DzBridgeLodSettingsDialog::DzBridgeLodSettingsDialog(DzBridgeAction* action, QWi
3535
QVBoxLayout* mainLayout = new QVBoxLayout();
3636
mainLayout->setMargin(5);
3737

38-
// Bake Subdivision Levels Explanation
38+
// Level of Detail (LOD) Explanation
3939
QLabel* helpBox = new QLabel();
4040
helpBox->setTextFormat(Qt::RichText);
4141
helpBox->setWordWrap(true);
@@ -50,10 +50,12 @@ interactive realtime 3D applications.") +
5050

5151
QLabel* helpText_LodMethod = new QLabel();
5252
helpText_LodMethod->setTextFormat(Qt::RichText);
53+
helpText_LodMethod->setWordWrap(true);
5354
helpText_LodMethod->setText(
5455
"<p>" +
55-
tr("<b>STEP 1</b>: Select the method for generating LODs.")
56-
);
56+
// tr("<b>STEP 1</b>: Select the method for generating LODs.")
57+
tr("Current method for generating LODs:")
58+
);
5759
mainLayout->addWidget(helpText_LodMethod);
5860

5961
// Create Drop-Down to choose LOD generation method
@@ -72,9 +74,11 @@ interactive realtime 3D applications.") +
7274

7375
QLabel* helpText_NumberOfLod = new QLabel();
7476
helpText_NumberOfLod->setTextFormat(Qt::RichText);
77+
helpText_NumberOfLod->setWordWrap(true);
7578
helpText_NumberOfLod->setText(
7679
"<p>" +
77-
tr("<b>STEP 2</b>: Specify the number of detail levels to generate.")
80+
tr("<b>STEP 1</b>: Specify the number of detail levels to generate. The base mesh resolution counts \
81+
as the first level of detail.")
7882
);
7983
mainLayout->addWidget(helpText_NumberOfLod);
8084

@@ -96,6 +100,17 @@ interactive realtime 3D applications.") +
96100
spacerWidget2->setText("<p>");
97101
mainLayout->addWidget(spacerWidget2);
98102

103+
QLabel* helpText_LodPreset = new QLabel();
104+
helpText_LodPreset->setTextFormat(Qt::RichText);
105+
helpText_LodPreset->setWordWrap(true);
106+
helpText_LodPreset->setText(
107+
"<p>" +
108+
tr("<b>STEP 2</b>: Specify the LOD preset.<br><br>\
109+
The <b>Default</b> preset will use base resolution for closeups and gradually decrease the percent mesh resolution with distance.<br><br>\
110+
The <b>UEFN</b> preset will use base resolution for closeups, then 5000 vertex resolution for full body and gradually decrease further with distance.")
111+
);
112+
mainLayout->addWidget(helpText_LodPreset);
113+
99114
// LOD settings preset dropdown
100115
m_wLodSettingPresetComboBox = new QComboBox(this);
101116
m_wLodSettingPresetComboBox->addItem("Default", "#default");
@@ -290,7 +305,11 @@ void DzBridgeLodSettingsDialog::generateLodLerp(LodInfo start, LodInfo end, int
290305
// add new LOD info object
291306
struct LodInfo* newLodInfo = new LodInfo;
292307
// interpolate between start and finish values
293-
double interpolation = (double)i / numberOfPoints;
308+
double interpolation;
309+
if (numberOfPoints > 1)
310+
interpolation = (double)i / (numberOfPoints-1);
311+
else
312+
interpolation = 1.0;
294313
if (end.quality_vertex != -1)
295314
{
296315
newLodInfo->quality_vertex = (start.quality_vertex * (1.0-interpolation)) + (end.quality_vertex * interpolation);
@@ -315,9 +334,9 @@ void DzBridgeLodSettingsDialog::applyLodPresetHighPerformance()
315334

316335
LodInfo lod0, lod1;
317336
lod0.quality_vertex = getSourceVertexCount();
318-
lod0.threshold_screen_height = 3.0f;
337+
lod0.threshold_screen_height = 3.0f; // full-screen view of head is approximately screen height = 2.0-3.0
319338
lod1.quality_vertex = 5000;
320-
lod1.threshold_screen_height = 2.0f;
339+
lod1.threshold_screen_height = 2.0f; // full-screen view of head is approximately screen height = 2.0-3.0
321340
LodInfo* newLodInfo = new LodInfo;
322341
*newLodInfo = lod0;
323342
m_BridgeAction->m_aLodInfo.append(newLodInfo);
@@ -345,9 +364,9 @@ void DzBridgeLodSettingsDialog::applyLodPresetDefault()
345364
// set first and last lod quality and screen height targets
346365
LodInfo start, end;
347366
start.quality_percent = 1.0f; // 100% quality
348-
start.threshold_screen_height = 2.0f; // head shot is full screen
367+
start.threshold_screen_height = 2.0f; // full-screen view of head is approximately screen height = 2.0-3.0
349368
end.quality_percent = 0.05f; // 10% quality
350-
end.threshold_screen_height = 0.10f; // full-body is 10% of screen
369+
end.threshold_screen_height = 0.10f;
351370

352371
generateLodLerp(start, end, numLODs);
353372
}

0 commit comments

Comments
 (0)