Guard sublevel source from GPU test pattern

This commit is contained in:
krustophski 2026-08-07 04:53:58 +03:00
parent c52da4073e
commit 7aad09245a
4 changed files with 23 additions and 1 deletions

View file

@ -109,6 +109,8 @@ Sublevel source notes:
- `ALedVolumeDisplayActor` streams the selected `VoxelizedSublevel` dynamically before sampling.
- Sublevel voxelization is incremental and uses `ColorUpdatesPerFrame` as the per-frame sampling budget; do not sample all 120^3 voxels in one frame.
- GPU-first rule: avoid CPU voxelization for final 120^3 workflows. CPU sublevel sampling is only a temporary/editor preview path.
- When adding a new source/animation, prefer GPU material parameters, volume textures, Niagara/render-target driven data, or compute-shader/RDG paths over per-voxel CPU loops.
- Source actors must have tag `LedVoxelSource`.
- `ARotatingSnowflakeActor` creates a rotating 3D snowflake from many small static mesh crystals so the bounds-based sampler sees a volumetric shape.

View file

@ -551,6 +551,10 @@ void ALedVolumeRemoteControlActor::SetSolidColor(FLinearColor NewValue)
void ALedVolumeRemoteControlActor::SetSourceMode(ELedVolumeSourceMode NewValue)
{
SourceMode = NewValue;
if (SourceMode != ELedVolumeSourceMode::TestPattern)
{
bUseGpuTestPattern = false;
}
ApplyToTarget();
}
@ -558,6 +562,10 @@ void ALedVolumeRemoteControlActor::SetSourceModeIndex(int32 NewValue)
{
const int32 ClampedValue = FMath::Clamp(NewValue, 0, static_cast<int32>(ELedVolumeSourceMode::SublevelVoxelizedScene));
SourceMode = static_cast<ELedVolumeSourceMode>(ClampedValue);
if (SourceMode != ELedVolumeSourceMode::TestPattern)
{
bUseGpuTestPattern = false;
}
ApplyToTarget();
}
@ -588,7 +596,7 @@ void ALedVolumeRemoteControlActor::SetAnimateInEditor(bool bNewValue)
void ALedVolumeRemoteControlActor::SetUseGpuTestPattern(bool bNewValue)
{
bUseGpuTestPattern = bNewValue;
bUseGpuTestPattern = bNewValue && SourceMode == ELedVolumeSourceMode::TestPattern;
ApplyToTarget();
}
@ -648,6 +656,18 @@ void ALedVolumeRemoteControlActor::ClampSettings()
MaxRuntimeInstances = FMath::Max(1024, MaxRuntimeInstances);
ColorUpdatesPerFrame = FMath::Max(1, ColorUpdatesPerFrame);
ApplyDebounceSeconds = FMath::Clamp(ApplyDebounceSeconds, 0.0f, 2.0f);
if (SourceMode != ELedVolumeSourceMode::TestPattern)
{
bUseGpuTestPattern = false;
}
if (SourceMode == ELedVolumeSourceMode::SublevelVoxelizedScene)
{
ColorUpdatesPerFrame = FMath::Clamp(ColorUpdatesPerFrame, 1, 1024);
if (PreviewStride < 4)
{
PreviewStride = 4;
}
}
}
void ALedVolumeRemoteControlActor::ApplySublevelSourcePreset()