5,389
edits
m (triangles, not quads) |
(my past self forgot about the optimized GQ list indices; fixing now) |
||
Line 25: | Line 25: | ||
[[Image:Penny_Arcade_-_EvilCorp_Too.png|thumb|300px]] | [[Image:Penny_Arcade_-_EvilCorp_Too.png|thumb|300px]] | ||
;Intersected gunk quads | ;Intersected gunk quads | ||
:An octtree leaf (OTLF) stores its size and position and the gunk quads that intersect it. The first field contains an index/count pair that is used to access the first [[OBD:IDXA|IDXA]] field that is stored in the [[OBD:AKOT|AKOT]] that owns this leaf. This [[OBD:IDXA|IDXA]] contains the gunk quad numbers that intersect the leaf. In theory there can be at most | :An octtree leaf (OTLF) stores its size and position and the gunk quads that intersect it. The first field contains an index/count pair that is used to access the first [[OBD:IDXA|IDXA]] field that is stored in the [[OBD:AKOT|AKOT]] that owns this leaf. This [[OBD:IDXA|IDXA]] contains the gunk quad numbers that intersect the leaf. In theory there can be at most 4095 gunk quads that intersect a leaf but in practice this number is much lower (max is 462). In addition the threshold limit used to build the octree seems to be 19 gunk quads per leaf. I.e., in Oni's levels, only the smallest leaves (with size 16x16x16) have more than 19 quads; larger leaves containing 20 and more quads are subdivided into "other, smaller boxes". | ||
;Intersected BNVs | ;Intersected BNVs | ||
:An octtree leaf can intersect some BNVs (see [[OBD:AKVA|AKVA]]). The last field contains the index and count of this list in the second [[OBD:IDXA|IDXA]] field of [[OBD:AKOT|AKOT]]. | :An octtree leaf can intersect some BNVs (see [[OBD:AKVA|AKVA]]). The last field contains the index and count of this list in the second [[OBD:IDXA|IDXA]] field of [[OBD:AKOT|AKOT]]. | ||
Line 41: | Line 41: | ||
:The above leaf does not intersect any quads, has its maximum corner at (-2048.0, -2048.0, -2048.0), a size of 2048.0, no neighbours for all negative faces (it's right in the negative corner of the environment) and positive faces have leaves as neighbours (no quadtree nodes here). | :The above leaf does not intersect any quads, has its maximum corner at (-2048.0, -2048.0, -2048.0), a size of 2048.0, no neighbours for all negative faces (it's right in the negative corner of the environment) and positive faces have leaves as neighbours (no quadtree nodes here). | ||
;Theoretical limits | ;Theoretical limits | ||
:If the 8192x8192x8192 | :If the environment (size 8192x8192x8192) is subdivided into minimal cubes (size 16x16x16) in all three directions, the total number of leaves is 512x512x512 = 134,217,728, and with a maximum of 4095 quads per leaf one could expect a theoretical maximum of 549,621,596,160 distinct quads per level. (Half a trillion quads, or a trillion triangles. That's ''crazy'' much.) | ||
:*only up to 8192 environment triangles are expected to be ''visible'' (rendered) at any given time (they can be packed as 4096 quads, or as 8192 actual triangles, or any combination of tris and quads). If you attempt to view more | :However, the maximum size of the AKOT's first IDXA that can be referenced through a leaf's 0x00 field is actually 1,052,670 (a combination of the 20-bit index to the start of a leaf's quad list and the 12-bit length of that list). Thus the maximum number of distinct quads in a level (properly referenced by oct-tree leaves) can not exceed 1,052,670, which is much more comfortable sanity-wise (two million triangles is fairly common for game environments nowadays). | ||
:In practice, though, the engine imposes even more modest limitations: | |||
:*only up to 8192 environment triangles are expected to be ''visible'' (rendered) at any given time (they can be packed as 4096 quads, or as 8192 actual triangles, or any combination of tris and quads). | |||
:*:If you attempt to view more than 8192 triangles at once, Oni will ''not'' crash, but: | |||
:*:*it will complain with the dev-console message "Exceeded max visible GQs #", where # is the number of ''triangles'' in excess of 8192; | |||
:*:*it will start dropping random triangles from the rendering pipeline; | |||
:*:*collision will start to fail on the "dropped" triangles. | |||
:*:The amount of other visible geometry (characters, particles etc) does not affect this limit. | |||
:*only up to 262140 triangles (e.g., as 131070 quads) are allowed in a level's environment. Attempting to load a level with 262141 environment triangles (as any combination of triangles and quads) will cause Oni to [[Blam]]. | :*only up to 262140 triangles (e.g., as 131070 quads) are allowed in a level's environment. Attempting to load a level with 262141 environment triangles (as any combination of triangles and quads) will cause Oni to [[Blam]]. | ||
:*:(N.B. This has been identified as a bug that will be fixed in future versions, so that the theoretical maximum of 1,052,670 quads (2,105,340 triangles) can be reached: if you cut a level into "sections" ("rooms" or "scenes") where you can view no more than 8192 triangles at once, then basically you are allowed to have 257 such "sections" in a level. If you add an extra set of environment polygons for cel-shading or lightmapping, then the limit will be cut in 2 or 4.) | |||
{{OBD_File_Footer | type=OTLF | prev=OTIT | next=PLEA | name=Oct Tree Leaf Node Array | family=Level}} | {{OBD_File_Footer | type=OTLF | prev=OTIT | next=PLEA | name=Oct Tree Leaf Node Array | family=Level}} | ||
{{OBD}} | {{OBD}} |