breakage was due to an uninitialized variable at the beginning of the
frame, caused by a recent change.
shadows would disappear when cascades were used with 'stable' shadows.
ShadowMap had recently inflated due to its internal use of
PerViewUniforms, which keeps a shadow copy of the uniform data. This
copy is not needed for ShadowMaps.
In addition to the new getters, this change fixes the duplication of
a MaterialInstance, which didn't carry along the following states:
- alpha mask threshold
- specular AA threshold
- specular AA variance
- double sidedness
TODO: stencil state, polygon offset and scissor are stil not queryable
* Recompute bounding boxes with morph targets
* Reduce the number of heap allocation while recomputing bounding boxes
Co-authored-by: Romain Guy <romainguy@curious-creature.com>
Instead of constantly reusing the View's UBO, each shadowmap now
manages it own. All UBOs for all shadow maps are updated together,
then later during rendering, we're simply binding the correct UBO.
This change will be needed later so that we can update several
shadow maps in a single texture.
There are two main changes to achieve this:
1. ShadowMap now has PerViewUniforms object
2. For point lights, each face now has a ShadowMap object
One consequence is that ShadowMap is now very large (over 2KB). This
will be addressed later.
This 2D allocator only supports power-of-two, square allocations. It
uses a quadtree to store the allocated regions.
The quadtree implementation currently has a fixed depth (templated).
The allocator does a best-fit match, but currently doesn't implement a
free method.
- RenderPass::Executor now only executes the commands, it doesn't
create a backend render pass anymore. This is still done in the
RenderPass::execute() helper.
- scissor and poloyon offset overrides are now set on Executor because
they are not needed to generate the commands.