26 auto CVarForceOutputsVelocity = IConsoleManager::Get().FindConsoleVariable(TEXT(
"r.BasePassForceOutputsVelocity"));
27 int32 OldValue = CVarForceOutputsVelocity->GetInt();
28 CVarForceOutputsVelocity->Set(1);
30 std::function<TArray<float>(
void *, uint32)> Conversor = [](
void *Data, uint32 Size)
32 TArray<float> IntermediateBuffer;
33 int32 Count = Size /
sizeof(FFloat16Color);
35 FFloat16Color *Buf =
reinterpret_cast<FFloat16Color *
>(Data);
36 IntermediateBuffer.Reserve(Count * 2);
37 for (
int i=0; i<Count; ++i)
39 float x = (Buf->R.GetFloat() - 0.5f) * 4.f;
40 float y = (Buf->G.GetFloat() - 0.5f) * 4.f;
41 IntermediateBuffer.Add(x);
42 IntermediateBuffer.Add(y);
45 return IntermediateBuffer;
47 FPixelReader::SendPixelsInRenderThread<AOpticalFlowCamera, float>(*
this,
true, Conversor);
49 CVarForceOutputsVelocity->Set(OldValue);