|
|
@@ -12,36 +12,36 @@ enum class GraphicsQuality : uint8_t {
|
|
|
};
|
|
|
|
|
|
struct LODMultipliers {
|
|
|
- float humanoidFull;
|
|
|
- float humanoidReduced;
|
|
|
- float humanoidMinimal;
|
|
|
- float humanoidBillboard;
|
|
|
-
|
|
|
- float horseFull;
|
|
|
- float horseReduced;
|
|
|
- float horseMinimal;
|
|
|
- float horseBillboard;
|
|
|
-
|
|
|
- float shadowDistance;
|
|
|
- bool enableShadows;
|
|
|
+ float humanoid_full;
|
|
|
+ float humanoid_reduced;
|
|
|
+ float humanoid_minimal;
|
|
|
+ float humanoid_billboard;
|
|
|
+
|
|
|
+ float horse_full;
|
|
|
+ float horse_reduced;
|
|
|
+ float horse_minimal;
|
|
|
+ float horse_billboard;
|
|
|
+
|
|
|
+ float shadow_distance;
|
|
|
+ bool enable_shadows;
|
|
|
};
|
|
|
|
|
|
struct GraphicsFeatures {
|
|
|
- bool enableFacialHair;
|
|
|
- bool enableManeDetail;
|
|
|
- bool enableTailDetail;
|
|
|
- bool enableArmorDetail;
|
|
|
- bool enableEquipmentDetail;
|
|
|
- bool enableGroundShadows;
|
|
|
- bool enablePoseCache;
|
|
|
+ bool enable_facial_hair;
|
|
|
+ bool enable_mane_detail;
|
|
|
+ bool enable_tail_detail;
|
|
|
+ bool enable_armor_detail;
|
|
|
+ bool enable_equipment_detail;
|
|
|
+ bool enable_ground_shadows;
|
|
|
+ bool enable_pose_cache;
|
|
|
};
|
|
|
|
|
|
struct BatchingConfig {
|
|
|
- bool forceBatching;
|
|
|
- bool neverBatch;
|
|
|
- int batchingUnitThreshold;
|
|
|
- float batchingZoomStart;
|
|
|
- float batchingZoomFull;
|
|
|
+ bool force_batching;
|
|
|
+ bool never_batch;
|
|
|
+ int batching_unit_threshold;
|
|
|
+ float batching_zoom_start;
|
|
|
+ float batching_zoom_full;
|
|
|
};
|
|
|
|
|
|
class GraphicsSettings {
|
|
|
@@ -60,84 +60,84 @@ public:
|
|
|
applyPreset(q);
|
|
|
}
|
|
|
|
|
|
- [[nodiscard]] auto lodMultipliers() const noexcept -> const LODMultipliers & {
|
|
|
- return m_lodMultipliers;
|
|
|
+ [[nodiscard]] auto lod_multipliers() const noexcept -> const LODMultipliers & {
|
|
|
+ return m_lod_multipliers;
|
|
|
}
|
|
|
|
|
|
[[nodiscard]] auto features() const noexcept -> const GraphicsFeatures & {
|
|
|
return m_features;
|
|
|
}
|
|
|
|
|
|
- [[nodiscard]] auto batchingConfig() const noexcept -> const BatchingConfig & {
|
|
|
- return m_batchingConfig;
|
|
|
+ [[nodiscard]] auto batching_config() const noexcept -> const BatchingConfig & {
|
|
|
+ return m_batching_config;
|
|
|
}
|
|
|
|
|
|
[[nodiscard]] auto
|
|
|
- calculateBatchingRatio(int visibleUnits,
|
|
|
- float cameraHeight) const noexcept -> float {
|
|
|
- if (m_batchingConfig.neverBatch) {
|
|
|
+ calculate_batching_ratio(int visible_units,
|
|
|
+ float camera_height) const noexcept -> float {
|
|
|
+ if (m_batching_config.never_batch) {
|
|
|
return 0.0F;
|
|
|
}
|
|
|
- if (m_batchingConfig.forceBatching) {
|
|
|
+ if (m_batching_config.force_batching) {
|
|
|
return 1.0F;
|
|
|
}
|
|
|
|
|
|
- float unitFactor = 0.0F;
|
|
|
- if (visibleUnits > m_batchingConfig.batchingUnitThreshold) {
|
|
|
+ float unit_factor = 0.0F;
|
|
|
+ if (visible_units > m_batching_config.batching_unit_threshold) {
|
|
|
|
|
|
- int excess = visibleUnits - m_batchingConfig.batchingUnitThreshold;
|
|
|
- int range = m_batchingConfig.batchingUnitThreshold * 3;
|
|
|
- unitFactor = static_cast<float>(excess) / static_cast<float>(range);
|
|
|
- unitFactor =
|
|
|
- unitFactor < 0.0F ? 0.0F : (unitFactor > 1.0F ? 1.0F : unitFactor);
|
|
|
+ int excess = visible_units - m_batching_config.batching_unit_threshold;
|
|
|
+ int range = m_batching_config.batching_unit_threshold * 3;
|
|
|
+ unit_factor = static_cast<float>(excess) / static_cast<float>(range);
|
|
|
+ unit_factor =
|
|
|
+ unit_factor < 0.0F ? 0.0F : (unit_factor > 1.0F ? 1.0F : unit_factor);
|
|
|
}
|
|
|
|
|
|
- float zoomFactor = 0.0F;
|
|
|
- if (cameraHeight > m_batchingConfig.batchingZoomStart) {
|
|
|
- float range = m_batchingConfig.batchingZoomFull -
|
|
|
- m_batchingConfig.batchingZoomStart;
|
|
|
+ float zoom_factor = 0.0F;
|
|
|
+ if (camera_height > m_batching_config.batching_zoom_start) {
|
|
|
+ float range = m_batching_config.batching_zoom_full -
|
|
|
+ m_batching_config.batching_zoom_start;
|
|
|
if (range > 0.0F) {
|
|
|
- zoomFactor =
|
|
|
- (cameraHeight - m_batchingConfig.batchingZoomStart) / range;
|
|
|
- zoomFactor =
|
|
|
- zoomFactor < 0.0F ? 0.0F : (zoomFactor > 1.0F ? 1.0F : zoomFactor);
|
|
|
+ zoom_factor =
|
|
|
+ (camera_height - m_batching_config.batching_zoom_start) / range;
|
|
|
+ zoom_factor =
|
|
|
+ zoom_factor < 0.0F ? 0.0F : (zoom_factor > 1.0F ? 1.0F : zoom_factor);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return unitFactor > zoomFactor ? unitFactor : zoomFactor;
|
|
|
+ return unit_factor > zoom_factor ? unit_factor : zoom_factor;
|
|
|
}
|
|
|
|
|
|
- [[nodiscard]] auto humanoidFullDetailDistance() const noexcept -> float {
|
|
|
- return kBaseHumanoidFull * m_lodMultipliers.humanoidFull;
|
|
|
+ [[nodiscard]] auto humanoid_full_detail_distance() const noexcept -> float {
|
|
|
+ return kBaseHumanoidFull * m_lod_multipliers.humanoid_full;
|
|
|
}
|
|
|
- [[nodiscard]] auto humanoidReducedDetailDistance() const noexcept -> float {
|
|
|
- return kBaseHumanoidReduced * m_lodMultipliers.humanoidReduced;
|
|
|
+ [[nodiscard]] auto humanoid_reduced_detail_distance() const noexcept -> float {
|
|
|
+ return kBaseHumanoidReduced * m_lod_multipliers.humanoid_reduced;
|
|
|
}
|
|
|
- [[nodiscard]] auto humanoidMinimalDetailDistance() const noexcept -> float {
|
|
|
- return kBaseHumanoidMinimal * m_lodMultipliers.humanoidMinimal;
|
|
|
+ [[nodiscard]] auto humanoid_minimal_detail_distance() const noexcept -> float {
|
|
|
+ return kBaseHumanoidMinimal * m_lod_multipliers.humanoid_minimal;
|
|
|
}
|
|
|
- [[nodiscard]] auto humanoidBillboardDistance() const noexcept -> float {
|
|
|
- return kBaseHumanoidBillboard * m_lodMultipliers.humanoidBillboard;
|
|
|
+ [[nodiscard]] auto humanoid_billboard_distance() const noexcept -> float {
|
|
|
+ return kBaseHumanoidBillboard * m_lod_multipliers.humanoid_billboard;
|
|
|
}
|
|
|
|
|
|
- [[nodiscard]] auto horseFullDetailDistance() const noexcept -> float {
|
|
|
- return kBaseHorseFull * m_lodMultipliers.horseFull;
|
|
|
+ [[nodiscard]] auto horse_full_detail_distance() const noexcept -> float {
|
|
|
+ return kBaseHorseFull * m_lod_multipliers.horse_full;
|
|
|
}
|
|
|
- [[nodiscard]] auto horseReducedDetailDistance() const noexcept -> float {
|
|
|
- return kBaseHorseReduced * m_lodMultipliers.horseReduced;
|
|
|
+ [[nodiscard]] auto horse_reduced_detail_distance() const noexcept -> float {
|
|
|
+ return kBaseHorseReduced * m_lod_multipliers.horse_reduced;
|
|
|
}
|
|
|
- [[nodiscard]] auto horseMinimalDetailDistance() const noexcept -> float {
|
|
|
- return kBaseHorseMinimal * m_lodMultipliers.horseMinimal;
|
|
|
+ [[nodiscard]] auto horse_minimal_detail_distance() const noexcept -> float {
|
|
|
+ return kBaseHorseMinimal * m_lod_multipliers.horse_minimal;
|
|
|
}
|
|
|
- [[nodiscard]] auto horseBillboardDistance() const noexcept -> float {
|
|
|
- return kBaseHorseBillboard * m_lodMultipliers.horseBillboard;
|
|
|
+ [[nodiscard]] auto horse_billboard_distance() const noexcept -> float {
|
|
|
+ return kBaseHorseBillboard * m_lod_multipliers.horse_billboard;
|
|
|
}
|
|
|
|
|
|
- [[nodiscard]] auto shadowMaxDistance() const noexcept -> float {
|
|
|
- return m_lodMultipliers.shadowDistance;
|
|
|
+ [[nodiscard]] auto shadow_max_distance() const noexcept -> float {
|
|
|
+ return m_lod_multipliers.shadow_distance;
|
|
|
}
|
|
|
- [[nodiscard]] auto shadowsEnabled() const noexcept -> bool {
|
|
|
- return m_lodMultipliers.enableShadows;
|
|
|
+ [[nodiscard]] auto shadows_enabled() const noexcept -> bool {
|
|
|
+ return m_lod_multipliers.enable_shadows;
|
|
|
}
|
|
|
|
|
|
private:
|
|
|
@@ -147,109 +147,109 @@ private:
|
|
|
switch (q) {
|
|
|
case GraphicsQuality::Low:
|
|
|
|
|
|
- m_lodMultipliers = {.humanoidFull = 0.8F,
|
|
|
- .humanoidReduced = 0.8F,
|
|
|
- .humanoidMinimal = 0.8F,
|
|
|
- .humanoidBillboard = 0.8F,
|
|
|
- .horseFull = 0.8F,
|
|
|
- .horseReduced = 0.8F,
|
|
|
- .horseMinimal = 0.8F,
|
|
|
- .horseBillboard = 0.8F,
|
|
|
- .shadowDistance = 25.0F,
|
|
|
- .enableShadows = true};
|
|
|
- m_features = {.enableFacialHair = false,
|
|
|
- .enableManeDetail = false,
|
|
|
- .enableTailDetail = false,
|
|
|
- .enableArmorDetail = true,
|
|
|
- .enableEquipmentDetail = true,
|
|
|
- .enableGroundShadows = true,
|
|
|
- .enablePoseCache = true};
|
|
|
- m_batchingConfig = {.forceBatching = true,
|
|
|
- .neverBatch = false,
|
|
|
- .batchingUnitThreshold = 0,
|
|
|
- .batchingZoomStart = 0.0F,
|
|
|
- .batchingZoomFull = 0.0F};
|
|
|
+ m_lod_multipliers = {.humanoid_full = 0.8F,
|
|
|
+ .humanoid_reduced = 0.8F,
|
|
|
+ .humanoid_minimal = 0.8F,
|
|
|
+ .humanoid_billboard = 0.8F,
|
|
|
+ .horse_full = 0.8F,
|
|
|
+ .horse_reduced = 0.8F,
|
|
|
+ .horse_minimal = 0.8F,
|
|
|
+ .horse_billboard = 0.8F,
|
|
|
+ .shadow_distance = 25.0F,
|
|
|
+ .enable_shadows = true};
|
|
|
+ m_features = {.enable_facial_hair = false,
|
|
|
+ .enable_mane_detail = false,
|
|
|
+ .enable_tail_detail = false,
|
|
|
+ .enable_armor_detail = true,
|
|
|
+ .enable_equipment_detail = true,
|
|
|
+ .enable_ground_shadows = true,
|
|
|
+ .enable_pose_cache = true};
|
|
|
+ m_batching_config = {.force_batching = true,
|
|
|
+ .never_batch = false,
|
|
|
+ .batching_unit_threshold = 0,
|
|
|
+ .batching_zoom_start = 0.0F,
|
|
|
+ .batching_zoom_full = 0.0F};
|
|
|
break;
|
|
|
|
|
|
case GraphicsQuality::Medium:
|
|
|
|
|
|
- m_lodMultipliers = {.humanoidFull = 1.0F,
|
|
|
- .humanoidReduced = 1.0F,
|
|
|
- .humanoidMinimal = 1.0F,
|
|
|
- .humanoidBillboard = 1.0F,
|
|
|
- .horseFull = 1.0F,
|
|
|
- .horseReduced = 1.0F,
|
|
|
- .horseMinimal = 1.0F,
|
|
|
- .horseBillboard = 1.0F,
|
|
|
- .shadowDistance = 40.0F,
|
|
|
- .enableShadows = true};
|
|
|
- m_features = {.enableFacialHair = true,
|
|
|
- .enableManeDetail = true,
|
|
|
- .enableTailDetail = true,
|
|
|
- .enableArmorDetail = true,
|
|
|
- .enableEquipmentDetail = true,
|
|
|
- .enableGroundShadows = true,
|
|
|
- .enablePoseCache = true};
|
|
|
-
|
|
|
- m_batchingConfig = {.forceBatching = false,
|
|
|
- .neverBatch = false,
|
|
|
- .batchingUnitThreshold = 30,
|
|
|
- .batchingZoomStart = 60.0F,
|
|
|
- .batchingZoomFull = 90.0F};
|
|
|
+ m_lod_multipliers = {.humanoid_full = 1.0F,
|
|
|
+ .humanoid_reduced = 1.0F,
|
|
|
+ .humanoid_minimal = 1.0F,
|
|
|
+ .humanoid_billboard = 1.0F,
|
|
|
+ .horse_full = 1.0F,
|
|
|
+ .horse_reduced = 1.0F,
|
|
|
+ .horse_minimal = 1.0F,
|
|
|
+ .horse_billboard = 1.0F,
|
|
|
+ .shadow_distance = 40.0F,
|
|
|
+ .enable_shadows = true};
|
|
|
+ m_features = {.enable_facial_hair = true,
|
|
|
+ .enable_mane_detail = true,
|
|
|
+ .enable_tail_detail = true,
|
|
|
+ .enable_armor_detail = true,
|
|
|
+ .enable_equipment_detail = true,
|
|
|
+ .enable_ground_shadows = true,
|
|
|
+ .enable_pose_cache = true};
|
|
|
+
|
|
|
+ m_batching_config = {.force_batching = false,
|
|
|
+ .never_batch = false,
|
|
|
+ .batching_unit_threshold = 30,
|
|
|
+ .batching_zoom_start = 60.0F,
|
|
|
+ .batching_zoom_full = 90.0F};
|
|
|
break;
|
|
|
|
|
|
case GraphicsQuality::High:
|
|
|
|
|
|
- m_lodMultipliers = {.humanoidFull = 2.0F,
|
|
|
- .humanoidReduced = 2.0F,
|
|
|
- .humanoidMinimal = 2.0F,
|
|
|
- .humanoidBillboard = 2.0F,
|
|
|
- .horseFull = 2.0F,
|
|
|
- .horseReduced = 2.0F,
|
|
|
- .horseMinimal = 2.0F,
|
|
|
- .horseBillboard = 2.0F,
|
|
|
- .shadowDistance = 80.0F,
|
|
|
- .enableShadows = true};
|
|
|
- m_features = {.enableFacialHair = true,
|
|
|
- .enableManeDetail = true,
|
|
|
- .enableTailDetail = true,
|
|
|
- .enableArmorDetail = true,
|
|
|
- .enableEquipmentDetail = true,
|
|
|
- .enableGroundShadows = true,
|
|
|
- .enablePoseCache = true};
|
|
|
-
|
|
|
- m_batchingConfig = {.forceBatching = false,
|
|
|
- .neverBatch = false,
|
|
|
- .batchingUnitThreshold = 50,
|
|
|
- .batchingZoomStart = 80.0F,
|
|
|
- .batchingZoomFull = 120.0F};
|
|
|
+ m_lod_multipliers = {.humanoid_full = 2.0F,
|
|
|
+ .humanoid_reduced = 2.0F,
|
|
|
+ .humanoid_minimal = 2.0F,
|
|
|
+ .humanoid_billboard = 2.0F,
|
|
|
+ .horse_full = 2.0F,
|
|
|
+ .horse_reduced = 2.0F,
|
|
|
+ .horse_minimal = 2.0F,
|
|
|
+ .horse_billboard = 2.0F,
|
|
|
+ .shadow_distance = 80.0F,
|
|
|
+ .enable_shadows = true};
|
|
|
+ m_features = {.enable_facial_hair = true,
|
|
|
+ .enable_mane_detail = true,
|
|
|
+ .enable_tail_detail = true,
|
|
|
+ .enable_armor_detail = true,
|
|
|
+ .enable_equipment_detail = true,
|
|
|
+ .enable_ground_shadows = true,
|
|
|
+ .enable_pose_cache = true};
|
|
|
+
|
|
|
+ m_batching_config = {.force_batching = false,
|
|
|
+ .never_batch = false,
|
|
|
+ .batching_unit_threshold = 50,
|
|
|
+ .batching_zoom_start = 80.0F,
|
|
|
+ .batching_zoom_full = 120.0F};
|
|
|
break;
|
|
|
|
|
|
case GraphicsQuality::Ultra:
|
|
|
|
|
|
- m_lodMultipliers = {.humanoidFull = 100.0F,
|
|
|
- .humanoidReduced = 100.0F,
|
|
|
- .humanoidMinimal = 100.0F,
|
|
|
- .humanoidBillboard = 100.0F,
|
|
|
- .horseFull = 100.0F,
|
|
|
- .horseReduced = 100.0F,
|
|
|
- .horseMinimal = 100.0F,
|
|
|
- .horseBillboard = 100.0F,
|
|
|
- .shadowDistance = 200.0F,
|
|
|
- .enableShadows = true};
|
|
|
- m_features = {.enableFacialHair = true,
|
|
|
- .enableManeDetail = true,
|
|
|
- .enableTailDetail = true,
|
|
|
- .enableArmorDetail = true,
|
|
|
- .enableEquipmentDetail = true,
|
|
|
- .enableGroundShadows = true,
|
|
|
- .enablePoseCache = false};
|
|
|
-
|
|
|
- m_batchingConfig = {.forceBatching = false,
|
|
|
- .neverBatch = true,
|
|
|
- .batchingUnitThreshold = 999999,
|
|
|
- .batchingZoomStart = 999999.0F,
|
|
|
- .batchingZoomFull = 999999.0F};
|
|
|
+ m_lod_multipliers = {.humanoid_full = 100.0F,
|
|
|
+ .humanoid_reduced = 100.0F,
|
|
|
+ .humanoid_minimal = 100.0F,
|
|
|
+ .humanoid_billboard = 100.0F,
|
|
|
+ .horse_full = 100.0F,
|
|
|
+ .horse_reduced = 100.0F,
|
|
|
+ .horse_minimal = 100.0F,
|
|
|
+ .horse_billboard = 100.0F,
|
|
|
+ .shadow_distance = 200.0F,
|
|
|
+ .enable_shadows = true};
|
|
|
+ m_features = {.enable_facial_hair = true,
|
|
|
+ .enable_mane_detail = true,
|
|
|
+ .enable_tail_detail = true,
|
|
|
+ .enable_armor_detail = true,
|
|
|
+ .enable_equipment_detail = true,
|
|
|
+ .enable_ground_shadows = true,
|
|
|
+ .enable_pose_cache = false};
|
|
|
+
|
|
|
+ m_batching_config = {.force_batching = false,
|
|
|
+ .never_batch = true,
|
|
|
+ .batching_unit_threshold = 999999,
|
|
|
+ .batching_zoom_start = 999999.0F,
|
|
|
+ .batching_zoom_full = 999999.0F};
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -265,9 +265,9 @@ private:
|
|
|
static constexpr float kBaseHorseBillboard = 100.0F;
|
|
|
|
|
|
GraphicsQuality m_quality{GraphicsQuality::Ultra};
|
|
|
- LODMultipliers m_lodMultipliers{};
|
|
|
+ LODMultipliers m_lod_multipliers{};
|
|
|
GraphicsFeatures m_features{};
|
|
|
- BatchingConfig m_batchingConfig{};
|
|
|
+ BatchingConfig m_batching_config{};
|
|
|
};
|
|
|
|
|
|
} // namespace Render
|