Description

When a Niagara System has SimTarget set to GPUCompute Sim, CameraQuery is only returning data from the Player0 camera, regardless of PlayerControllerIndex. The expected behavior would be to have the CameraQuery fetch data from the Player camera matching the PlayerControllerIndex, as it happens when we set SimTarget to CPUSim: the CameraQuery correctly matches the correct Player_Index camera.
I've tested this on the latest Perforce 5.6 version and the issue is still present.
I've added a Repro project to the report.
If you run the repro project and Play In Editor, two players will show up. The top one is Player0 and the bottom is Player1. If you change FS_FountainTemplate - Select Fountain, ParticleSpawn>ScratchModule>CameraQuery>PlayerControllerIndex to either 0 or 1 and save you will notice that the behavior does not change in the scene, the fountain particle will always show up on top of Player0 (what is most visible from Player1's perspective).
The licensee, as a workaround, modified NiagaraDataInterfaceCamera.ush to accept the Camera Location as a shader parameter, and passed this value in directly.

Steps to Reproduce

Check the repro project for a setup already reproduced.
To recreate the issue, spawn at least two local players with player controllers.
Create a Niagara system from the Fountain Template
Ensure that the Emitter's Sim Target is set to GPUCompute Sim. I also set Calculate Bounds Mode to Fixed and increased the bounds to about 1000 in every direction.
Use Camera Query to affect the particle in some fashion by creating a Scratch Module at the end of Particle Spawn.
Then, in the Scratch Module, I created a Camera Query pin on Map Get, called Get View Properties GPU, and then dragged View Position World to a new Particles Position pin on Map Set.
Set Player Controller Index to 1 (on the Scratch Module), add the Niagara System to the world, and play.
The Fountain particle will follow Player0's camera.

Callstack

> UnrealEditor-Niagara.dll!UNiagaraDataInterfaceCamera::PerInstanceTick(void * PerInstanceData, FNiagaraSystemInstance * SystemInstance, float DeltaSeconds) Line 93 C++
UnrealEditor-Niagara.dll!FNiagaraSystemInstance::TickDataInterfaces(float DeltaSeconds, bool bPostSimulate) Line 1760 C++
UnrealEditor-Niagara.dll!FNiagaraSystemInstance::Tick_GameThread(float DeltaSeconds) Line 2479 C++
UnrealEditor-Niagara.dll!FNiagaraSystemSimulation::Spawn_GameThread(float DeltaSeconds, bool bPostActorTick) Line 1449 C++
UnrealEditor-Niagara.dll!FNiagaraWorldManager::Tick(ETickingGroup TickGroup, float DeltaSeconds, ELevelTick TickType, ENamedThreads::Type CurrentThread, const TRefCountPtr<FGraphEvent> & MyCompletionGraphEvent) Line 1445 C++
UnrealEditor-Niagara.dll!FNiagaraWorldManagerTickFunction::ExecuteTick(float DeltaTime, ELevelTick TickType, ENamedThreads::Type CurrentThread, const TRefCountPtr<FGraphEvent> & MyCompletionGraphEvent) Line 325 C++
UnrealEditor-Engine.dll!FTickFunctionTask::DoTask(ENamedThreads::Type CurrentThread, const TRefCountPtr<FGraphEvent> & MyCompletionGraphEvent) Line 278 C++
UnrealEditor-Engine.dll!TGraphTask<FTickFunctionTask>::ExecuteTask(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32>> & NewTasks, ENamedThreads::Type CurrentThread, bool bDeleteOnCompletion) Line 1235 C++
[Inline Frame] UnrealEditor-Core.dll!FBaseGraphTask::Execute(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32>> & CurrentThread, ENamedThreads::Type) Line 840 C++
UnrealEditor-Core.dll!FNamedTaskThread::ProcessTasksNamedThread(int QueueIndex, bool bAllowStall) Line 760 C++
UnrealEditor-Core.dll!FNamedTaskThread::ProcessTasksUntilQuit(int QueueIndex) Line 651 C++
[Inline Frame] UnrealEditor-Core.dll!FTaskGraphCompatibilityImplementation::ProcessThreadUntilRequestReturn(ENamedThreads::Type) Line 2068 C++
UnrealEditor-Core.dll!FTaskGraphCompatibilityImplementation::WaitUntilTasksComplete(const TArray<TRefCountPtr<FGraphEvent>,TSizedInlineAllocator<4,32,TSizedDefaultAllocator<32>>> & Tasks, ENamedThreads::Type CurrentThreadIfKnown) Line 2122 C++
UnrealEditor-Engine.dll!FTickTaskSequencer::ReleaseTickGroup(ETickingGroup WorldTickGroup, bool bBlockTillComplete) Line 556 C++
UnrealEditor-Engine.dll!FTickTaskManager::RunTickGroup(ETickingGroup Group, bool bBlockTillComplete) Line 1583 C++
UnrealEditor-Engine.dll!UWorld::RunTickGroup(ETickingGroup Group, bool bBlockTillComplete) Line 772 C++
UnrealEditor-Engine.dll!UWorld::Tick(ELevelTick TickType, float DeltaSeconds) Line 1508 C++
UnrealEditor-UnrealEd.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 1805 C++
UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 550 C++
UnrealEditor.exe!FEngineLoop::Tick() Line 5921 C++
[Inline Frame] UnrealEditor.exe!EngineTick() Line 61 C++
UnrealEditor.exe!GuardedMain(const wchar_t * CmdLine) Line 180 C++
UnrealEditor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 247 C++
UnrealEditor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 298 C++
[External Code]

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-229949 in the post.

0
Login to Vote

Unresolved
Affects Versions5.65.4.4
CreatedNov 8, 2024
UpdatedNov 8, 2024
View Jira Issue