Description

CL23957356 changes how to calculate FrameOffset in FNiagaraSystemUpdateDesiredAgeExecutionToken::Execute(). After this change, DesiredAge + FrameOffset could be 0.0 for some a couple of initial frames and some Niagara FXs which show up visual element from 0 frame and disappear in a short period can not be recorded by Movie Scene Capture because NiagaraComponent->SetDesiredAge(0.0f) does not trigger Niagara's tick.

A possible workaround is to call ManualTick with very short period when DesiredAge + FrameOffset == 0.0f

if (DesiredAge >= 0)
{
	// Add a quarter of a frame offset here to push the desired age into the middle of the frame since it will be automatically rounded
	// down to the nearest seek delta.  This prevents a situation where float rounding results in a value which is just slightly less than
	// the frame boundary, which results in a skipped simulation frame.
	const float FrameOffset = NiagaraComponent->GetLockDesiredAgeDeltaTimeToSeekDelta() ? (NiagaraComponent->GetSeekDelta() / 4.0f) : 0.0f;
	NiagaraComponent->SetDesiredAge(DesiredAge + FrameOffset);
+	if (DesiredAge + FrameOffset == 0.0f)
+	{
+		SystemInstanceController->ManualTick(UE_KINDA_SMALL_NUMBER, nullptr);
+	}
}

 Or Add very small number to SetDesiredAge() call;

if (DesiredAge >= 0)
{
	// Add a quarter of a frame offset here to push the desired age into the middle of the frame since it will be automatically rounded
	// down to the nearest seek delta.  This prevents a situation where float rounding results in a value which is just slightly less than
	// the frame boundary, which results in a skipped simulation frame.
	const float FrameOffset = NiagaraComponent->GetLockDesiredAgeDeltaTimeToSeekDelta() ? (NiagaraComponent->GetSeekDelta() / 4.0f) : 0.0f;
-	NiagaraComponent->SetDesiredAge(DesiredAge + FrameOffset);
+	NiagaraComponent->SetDesiredAge(DesiredAge + FrameOffset + UE_KINDA_SMALL_NUMBER);
}
Steps to Reproduce
  1. Download the repro project, MovieSceneCapture.zip from attachment.
  2. Unzip it and open the project.
  3. Open LevelSequence, LS_Test from the content browser
  4. Click playback button to see how Niagara FX works (a red arc is rotating on screen for a short moment)
  5. Open Kebab menu next to clapperboard icon and make sure Movie Scene Capture (Legacy) is selected.
  6. Click the clapperboard icon then click "Capture Movie" button.
  7. Watch the recorded video.

Expected Result: The video playbacks the same Niagara VFX behavior as Step 4

Actual Result: No VFX in the video

Note: Selecting "Tick Delta Time" in System Life Track track makes it possible for Movie Scene Capture to record VFX. Also,  "Desired Age" can fix no VFX issue but the customer reported that the timing is a bit later than UE5.1 era.

Movie_Diff.zip contains six short videos to explain how each option changed the video output between 5.1 and 5.2 & later.

Have Comments or More Details?

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

0
Login to Vote

Backlogged
ComponentUE - Niagara
Affects Versions5.2.15.3.25.4.4
CreatedSep 17, 2024
UpdatedOct 29, 2024
View Jira Issue