Jump to content

BSL:Frustum and fog: Difference between revisions

no edit summary
("various widescreen fixes")
No edit summary
Line 8: Line 8:
: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°
;Widescreen FOV
;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.
: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|2}}, {{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
;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.
: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.
98

edits