[enhancement] Disable LOD (#72)

* implement disable LOD

* disable lod for bowser statue

---------

Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
coco875
2024-09-01 05:14:39 +02:00
committed by GitHub
parent a295113438
commit 56de6d00ea
9 changed files with 43 additions and 1 deletions
+4
View File
@@ -22,6 +22,10 @@ void render_actor_box_truck(Camera* arg0, struct Actor* arg1) {
return;
}
if (CVarGetInteger("gDisableLod", 0) == 1) {
temp_f0 = 0.0f;
}
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+3
View File
@@ -19,6 +19,9 @@ void render_actor_car(Camera* arg0, struct Actor* arg1) {
is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
if (!(temp_f0 < 0.0f)) {
if (CVarGetInteger("gDisableLod", 0) == 1) {
temp_f0 = 0.0f;
}
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+4
View File
@@ -53,6 +53,10 @@ void render_actor_piranha_plant(Camera* arg0, Mat4 arg1, struct PiranhaPlant* ar
return;
}
if (CVarGetInteger("gDisableLod", 0) == 1) {
temp_f0 = 0.0f;
}
if (90000.0f < temp_f0) {
switch (temp_lo) {
+4
View File
@@ -23,6 +23,10 @@ void render_actor_school_bus(Camera* arg0, struct Actor* arg1) {
return;
}
if (CVarGetInteger("gDisableLod", 0) == 1) {
temp_f0 = 0.0f;
}
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+4
View File
@@ -19,6 +19,10 @@ void render_actor_tanker_truck(Camera* camera, struct Actor* arg1) {
if (!(temp_f0 < 0.0f)) {
if (CVarGetInteger("gDisableLod", 0) == 1) {
temp_f0 = 0.0f;
}
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+12
View File
@@ -26,6 +26,10 @@ void render_actor_train_engine(Camera* camera, struct TrainCar* actor) {
return;
}
if (CVarGetInteger("gDisableLod", 0) == 1) {
distance = 0.0f;
}
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot);
@@ -173,6 +177,10 @@ void render_actor_train_tender(Camera* camera, struct TrainCar* actor) {
return;
}
if (CVarGetInteger("gDisableLod", 0) == 1) {
temp_f0 = 0.0f;
}
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot);
@@ -258,6 +266,10 @@ void render_actor_train_passenger_car(Camera* camera, struct TrainCar* actor) {
return;
}
if (CVarGetInteger("gDisableLod", 0) == 1) {
temp_f0 = 0.0f;
}
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot);
+5
View File
@@ -29,6 +29,11 @@ void render_actor_yoshi_egg(Camera* arg0, Mat4 arg1, struct YoshiValleyEgg* egg,
temp_f0 = 0.0f;
}
if (CVarGetInteger("gDisableLod", 0) == 1) {
arg3 = 15;
temp_f0 = 0.0f;
}
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
if ((arg3 > 12) && (arg3 < 20)) {
if (temp_f0 < 640000.0f) {
+1 -1
View File
@@ -442,7 +442,7 @@ void DrawEnhancementsMenu() {
if (UIWidgets::BeginMenu("Gameplay")) {
UIWidgets::CVarCheckbox(
"No Level of Detail (LOD)", "gDisableLOD",
"No Level of Detail (LOD)", "gDisableLod",
{ .tooltip = "Disable Level of Detail (LOD) to avoid models using lower poly versions at a distance" });
UIWidgets::CVarCheckbox("Ignore Rendering Limits", "gIgnoreRenderDistance",
{ .tooltip = "Renders game objects regardless of camera distance" });
+6
View File
@@ -176,6 +176,12 @@ void render_course_segments(const char* addr[], struct UnkStruct_800DC5EC* arg1)
arg1->pathCounter = index;
index = ((index - 1) * 4) + var_a3;
gSPDisplayList(gDisplayListHead++, addr[index]);
if (CVarGetInteger("gDisableLod", 0) == 1 && gCurrentCourseId == COURSE_BOWSER_CASTLE &&
(index < 20 || index > 99)) { // always render higher version of bowser statue
gDisplayListHead--;
gSPDisplayList(gDisplayListHead++, d_course_bowsers_castle_dl_9148); // use credit version of the course
}
}
void func_80291198(void) {