mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Clamp arguments for acos when calculating G_TEXTURE_GEN_LINEAR
Fixed (Majora's Mask) Glass in Postman House not rendering #1941 Note: ucode actually works a bit differently because it uses approximated acos calculation.
This commit is contained in:
parent
087ac76536
commit
cbf5821f8e
|
@ -837,6 +837,10 @@ void gSPProcessVertex(u32 v, SPVertex * spVtx)
|
|||
y = fLightDir[1];
|
||||
}
|
||||
if (gSP.geometryMode & G_TEXTURE_GEN_LINEAR) {
|
||||
if (x < -1.0f) x = -1.0f;
|
||||
if (x > 1.0f) x = 1.0f;
|
||||
if (y < -1.0f) y = -1.0f;
|
||||
if (y > 1.0f) y = 1.0f;
|
||||
vtx.s = acosf(-x) * 325.94931f;
|
||||
vtx.t = acosf(-y) * 325.94931f;
|
||||
} else { // G_TEXTURE_GEN
|
||||
|
|
Loading…
Reference in New Issue
Block a user