mirror of
https://github.com/BanjoRecomp/BanjoRecomp
synced 2026-06-24 15:43:17 -04:00
Force nearest LODs and disable nearclipping to improve camera clipping in ultrawide aspect ratios
This commit is contained in:
@@ -93,6 +93,9 @@ RECOMP_PATCH void game_draw(s32 arg0){
|
||||
gEXEnable(gfx++);
|
||||
gEXSetRefreshRate(gfx++, 60 / viMgr_func_8024BFA0()); // Input framerate is equal to 60 Hz divided by the frame divisor
|
||||
|
||||
// @recomp Turn off nearclipping (i.e. turn on depth clamp) to prevent the camera from clipping through lots of geometry in ultrawide aspect ratios.
|
||||
gEXSetNearClipping(gfx++, FALSE);
|
||||
|
||||
func_802E39D0(&gfx, &mtx, &vtx, getActiveFramebuffer(), arg0);
|
||||
|
||||
// @recomp Check for graphics stack overflow
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#include "patches.h"
|
||||
#include "core1/mlmtx.h"
|
||||
|
||||
typedef struct {
|
||||
s32 cmd_0;
|
||||
s32 size_4;
|
||||
f32 max_8;
|
||||
f32 min_C;
|
||||
f32 unk10[3];
|
||||
s32 subgeo_offset_1C;
|
||||
}GeoCmd8;
|
||||
|
||||
extern f32 D_80383C98[3];
|
||||
extern void func_80339124(Gfx **gfx, Mtx **mtx, BKGeoList *geo_list);
|
||||
extern float gu_sqrtf(float val);
|
||||
|
||||
// @recomp Patched to force all LODs to act as if they were a fixed distance from the camera.
|
||||
RECOMP_PATCH void func_80338B50(Gfx **gfx, Mtx **mtx, void *arg2) {
|
||||
GeoCmd8 *cmd = (GeoCmd8 *)arg2;
|
||||
f32 dist;
|
||||
|
||||
if (cmd->subgeo_offset_1C) {
|
||||
mlMtx_apply_vec3f(D_80383C98, cmd->unk10);
|
||||
// @recomp Force distance for LOD to be 50.
|
||||
dist = 50.0f; //gu_sqrtf(D_80383C98[0] * D_80383C98[0] + D_80383C98[1] * D_80383C98[1] + D_80383C98[2] * D_80383C98[2]);
|
||||
if (cmd->min_C < dist && dist <= cmd->max_8) {
|
||||
func_80339124(gfx, mtx, (BKGeoList *)((s32)cmd + cmd->subgeo_offset_1C));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user