Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize octree and fix leak #41123

Merged
merged 1 commit into from
Sep 30, 2020
Merged

Commits on Aug 18, 2020

  1. Optimize octree and fix octree leak

    Prevents adding new octants until a limiting number of elements have been added to the current octant. This enables balancing the benefits of brute force against the benefits of spatial partitioning. The limit can be set per octree.
    
    Project settings are added for rendering octree to set the best balance per project depending on number of tests per frame / tick, and the amount of editing of the octree.
    
    Fixes octants being leaked when removing elements.
    
    Optimize octree with cached linear lists
    
    Storing elements in octants using linked lists is efficient for housekeeping but very slow for testing. This optimization stores additional local_vectors with Element pointers and AABBs which are cached and only updated when a dirty flag is set on the octant.
    
    This is selectable with 2 versions of Octree : Octree and Octree_CL, Octree being the old behaviour. At present the cached list version is only used for the visual server octree (rendering) as it has only been demonstrated to be faster there so far.
    
    This uses slightly more memory (probably a few kb in most cases) but can be significantly faster during testing (culling etc).
    
    Co-authored-by: Sergey Minakov <naithar@icloud.com>
    lawnjelly and naithar committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    667c970 View commit details
    Browse the repository at this point in the history