mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-23 09:00:19 +02:00
MOHAA decides which terrain patches are visible with a cone test: R_MarkTerrainPatch rejects anything further off the view axis than g_fClipDotSquared allows, and that value is a table lookup indexed by tr.refdef.fov_x. At the game's 80 degrees the half angle is about 46. In VR nothing else reads fov_x any more. The projection is built from the runtime's four tangents in R_SetupProjection, and the culling frustum from the same in R_SetupFrustum. So refdef.fov_x stayed at whatever the game asked for while a Quest 3 eye sees closer to 100 degrees, and terrain that was inside the headset's view but outside an 80 degree cone was never marked visible and never drawn - with nothing anywhere reporting it, because that cvar has no other consumer left in this path. The fov now comes from the widest horizontal tangent when a headset view is active. Widest rather than the sum: the per-eye frustum is asymmetric and the cone is symmetric about the view axis, so it has to cover the wider side. The index is also clamped away from zero. g_fDistanceTable[0] is 443.5 / sqrt(1 - 1) - infinity - which poisons g_vClipOrigin and culls every patch in the level. Not reachable today, but nothing checked, and the failure would be total and silent. MOHAA specific: RTCWQuest has no terrain, so the reference could not have caught this one. Not yet tested on the device. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>