feat(rendering): index incremental scene queries
Maintain packed render worksets as lifecycle deltas arrive and synchronize active animated statics without scanning the resident world. This keeps Slice F non-drawing while preparing exact spatial and feature queries for shadow comparison. Release: 8,206 passed, 5 skipped.
This commit is contained in:
parent
58e7c2eb99
commit
ff5d86175f
8 changed files with 745 additions and 16 deletions
|
|
@ -207,6 +207,62 @@ public sealed class StaticRenderProjectionJournalTests
|
|||
() => statics.Clear(Generation(7)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ActiveAnimatedSynchronization_ReclassifiesAndUpdatesOnlyActiveSource()
|
||||
{
|
||||
RenderSceneGeneration generation = Generation(8);
|
||||
var journal = new RenderProjectionJournal(generation);
|
||||
var statics = new StaticRenderProjectionJournal(journal);
|
||||
WorldEntity animated = Entity(1);
|
||||
WorldEntity ordinary = Entity(2);
|
||||
LandblockBuild build = Build(
|
||||
LandblockId,
|
||||
[animated, ordinary],
|
||||
includeShell: false);
|
||||
statics.Reconcile(build, Publication(build));
|
||||
using var scene = new ArchRenderScene(generation);
|
||||
journal.DrainTo(scene);
|
||||
RenderProjectionId animatedId =
|
||||
StaticRenderProjectionJournal.StaticEntityId(
|
||||
LandblockId,
|
||||
animated.Id);
|
||||
Assert.True(scene.OpenQuery().TryGet(animatedId, out var before));
|
||||
|
||||
statics.SynchronizeActiveAnimatedSources([animated]);
|
||||
Assert.Single(journal.Pending.ToArray());
|
||||
Assert.Equal(
|
||||
RenderProjectionDeltaKind.Register,
|
||||
journal.Pending[0].Kind);
|
||||
Assert.Equal(
|
||||
RenderProjectionClass.ActiveAnimatedStatic,
|
||||
journal.Pending[0].Record.ProjectionClass);
|
||||
Assert.Equal(
|
||||
before.OwnerIncarnation,
|
||||
journal.Pending[0].Record.OwnerIncarnation);
|
||||
journal.DrainTo(scene);
|
||||
|
||||
statics.SynchronizeActiveAnimatedSources([animated]);
|
||||
Assert.Equal(0, journal.Count);
|
||||
|
||||
animated.Rotation =
|
||||
Quaternion.CreateFromAxisAngle(Vector3.UnitZ, 0.75f);
|
||||
statics.SynchronizeActiveAnimatedSources([animated]);
|
||||
Assert.Single(journal.Pending.ToArray());
|
||||
Assert.Equal(
|
||||
RenderProjectionDeltaKind.UpdateTransform,
|
||||
journal.Pending[0].Kind);
|
||||
Assert.True(statics.TryGet(animatedId, out var updated));
|
||||
Assert.Equal(animated.Rotation, updated.Transform.Rotation);
|
||||
RenderProjectionId ordinaryId =
|
||||
StaticRenderProjectionJournal.StaticEntityId(
|
||||
LandblockId,
|
||||
ordinary.Id);
|
||||
Assert.True(statics.TryGet(ordinaryId, out var unchanged));
|
||||
Assert.Equal(
|
||||
RenderProjectionClass.OutdoorStatic,
|
||||
unchanged.ProjectionClass);
|
||||
}
|
||||
|
||||
private static GpuLandblockSpatialPublication Publication(
|
||||
LandblockBuild build,
|
||||
bool requiresActivation = true) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue