tweak(shadow): Double 3D shadow buffers in W3DBufferManager #1691
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change doubles the 3D shadow buffers. Shadows are not cheap.
It also rearranges and comments the constants for ease of read.
Original Investigation
The original investigation was done in TheAssemblyArmada/Thyme#604
We know that 512 + 1 Scorpion Tanks in the scene will deplete the shadow memory pools.
I tested against 1024 Scorpion Tanks in the scene.
Double MAX_NUMBER_SLOTS only with 1024 Scorpion Tanks
results in
m_numEmptyVertexBuffersAllocatednow caps out at 32 and it cannot draw shadows for all meshes.m_numEmptyVertexSlotsAllocatedshould cap out at 8192.Double MAX_NUMBER_SLOTS and BUFFERS_CREATED with 1024 Scorpion Tanks
results in
m_numEmptyVertexSlotsAllocatednow caps out at 8192 and all meshes cast shadows in the sceneConclusion
Scaling the following 3 limits uniformly is the correct strategy.
TODO