feat(render): implement Campaign AR and terrain fidelity
This commit is contained in:
parent
99cf26e00c
commit
7a5f96ede5
368 changed files with 50611 additions and 950 deletions
|
|
@ -169,6 +169,45 @@ public class InstanceGroupClearTests
|
|||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DispatcherFingerprint_IncludesRetailDetailCategory()
|
||||
{
|
||||
WbDrawDispatcher.InstanceGroup ordinary = MakeCompleteGroup(
|
||||
textureSlot: 0xAA,
|
||||
submissionOrder: 0);
|
||||
WbDrawDispatcher.InstanceGroup building = MakeCompleteGroup(
|
||||
textureSlot: 0xAA,
|
||||
submissionOrder: 0);
|
||||
building.DetailCategories[0] = 1u;
|
||||
var scratch = new List<WbDrawDispatcher.AlphaFingerprint>();
|
||||
|
||||
CurrentRenderDispatcherSubmission ordinarySubmission =
|
||||
WbDrawDispatcher.CreateDispatcherSubmission(
|
||||
visibleInstanceCount: 1,
|
||||
immediateInstanceCount: 0,
|
||||
deferTransparent: true,
|
||||
opaque: [],
|
||||
transparent: [ordinary],
|
||||
cameraWorldPosition: Vector3.Zero,
|
||||
alphaScratch: scratch);
|
||||
CurrentRenderDispatcherSubmission buildingSubmission =
|
||||
WbDrawDispatcher.CreateDispatcherSubmission(
|
||||
visibleInstanceCount: 1,
|
||||
immediateInstanceCount: 0,
|
||||
deferTransparent: true,
|
||||
opaque: [],
|
||||
transparent: [building],
|
||||
cameraWorldPosition: Vector3.Zero,
|
||||
alphaScratch: scratch);
|
||||
|
||||
Assert.NotEqual(
|
||||
ordinarySubmission.TransparentDigest,
|
||||
buildingSubmission.TransparentDigest);
|
||||
Assert.NotEqual(
|
||||
ordinarySubmission.TransparentSetDigest,
|
||||
buildingSubmission.TransparentSetDigest);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CachedGroupHandle_RequiresLiveMatchingRegistration()
|
||||
{
|
||||
|
|
@ -314,15 +353,16 @@ public class InstanceGroupClearTests
|
|||
group.Slots.Add(0u);
|
||||
group.LightSets.Add(WbDrawDispatcher.InstanceLightSet.Disabled);
|
||||
group.IndoorFlags.Add(0u);
|
||||
group.DetailCategories.Add(0u);
|
||||
group.Opacities.Add(1f);
|
||||
group.SelectionLighting.Add(new Vector2(0f, 1f));
|
||||
return group;
|
||||
}
|
||||
|
||||
// #193 (regression from #188, 2026-07-09): WbDrawDispatcher's InstanceGroup holds
|
||||
// eight per-instance parallel lists — Matrices, LocalSortCenters,
|
||||
// nine per-instance parallel lists — Matrices, LocalSortCenters,
|
||||
// SubmissionOrders, Slots, LightSets, IndoorFlags, Opacities, and
|
||||
// SelectionLighting — appended in lockstep
|
||||
// DetailCategories, SelectionLighting — appended in lockstep
|
||||
// (one entry per drawn instance) every frame. The
|
||||
// per-frame reset must clear ALL of them. #188 added Opacities but left it out of
|
||||
// the inline clear loop, so it grew one float per instance per frame forever; as
|
||||
|
|
@ -339,6 +379,7 @@ public class InstanceGroupClearTests
|
|||
grp.Slots.Add(1u);
|
||||
grp.LightSets.Add(WbDrawDispatcher.InstanceLightSet.Disabled);
|
||||
grp.IndoorFlags.Add(0u);
|
||||
grp.DetailCategories.Add(1u);
|
||||
grp.Opacities.Add(1.0f);
|
||||
grp.SelectionLighting.Add(new Vector2(0f, 1f));
|
||||
|
||||
|
|
@ -350,6 +391,7 @@ public class InstanceGroupClearTests
|
|||
Assert.Empty(grp.Slots);
|
||||
Assert.Empty(grp.LightSets);
|
||||
Assert.Empty(grp.IndoorFlags);
|
||||
Assert.Empty(grp.DetailCategories);
|
||||
Assert.Empty(grp.Opacities); // #193 — the list that leaked
|
||||
Assert.Empty(grp.SelectionLighting);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue