mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-21 04:55:56 +00:00
Model detail range replaces the distant detail switch: lod_range scales the depth at which models leave their detailed level (1x, 1.5x, 2x, 3x or max) (#949)
The pick patched before (main+0x1ee8424) is reached through its vtable only when the method is overridden; the culling passes run about 20 inlined copies of it, so the switch changed almost nothing. The lodrange set patches the two places per version that compute the level depth B at model setup (the setter and its inlined copy); the slope of the coarser levels follows from B there, and max takes B = 1e30. The menu row sits under Grass range, with Steady detail under load after it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
517a161457
commit
cf3acd0a2f
11 files changed
+92
-48
No files matched your search
+3
-3
@@ -51,7 +51,7 @@ static const char *const known[] = {
|
||||
"GAMEPLAY_WEAPON_WHEEL",
|
||||
"GPL", "GPL_DRAW_BUILD", "GPU", "GPU_INDEX", "GPU_NAME", "GRASS_RANGE", "HDR", "HDR_GAME_NITS", "HDR_HUE",
|
||||
"HDR_PEAK_NITS", "HDR_UI_NITS", "HIGHFPS_FIX", "INPUT", "INPUT_RECORD", "INPUT_SCRIPT", "KSPIN_US", "LANG", "LIB_PREBUILD",
|
||||
"LIB_PREBUILD_KEEP", "LIB_PREBUILD_THREADS", "LOCALE", "LOD_DETAIL", "LOD_GUARD", "LOD_STEADY", "LSTICK_DEADZONE", "MAP_CLICK", "MEMORY", "MEMX", "MENU_LANG", "MENU_TEST", "MENU_FONT_FONTCONFIG",
|
||||
"LIB_PREBUILD_KEEP", "LIB_PREBUILD_THREADS", "LOCALE", "LOD_GUARD", "LOD_RANGE", "LOD_STEADY", "LSTICK_DEADZONE", "MAP_CLICK", "MEMORY", "MEMX", "MENU_LANG", "MENU_TEST", "MENU_FONT_FONTCONFIG",
|
||||
"MEM_RESERVE_MIB", "MENU_CURSOR", "MENU_CURSOR_LOG", "MENU_TEST_DIR", "MENU_TEST_SET", "MINIMAL_LAYOUT", "MIRROR_GAP", "MODS_DIR", "MODS_DISABLED", "MODS_ORDER", "MODS_REBUILD", "MOTION", "MOUSE_AIM_SCALE", "MOUSE_MODE", "MOUSE_DIRECT_PATCH", "MOUSE_SENS", "MOVIE_ASPECT", "MOVIE_HOST", "MOVIE_PACE",
|
||||
"MVOBJ_ALL", "MVOBJ_BANKS", "MVOBJ_EQUAL", "MVOBJ_EXACT", "MVOBJ_EXEC", "MVOBJ_NOC4", "MVOBJ_ONLY", "MVOBJ_TIMES", "MVPREV_CHECK", "MVPREV_GROW", "MVPREV_SKIP", "MVPREV_TRUST", "MV_CHECK",
|
||||
"MV_SURVEY",
|
||||
@@ -78,7 +78,7 @@ static const struct { const char *key, *section; } sections[] = {
|
||||
{"FULLSCREEN", "display"}, {"WINDOW_SIZE", "display"}, {"PERF_OVERLAY", "display"}, {"VK_PRESENT", "display"},
|
||||
{"GPU_INDEX", "display"}, {"OUTPUT_RES", "display"}, {"RENDER_SCALE", "display"}, {"UPSCALER", "display"},
|
||||
{"SHARPNESS", "display"}, {"DYNAMIC_RES", "display"}, {"ASPECT", "display"}, {"MOVIE_ASPECT", "display"}, {"FOV", "display"}, {"ANISO", "display"},
|
||||
{"LOD_DETAIL", "display"}, {"LOD_STEADY", "display"}, {"COLOR_PRESET", "display"},
|
||||
{"LOD_RANGE", "display"}, {"LOD_STEADY", "display"}, {"COLOR_PRESET", "display"},
|
||||
{"COLOR_BRIGHTNESS", "display"}, {"COLOR_CONTRAST", "display"}, {"COLOR_SATURATION", "display"},
|
||||
{"COLOR_GAMMA", "display"}, {"HDR", "display"}, {"HDR_PEAK_NITS", "display"}, {"HDR_GAME_NITS", "display"},
|
||||
{"HDR_UI_NITS", "display"}, {"HDR_HUE", "display"}, {"SHADOW_RES", "display"},
|
||||
@@ -138,7 +138,7 @@ static const CfgMeta metas[] = {
|
||||
{"DLAA", "0", "0|1", RESTART}, {"DLSS", "dlaa", "dlaa|quality|balanced|performance|ultra_performance", LIVE},
|
||||
{"DLSS_PRESET", "default", "default|k|j", LIVE},
|
||||
{"DLSS_CHAR_MASK", "65", "0|35|65|100", LIVE}, {"REFLEX", "off", "off|on|boost", RESTART}, {"FXAA", "1", "0|1", LIVE},
|
||||
{"LOD_DETAIL", "0", "0|1", RESTART}, {"LOD_STEADY", "0", "0|1", RESTART}, // patch sets lod and steady (1.2.1, 1.4.3)
|
||||
{"LOD_RANGE", "100", "100|150|200|300|max", RESTART}, {"LOD_STEADY", "0", "0|1", RESTART}, // sets lodrange, steady
|
||||
{"ASPECT", "fit", "fit|stretch", LIVE}, {"MOVIE_ASPECT", "keep", "keep|stretch", LIVE}, {"FOV", "100", "70..140", LIVE},
|
||||
{"ANISO", "game", "game|2|4|8|16", RESTART}, // vk_texture.c sampler_features
|
||||
// colour adjustment (vk_color.c); the preset is the menu's, the four values are what the present uses
|
||||
|
||||
@@ -547,9 +547,33 @@ static void res_grass_range(void) {
|
||||
pct);
|
||||
}
|
||||
|
||||
// TOTK_LOD_RANGE (100, 150, 200, 300 or max; 100 = the game's): how far models keep their detailed levels. The game
|
||||
// sets each model's level depth B when it sets the model up and derives the slope of its coarser levels from it (the
|
||||
// lodrange patch set, recomp/patches-v121.txt); the set replaces B with k * B + c from page +96 and +100. A percent
|
||||
// moves every level transition about that many times farther (c = 0); max keeps the most detailed level at any depth
|
||||
// (k = 1, c = 1e30, far past any depth the pick compares).
|
||||
static void res_lod_range(void) {
|
||||
const char *v = cfg_get("TOTK_LOD_RANGE");
|
||||
int max = v && !strcasecmp(v, "max"), pct = max ? 0 : cfg_int("TOTK_LOD_RANGE");
|
||||
if (!max && (pct <= 100 || pct > 300)) return;
|
||||
int set = rt_patch_set("lodrange");
|
||||
if (set < 0) {
|
||||
rt_log("resolution: this game version has no lodrange patch set; lod_range stays 100");
|
||||
return;
|
||||
}
|
||||
float f[2] = {max ? 1.0f : pct / 100.0f, max ? 1e30f : 0.0f};
|
||||
memcpy((uint8_t *)rt_patch_page() + 96, f, sizeof f);
|
||||
rt_patch_switch(set, 1);
|
||||
if (max)
|
||||
rt_log("resolution: models keep their most detailed level at any depth (TOTK_LOD_RANGE=max)");
|
||||
else
|
||||
rt_log("resolution: model level depths x%g (TOTK_LOD_RANGE=%d)", f[0], pct);
|
||||
}
|
||||
|
||||
void res_init(void) {
|
||||
res_shadow_range();
|
||||
res_grass_range();
|
||||
res_lod_range();
|
||||
if (!bigger()) {
|
||||
rt_log("resolution: the game's own (output 1920x1080, scene 1600x900)");
|
||||
shadow_init(rt_patch_page());
|
||||
|
||||
+10
-2
@@ -587,6 +587,14 @@ static void row_grass_range(void) {
|
||||
opt_choice_list("TOTK_GRASS_RANGE", UI_MENU_GRASS_RANGE, vals, names, 6, UI_MENU_GRASS_RANGE_DESC);
|
||||
}
|
||||
|
||||
// Model detail range (resolution.c res_lod_range): how far models keep their detailed levels, in percent of the game's
|
||||
// depths, or max for the most detailed level at any depth.
|
||||
static void row_lod_range(void) {
|
||||
static const char *const vals[] = {"100", "150", "200", "300", "max"};
|
||||
const char *names[] = {"1x", "1.5x", "2x", "3x", menu_text(UI_MENU_LOD_RANGE_MAX)};
|
||||
opt_choice_list("TOTK_LOD_RANGE", UI_MENU_LOD_RANGE, vals, names, 5, UI_MENU_LOD_RANGE_DESC);
|
||||
}
|
||||
|
||||
static void row_gpu(void) {
|
||||
const char *vals[MAX_GPUS + 1], *names[MAX_GPUS + 1];
|
||||
char idx[MAX_GPUS][4];
|
||||
@@ -716,11 +724,11 @@ static void tab_screen(float scale) {
|
||||
static const char *const aniso[] = {"game", "2", "4", "8", "16"};
|
||||
const char *aniso_names[] = {menu_text(UI_MENU_ANISO_GAME), "2x", "4x", "8x", "16x"};
|
||||
opt_choice_list("TOTK_ANISO", UI_MENU_ANISO, aniso, aniso_names, 5, UI_MENU_ANISO_DESC);
|
||||
opt_toggle("TOTK_LOD_DETAIL", UI_MENU_LOD_DETAIL, UI_MENU_LOD_DETAIL_DESC);
|
||||
opt_toggle("TOTK_LOD_STEADY", UI_MENU_LOD_STEADY, UI_MENU_LOD_STEADY_DESC);
|
||||
row_shadow_scale();
|
||||
row_shadow_range();
|
||||
row_grass_range();
|
||||
row_lod_range();
|
||||
opt_toggle("TOTK_LOD_STEADY", UI_MENU_LOD_STEADY, UI_MENU_LOD_STEADY_DESC);
|
||||
opt_slider("TOTK_PCSS", UI_MENU_PCSS, 0, 200, UI_MENU_PCSS_DESC, 10, "%.0f %%");
|
||||
opt_slider("TOTK_CONTACT_SHADOWS", UI_MENU_CONTACT_SHADOWS, 0, 100, UI_MENU_CONTACT_SHADOWS_DESC, 10, "%.0f %%");
|
||||
opt_toggle("TOTK_DLAA", UI_MENU_DLAA, UI_MENU_DLAA_DESC);
|
||||
|
||||
+16
-13
@@ -96,10 +96,11 @@ static const char *const text_en[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_ANISO] = "Texture filtering",
|
||||
[UI_MENU_ANISO_DESC] = "Anisotropic filtering of surface textures: ground, roads and walls seen at a shallow angle stay sharp into the distance instead of blurring. Game: the level the game asks for, as on the Switch.",
|
||||
[UI_MENU_ANISO_GAME] = "Game",
|
||||
[UI_MENU_LOD_DETAIL] = "Distant model detail",
|
||||
[UI_MENU_LOD_DETAIL_DESC] = "Distant models keep the detail they have up close instead of switching to simpler versions. Game versions 1.2.1 and 1.4.3.",
|
||||
[UI_MENU_LOD_RANGE] = "Model detail range",
|
||||
[UI_MENU_LOD_RANGE_DESC] = "How far models keep their detailed versions before the game switches to simpler ones. Higher keeps cliffs, ruins and sky islands detailed further out; Max never simplifies them. Costs GPU time, more on weaker graphics cards. Grass has its own range above. Takes effect at the next start.",
|
||||
[UI_MENU_LOD_RANGE_MAX] = "Max",
|
||||
[UI_MENU_LOD_STEADY] = "Steady detail under load",
|
||||
[UI_MENU_LOD_STEADY_DESC] = "Skips the game's setup for lowering model and texture detail when the frame rate drops, as the emulator mod Disable LOD Quality Reduction does. Game versions 1.2.1 and 1.4.3.",
|
||||
[UI_MENU_LOD_STEADY_DESC] = "Skips the game's setup for lowering model and texture detail when the frame rate drops, as the emulator mod Disable LOD Quality Reduction does. Game versions 1.2.1 and 1.4.3. Leave it off on weak PCs: there this drop keeps the frame rate up.",
|
||||
[UI_MENU_SHARPNESS] = "FSR sharpness",
|
||||
[UI_MENU_SHARPNESS_DESC] = "Sharpening after FSR scaling; 0 turns it off.",
|
||||
[UI_MENU_COLOR] = "Colour",
|
||||
@@ -633,10 +634,11 @@ static const char *const text_ru[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_ANISO] = "Фильтрация текстур",
|
||||
[UI_MENU_ANISO_DESC] = "Анизотропная фильтрация текстур поверхностей: земля, дороги и стены под острым углом остаются чёткими вдали, а не размываются. Игра: уровень, который запрашивает игра, как на Switch.",
|
||||
[UI_MENU_ANISO_GAME] = "Игра",
|
||||
[UI_MENU_LOD_DETAIL] = "Детализация дальних моделей",
|
||||
[UI_MENU_LOD_DETAIL_DESC] = "Дальние модели сохраняют детализацию, как вблизи, а не переключаются на упрощённые версии. Только для версий игры 1.2.1 и 1.4.3.",
|
||||
[UI_MENU_LOD_RANGE] = "Дальность детализации моделей",
|
||||
[UI_MENU_LOD_RANGE_DESC] = "Как далеко модели остаются подробными, прежде чем игра заменит их упрощёнными. Выше: скалы, руины и небесные острова подробны дальше; «Максимум»: модели не упрощаются никогда. Нагружает видеокарту, слабую сильнее. У травы своя дальность выше. Действует после перезапуска.",
|
||||
[UI_MENU_LOD_RANGE_MAX] = "Максимум",
|
||||
[UI_MENU_LOD_STEADY] = "Стабильная детализация под нагрузкой",
|
||||
[UI_MENU_LOD_STEADY_DESC] = "Пропускает настройку игры, снижающую детализацию моделей и текстур при падении частоты кадров, как эмуляторный мод Disable LOD Quality Reduction. Только для версий игры 1.2.1 и 1.4.3.",
|
||||
[UI_MENU_LOD_STEADY_DESC] = "Пропускает настройку игры, снижающую детализацию моделей и текстур при падении частоты кадров, как эмуляторный мод Disable LOD Quality Reduction. Только для версий игры 1.2.1 и 1.4.3. На слабых ПК не включайте: там это снижение и держит частоту кадров.",
|
||||
[UI_MENU_SHARPNESS] = "Резкость FSR",
|
||||
[UI_MENU_SHARPNESS_DESC] = "Повышение резкости после масштабирования FSR; 0 выключает его.",
|
||||
[UI_MENU_COLOR] = "Цвет",
|
||||
@@ -1480,13 +1482,13 @@ static const char *const text_pt_br[UI_TEXT_COUNT] = {
|
||||
"ângulo raso continuam nítidos ao longe em vez de borrar. Jogo: o nível que o jogo pede, "
|
||||
"como no Switch.",
|
||||
[UI_MENU_ANISO_GAME] = "Jogo",
|
||||
[UI_MENU_LOD_DETAIL] = "Detalhe de modelos distantes",
|
||||
[UI_MENU_LOD_DETAIL_DESC] = "Modelos distantes mantêm o detalhe que têm de perto em vez de trocar por versões "
|
||||
"mais simples. Só nas versões 1.2.1 e 1.4.3 do jogo.",
|
||||
[UI_MENU_LOD_RANGE] = "Alcance do detalhe dos modelos",
|
||||
[UI_MENU_LOD_RANGE_DESC] = "Até onde os modelos mantêm as versões detalhadas antes de o jogo trocá-las por versões mais simples. Mais alto mantém penhascos, ruínas e ilhas do céu detalhados mais longe; Máximo nunca os simplifica. Custa tempo de GPU, mais em placas fracas. A grama tem o próprio alcance acima. Vale no próximo início.",
|
||||
[UI_MENU_LOD_RANGE_MAX] = "Máximo",
|
||||
[UI_MENU_LOD_STEADY] = "Detalhe estável sob carga",
|
||||
[UI_MENU_LOD_STEADY_DESC] = "Pula a configuração do jogo que reduz o detalhe de modelos e texturas quando a taxa "
|
||||
"de quadros cai, como faz o mod de emulador Disable LOD Quality Reduction. Só nas "
|
||||
"versões 1.2.1 e 1.4.3 do jogo.",
|
||||
"versões 1.2.1 e 1.4.3 do jogo. Deixe desligado em PCs fracos: lá essa redução mantém a taxa de quadros.",
|
||||
[UI_MENU_COLOR] = "Cor",
|
||||
[UI_MENU_COLOR_PRESET] = "Perfil de cor",
|
||||
[UI_MENU_COLOR_PRESET_DESC] = "Define os quatro valores abaixo. Vívido: mais contraste e saturação, sombras um "
|
||||
@@ -2196,11 +2198,12 @@ static const char *const text_zh_hans[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_ANISO] = "纹理过滤",
|
||||
[UI_MENU_ANISO_DESC] = "表面纹理的各向异性过滤:以小角度看到的地面、道路和墙壁在远处依然清晰,而不会模糊。游戏:使用游戏请求的级别,与 Switch 上相同。",
|
||||
[UI_MENU_ANISO_GAME] = "游戏",
|
||||
[UI_MENU_LOD_DETAIL] = "远处模型细节",
|
||||
[UI_MENU_LOD_DETAIL_DESC] = "远处的模型保持近处的细节,而不会切换为简化版本。仅适用于游戏版本 1.2.1 和 1.4.3。",
|
||||
[UI_MENU_LOD_RANGE] = "模型细节范围",
|
||||
[UI_MENU_LOD_RANGE_DESC] = "模型在游戏换成简化版本之前保持细节的距离。调高后悬崖、遗迹和天空岛在更远处仍保持细节;“最大”则从不简化。会占用显卡时间,显卡越弱影响越大。草地在上方有单独的范围设置。下次启动时生效。",
|
||||
[UI_MENU_LOD_RANGE_MAX] = "最大",
|
||||
[UI_MENU_LOD_STEADY] = "负载下保持细节",
|
||||
[UI_MENU_LOD_STEADY_DESC] = "跳过游戏在帧率下降时降低模型和纹理细节的设置,与模拟器模组 Disable LOD Quality "
|
||||
"Reduction 的作用相同。仅适用于游戏版本 1.2.1 和 1.4.3。",
|
||||
"Reduction 的作用相同。仅适用于游戏版本 1.2.1 和 1.4.3。低配电脑请勿开启:在那里正是这种降低维持了帧率。",
|
||||
[UI_MENU_HDR_GROUP] = "HDR",
|
||||
[UI_MENU_HDR] = "HDR 输出",
|
||||
[UI_MENU_HDR_DESC] = "在 HDR 显示器上呈现明亮的高光。需要在 Windows 中开启 HDR(“使用 HDR”),或使用带色彩管理的 Wayland 合成器;否则画面保持 "
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ typedef enum {
|
||||
UI_MENU_FOV, UI_MENU_FOV_DESC,
|
||||
UI_MENU_SHADOW_RES, UI_MENU_SHADOW_RES_DESC, UI_MENU_SHADOW_RES_GAME,
|
||||
UI_MENU_ANISO, UI_MENU_ANISO_DESC, UI_MENU_ANISO_GAME,
|
||||
UI_MENU_LOD_DETAIL, UI_MENU_LOD_DETAIL_DESC, UI_MENU_LOD_STEADY, UI_MENU_LOD_STEADY_DESC,
|
||||
UI_MENU_LOD_RANGE, UI_MENU_LOD_RANGE_DESC, UI_MENU_LOD_RANGE_MAX, UI_MENU_LOD_STEADY, UI_MENU_LOD_STEADY_DESC,
|
||||
UI_MENU_SHARPNESS, UI_MENU_SHARPNESS_DESC,
|
||||
UI_MENU_COLOR, // group heading over the colour rows
|
||||
UI_MENU_COLOR_PRESET, UI_MENU_COLOR_PRESET_DESC, UI_MENU_COLOR_DEFAULT, UI_MENU_COLOR_VIVID, UI_MENU_COLOR_CLARITY,
|
||||
|
||||
Reference in new issue
Block a user