Optimize Foliage with quad-tree clustering per foliage type

This commit is contained in:
Wojtek Figat
2021-07-01 23:08:47 +02:00
parent c93c811375
commit fe2e17e353
4 changed files with 276 additions and 183 deletions

View File

@@ -10,6 +10,9 @@ struct FoliageInstance;
// Enable/disable foliage editing and changing at runtime. If your game need to use procedural foliage then enable this option.
#define FOLIAGE_EDITING (USE_EDITOR)
// Enables using single quad-tree acceleration structure per foliage actor, otherwise will use quad-tree per foliage type to optimize drawing performance at a cost of higher memory usage.
#define FOLIAGE_USE_SINGLE_QUAD_TREE 0
// Size of the instance allocation chunks (number of instances per allocated page)
#define FOLIAGE_INSTANCE_CHUNKS_SIZE (4096*4)