Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Octree DOTS NativeContainer (on GitHub)

Discussion in 'Entity Component System' started by marijnz-klang, Apr 11, 2020.

  1. marijnz-klang

    marijnz-klang

    Joined:
    Feb 25, 2019
    Posts:
    6
    Hi, a while ago I posted my NativeQuadTree project. I decided to port it to an Octree which was a matter of just a couple of hours, so here we go. It's exactly the same functionality, I didn't change anything besides switching from 2 to 3 dimensions.

    https://github.com/marijnz/NativeOctree

    About
    • It's optimized for performance with the cost of becoming memory hungry when choosing a larger max depth.
    • It currently only supports single bulk insertion of points, so no partial updates.
    • It supports AABB range queries.
    • It's a hobby project, it's not used in a production environment and barely has test coverage

    Performance
    There's some very rudimentary performance tests included. With 20k elements on a 2000x2000x2000m map, a max depth of 6 and 16 max elements per leaf. Burst enabled, ran on main thread on my i7-7700K CPU @ 4.20GHz:
    • Job: Bulk insertion of all elements - Takes ~1ms
    • Job: 1k queries on a 200x200x200m range - Takes ~2.7ms
    And also..
    I think the implementation is quite fast but I don't know how it performs compared to other Octree projects out there, it would be interesting to have some comparisons.
     

    Attached Files:

    Last edited: Apr 11, 2020
    vildauget, Orimay, oatssss and 2 others like this.