diff --git a/AGENTS.md b/AGENTS.md index 82d6b4d..a236749 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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. diff --git a/Binaries/Win64/UnrealEditor-ledcube3d.dll b/Binaries/Win64/UnrealEditor-ledcube3d.dll index 9e81ca3..7c4e452 100644 Binary files a/Binaries/Win64/UnrealEditor-ledcube3d.dll and b/Binaries/Win64/UnrealEditor-ledcube3d.dll differ diff --git a/Binaries/Win64/UnrealEditor-ledcube3d.pdb b/Binaries/Win64/UnrealEditor-ledcube3d.pdb index 3855eaf..6de0251 100644 Binary files a/Binaries/Win64/UnrealEditor-ledcube3d.pdb and b/Binaries/Win64/UnrealEditor-ledcube3d.pdb differ diff --git a/Source/ledcube3d/LedVolumeRemoteControlActor.cpp b/Source/ledcube3d/LedVolumeRemoteControlActor.cpp index ad302fc..9eb745c 100644 --- a/Source/ledcube3d/LedVolumeRemoteControlActor.cpp +++ b/Source/ledcube3d/LedVolumeRemoteControlActor.cpp @@ -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(ELedVolumeSourceMode::SublevelVoxelizedScene)); SourceMode = static_cast(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()