Jump to content

Graphics: Difference between revisions

279 bytes added ,  21 October 2021
LOD wording, poly count table
(adding LOD section)
(LOD wording, poly count table)
Line 7: Line 7:
==Fog==
==Fog==
:See [[BSL:Frustum_and_fog]] on how to alter fog using [[BSL]].
:See [[BSL:Frustum_and_fog]] on how to alter fog using [[BSL]].
:''In mid-to-late 1990s games, when processing power was not enough to render far viewing distances, clipping was employed. However, the effect could be very distracting since bits and pieces of [objects] would flicker in and out of view instantly; by applying a medium-ranged fog, the clipped polygons would fade in more realistically from the haze.'' -- [[wikipedia:Distance_fog|"Distance fog"]], Wikipedia
:''In mid-to-late 1990s games, when processing power was not enough to render far viewing distances, clipping was employed. However, the effect could be very distracting since bits and pieces of [objects] would flicker in and out of view instantly; by applying a medium-ranged fog, the clipped polygons would fade in more realistically from the haze.'' [[wikipedia:Distance_fog|"Distance fog"]], Wikipedia
:''For more technical information on fog and on frustum-based space (or whatever it's called), see [https://docs.microsoft.com/en-us/previous-versions//ms537113(v=vs.85)?redirectedfrom=MSDN here] and [https://docs.microsoft.com/en-us/windows/win32/direct3d9/pixel-fog?redirectedfrom=MSDN here] and [https://web.archive.org/web/20130520191527/http://cs.fit.edu/~wds/classes/graphics/PTOC/ptoc/ elsewhere].
:''For more technical information on fog and on frustum-based space (or whatever it's called), see [https://docs.microsoft.com/en-us/previous-versions//ms537113(v=vs.85)?redirectedfrom=MSDN here] and [https://docs.microsoft.com/en-us/windows/win32/direct3d9/pixel-fog?redirectedfrom=MSDN here] and [https://web.archive.org/web/20130520191527/http://cs.fit.edu/~wds/classes/graphics/PTOC/ptoc/ elsewhere].


Line 57: Line 57:
Oni uses the graphics quality slider in Options to help determine what level of detail (LOD) at which to render characters. Each character has up to 5 LODs, though one 3D model can be used in as many of the 5 slots as desired. The first step in determining which LOD to draw each character at is to consult [[XML:ONCC#<LODConstants>|this table]] found in the character's ONCC.
Oni uses the graphics quality slider in Options to help determine what level of detail (LOD) at which to render characters. Each character has up to 5 LODs, though one 3D model can be used in as many of the 5 slots as desired. The first step in determining which LOD to draw each character at is to consult [[XML:ONCC#<LODConstants>|this table]] found in the character's ONCC.


After that distance-from-camera filter is applied, Oni counts the total polygons of all characters in the scene (henceforth "TPCS"). If TPCS is not above the maximum polys allow by the game's graphics quality level ("GQMP"), the game then experiments with raising the LOD of all characters by 1, stopping when it would pass GQMP. If TPCS is starting off above GQMP, it lowers all characters' LOD by 1 until it gets below that limit.
After that distance-from-camera filter is applied, Oni counts the total polygons of all characters in the scene (henceforth "TPCS"). If TPCS is not above the maximum character polys in the scene ("MCPS") which is allowed by the game's graphics quality setting, the game then experiments with raising the LOD of all characters one level at a time, stopping when it would pass MCPS. If TPCS is starting off above MCPS, it lowers all characters' LOD one level at a time until it gets below that limit.


Next, iterating over each character from closest to farthest, the LOD of that character is raised by 1 as long as this won't raise TPCS over GQMP. Thus Oni seeks towards the maximum detail level that it can use for each character, prioritizing the closest ones. As a special consideration, if the closest character is below Medium LOD, it is raised to Medium regardless of GQMP, and the second-closest character is raised to Low if it was Super-Low.
For reference, here is the table of MCPS by graphics quality level: (1500, 2200, 3000, 3400, 4000). Note that there is no consideration at all for how many <u>environmental</u> polys are in the scene.
 
Next, iterating over each character from closest to farthest, the LOD of that character is raised by 1 as long as this won't raise TPCS over MCPS. Thus Oni seeks towards the maximum detail level that it can use for each character, prioritizing the closest ones. As a special consideration, if the closest character is below Medium LOD, it is raised to Medium regardless of MCPS, and the second-closest character is raised to Low if it was Super-Low.


Once the desired LOD is determined for a character, they will be switched to it immediately if they are not standing still (which would make the switch too noticeable). If they are moving, the game waits several frames to make sure the new LOD is continuously being requested by the above algorithms and then they are switched. The goal is to avoid a character rapidly switching back and forth between LODs.
Once the desired LOD is determined for a character, they will be switched to it immediately if they are not standing still (which would make the switch too noticeable). If they are moving, the game waits several frames to make sure the new LOD is continuously being requested by the above algorithms and then they are switched. The goal is to avoid a character rapidly switching back and forth between LODs.


After all the above considerations, if a cutscene is playing, every character is guaranteed a minimum LOD of Low so that no one will be rendered at Super-Low detail.
After all the above considerations, one more: if a cutscene is playing, every character is guaranteed a minimum LOD of Low so that no one will be rendered at Super-Low detail.


[[Category:Engine docs]]
[[Category:Engine docs]]