virtualx-engine/servers/visual
lawnjelly 667c970b77 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>
2020-08-18 11:02:21 +01:00
..
rasterizer.cpp Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
rasterizer.h Check arrays before generating Polygon2D AABBs 2020-08-16 21:08:52 -07:00
SCsub SCons: Format buildsystem files with psf/black 2020-06-10 15:30:52 +02:00
shader_language.cpp [3.2] Fix some incorrect conversions which lead to crash in shaders 2020-07-15 06:36:24 +03:00
shader_language.h [3.2] Fix shader crash if pass const argument to 'out/inout' parameter 2020-06-25 10:27:37 +03:00
shader_types.cpp Add MODULATE builtin to canvas item shaders 2020-05-04 00:10:24 +02:00
shader_types.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
visual_server_canvas.cpp Make Light2D respect CanvasLayer layer_min and layer_max 2020-06-08 05:41:18 +01:00
visual_server_canvas.h Make Light2D respect CanvasLayer layer_min and layer_max 2020-06-08 05:41:18 +01:00
visual_server_globals.cpp Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
visual_server_globals.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
visual_server_raster.cpp Add shader time scaling 2020-06-06 23:59:48 +02:00
visual_server_raster.h Add shader time scaling 2020-06-06 23:59:48 +02:00
visual_server_scene.cpp Optimize octree and fix octree leak 2020-08-18 11:02:21 +01:00
visual_server_scene.h Optimize octree and fix octree leak 2020-08-18 11:02:21 +01:00
visual_server_viewport.cpp Make Light2D respect CanvasLayer layer_min and layer_max 2020-06-08 05:41:18 +01:00
visual_server_viewport.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
visual_server_wrap_mt.cpp Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
visual_server_wrap_mt.h Add shader time scaling 2020-06-06 23:59:48 +02:00