mirror of
https://github.com/BanjoRecomp/BanjoRecomp
synced 2026-08-22 22:25:27 -04:00
Add small value to Orthographic projection's Z far. (#305)
This commit is contained in:
+1
-1
Submodule lib/rt64 updated: 064d80b4ce...6f1c2d99a4
@@ -118,7 +118,9 @@ RECOMP_PATCH void viewport_setRenderViewportAndOrthoMatrix(Gfx **gfx, Mtx **mtx)
|
||||
gSPViewport((*gfx)++, &sViewportStack[sViewportStackIndex]);
|
||||
|
||||
// @recomp Use a high precision version of the projection matrix instead of the fixed precision one. This fixes accuracy issues when rendering text using the orthographic projection.
|
||||
guOrthoF(*mtx, -(2 * (f32)gFramebufferWidth), (2 * (f32)gFramebufferWidth), -(2 * (f32)gFramebufferHeight), (2 * (f32)gFramebufferHeight), 1.0f, 20.0f, 1.0f);
|
||||
// A small Epsilon is required to give some room to the text to render, as it's placed on the very edge of the far plane. Higher precision causes the text to disappear otherwise.
|
||||
const float Epsilon = 1e-2f;
|
||||
guOrthoF(*mtx, -(2 * (f32)gFramebufferWidth), (2 * (f32)gFramebufferWidth), -(2 * (f32)gFramebufferHeight), (2 * (f32)gFramebufferHeight), 1.0f, 20.0f + Epsilon, 1.0f);
|
||||
gEXMatrixFloat((*gfx)++, OS_K0_TO_PHYSICAL((*mtx)++), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
|
||||
#if 0
|
||||
|
||||
Reference in New Issue
Block a user