From 7eebf1462ab07fb6462e4a26b3814fa1c3f9a8d0 Mon Sep 17 00:00:00 2001 From: Ji-Rath Date: Thu, 14 Jul 2022 14:34:37 -0500 Subject: [PATCH 1/2] Update ISMPerInstanceDataProcessors.cpp Add chunk filter and requirement query to avoid potential crashes when dealing with ISM Custom Data --- .../Representation/Processors/ISMPerInstanceDataProcessors.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Plugins/MassCommunitySample/Source/MassCommunitySample/Representation/Processors/ISMPerInstanceDataProcessors.cpp b/Plugins/MassCommunitySample/Source/MassCommunitySample/Representation/Processors/ISMPerInstanceDataProcessors.cpp index b8b0334..3802aec 100644 --- a/Plugins/MassCommunitySample/Source/MassCommunitySample/Representation/Processors/ISMPerInstanceDataProcessors.cpp +++ b/Plugins/MassCommunitySample/Source/MassCommunitySample/Representation/Processors/ISMPerInstanceDataProcessors.cpp @@ -16,6 +16,8 @@ void UismPerInstanceDataUpdater::ConfigureQueries() EntityQuery.AddRequirement(EMassFragmentAccess::ReadWrite); EntityQuery.AddRequirement(EMassFragmentAccess::ReadOnly); EntityQuery.AddSharedRequirement(EMassFragmentAccess::ReadWrite); + EntityQuery.AddChunkRequirement(EMassFragmentAccess::ReadOnly); + EntityQuery.SetChunkFilter(&FMassVisualizationChunkFragment::AreAnyEntitiesVisibleInChunk); } void UismPerInstanceDataUpdater::Execute(UMassEntitySubsystem& EntitySubsystem, FMassExecutionContext& Context) From 30b3cab3e7aebbda3880e2e75379342aee17f29d Mon Sep 17 00:00:00 2001 From: Ji-Rath Date: Thu, 14 Jul 2022 18:02:41 -0500 Subject: [PATCH 2/2] Add PrevLODSignificance when sending batched custom data. This allows the previous significance range to also receive the data (my guess for a smoother transition) --- .../Representation/Processors/ISMPerInstanceDataProcessors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/MassCommunitySample/Source/MassCommunitySample/Representation/Processors/ISMPerInstanceDataProcessors.cpp b/Plugins/MassCommunitySample/Source/MassCommunitySample/Representation/Processors/ISMPerInstanceDataProcessors.cpp index 3802aec..4c61367 100644 --- a/Plugins/MassCommunitySample/Source/MassCommunitySample/Representation/Processors/ISMPerInstanceDataProcessors.cpp +++ b/Plugins/MassCommunitySample/Source/MassCommunitySample/Representation/Processors/ISMPerInstanceDataProcessors.cpp @@ -44,7 +44,7 @@ void UismPerInstanceDataUpdater::Execute(UMassEntitySubsystem& EntitySubsystem, // This can accept any struct that the size of n floats. It seems to be required to be called every frame we want to change it - ISMInfo.AddBatchedCustomData(RenderData.Data, RepresentationLOD.LODSignificance); + ISMInfo.AddBatchedCustomData(RenderData.Data, RepresentationLOD.LODSignificance, Representation.PrevLODSignificance); } } });