BSL:Frustum and fog: Difference between revisions

"various widescreen fixes"
("various widescreen fixes")
Line 7: Line 7:
:(not available on PC demo or Mac) This sets the angle between the top and bottom planes of the frustum. If you call '''gs_fov_set(90)''', then the angle at the camera between the top and bottom of the frustum will be 90°. The default value of that angle is 45°.
:(not available on PC demo or Mac) This sets the angle between the top and bottom planes of the frustum. If you call '''gs_fov_set(90)''', then the angle at the camera between the top and bottom of the frustum will be 90°. The default value of that angle is 45°.
:The aspect ratio of the frustum stays constant (defined by the current screen resolution), so the view will get wider as you increase the vertical FOV. For the defaut FOV and on a 4:3 screen, the horizontal viewing angle is 2*arctan(4/3*tan(45°/2))=57.8224°
:The aspect ratio of the frustum stays constant (defined by the current screen resolution), so the view will get wider as you increase the vertical FOV. For the defaut FOV and on a 4:3 screen, the horizontal viewing angle is 2*arctan(4/3*tan(45°/2))=57.8224°
Note that the far clip plane and FOV are only reset when Oni starts, not when you load a level, so mind their default values and the side effect of other scripts. Also note that there is no control over Oni's ''near'' clipping plane: its distance is always 4 (40 cm).
;Widescreen FOV
:On a 16:9 or 16:10 screen, the horizontal viewing angle is larger: 2*arctan(16/9*tan(45°/2))=72.73435° and 2*arctan(16/10*tan(45°/2))=67.0682°, respectively. This causes insufficient frustum culling in some of Oni's cutscenes (intro sequences of {{C|3}}, {{C|11}}, and {{C|14}} for example). A quick way to fix this is to bring the horizontal viewing angle down to the supposed 57.8224° during the cutscene: the 4:3 viewport will then effectively be trimmed vertically rather than extended sideways. On 16:9 and 16:10 screens, the corrected vertical FOV will be 2*arctan(3/4*tan(45°/2))=34.515877° and 2*arctan(5/6*tan(45°/2))=38.0871°, respectively. Remember to set it back to 45° after the cutscene to fully enjoy the extended viewport.
;NOTE
:The far clip plane and FOV are only reset when Oni starts, not when you load a level, so mind their default values and the side effect of other scripts.
;ALSO NOTE
:There is no control over Oni's ''near'' clipping plane: its distance is always 4 (40 cm).
 
 
==Distance fog==
==Distance fog==
===BSL interface===
===BSL interface===