Skip to content

Retained spatree for better performance #21

Description

@nixonyh

This could be a huge undertaking which might require several PRs to complete it, feel free to split this into smaller issues.

Goal

Right now, a Spatree cannot be updated. Every changes to the scene will trigger a full rebuild of the entire Spatree. This might not be ideal for large scenes with dynamic updates.

The construction of BVH should still be recreated every (updated) frame, we only focus on incrementally updating the leaf nodes and a way for global bounds to be defined by the user + handling cases where inserted rects are out of the given bound.

Steps to achieve the goal

  • Custom user defined bounds
  • Error handling for out of bounds leaf rects
  • Use a BTreeSet/BTreeMap equivalent for storing SparseMap mapped rect ids, sorted via MortonCode
    Note*: Building LBVH still relies on MortonCode in a linear data structure (e.g. a Vec) so we might need a better way to store them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions