Skip to content

Game 3D rendering generation systems

Glenn Ko edited this page Jun 3, 2019 · 42 revisions

3D Game environment systems:

Rudimentary stuff, really. Specs include the features/considerations used in the implementation.

Object population/procedural generation system

  • Mass random placement of objects within 2D polygon regions at configurable random uniform densities.
  • Integrate with height map or use fixed height value setting. (or consider custom function?)
  • May define 2D polygonal regions as as colored pixels on image reference with varying tolerances. (or consider custom function?)
  • Form randomly generated city/town/village/house districts (and other procedural layouts in the future) within defined 2D polygonal region.

Integrated Batching/LOD/Culling system

Bounding Volume Hierachy (BVH) Tree for Dynamic/Static Batched Culling and/or Level of Detail (LOD) to handle rendering of massive amounts of repeatable objects.

Specs:

  • Hierchical Frustum Culling Per Node: Only checks the necessary frustum planes recursing down the tree, or skip it altogether once a node's bounds is conservatively detected to be fully within camera.
  • Frame coherance hierchical culling update: If current node's culling value is -1 (fully outside camera) or 0 (fully inside camera) and that value was the same since last frame update, no need to visit further down the tree for visibility updates that didn't change since last frame. All further culling processing of objects only occurs if there is a direct change of visibility to any of the given nodes/objects needed to be culled, and thus doesn't necessarily happen every frame if visibility states remain unchanged.
  • LOD updates frequency done on seperate configurable camera movement distance interval.
  • LOD distance thresholds (by below stipulated maximum distances per threshold)
  • LOD processing per node as simplistic conservative distance to bounds check to determine highest possible maxLOD level for all object(s) in it. (or consider custom distance function?)
  • Frame coherance coupled culling and LOD: LOD updates considers culling of nodes/objects in current frame , only updating LOD of non-culled "visible" nodes/objects for that frame if it changes. For culling updates per frame that turn on visibility of objects or nodes, it will re-determine what LODs to show for objects under it if last LOD update timestamp under node/object is found to be "outdated" only,
  • Frame coherance for lowest possible maxLOD: If current viewing maxLOD value of node is at it's lowest possible LOD at zero 0 and hasn't changed since last frame, then it will not need to visit further down the tree to perform any LOD updates.
  • Configurable Maximum Bounding Group "Size" for each LOD, consisting of configurable minimum objects per node or/and minimum bounding threshold leaf size per node.
  • Static batching of (typically lowest/low-end) LODs given configurable Maximum Bounding Group Size for each LOD level to swap out to static model batches up to a maximum LOD level.
  • Force-reduce size of BVH tree at the cost of configurable linear processing of objects at leaf node given maximum given configurable minimum objects per node or/and minimum bounding threshold leaf size per node.
  • Frame coherance for Maximum Bounding Group Size LODs: If current viewing maxLOD value of node remains the same as last update with it's bounds not exceeding Maximum Bounding Group Size, then it will not need to visit further down the tree to perform any LOD updates.
  • Can set BVH Tree for Collision or/and Raycast checking as well.
  • Configurable Per Node/Per Object Culling or No Culling
  • Configurable Per Node/Per Object LOD or implicit No LOD: (ie. if only 1 LOD object is used, then no LOD updates are required).
  • Future support for use of web workers for LOD routine

(Future consideration:)

  • Static LOD batching LRU Cache for loading/unloading of static batch lod meshes. (if streaming infinitely large worlds, this is a consideration)
  • Global production Compile time flags for Configurable Per Node/Per Object Culling/LODs,to standardise Haxe output builds/available configurations.