19 static IConsoleVariable *CVar =
20 IConsoleManager::Get().FindConsoleVariable(TEXT(
"r.RayTracing.NonBlockingPipelineCreation"));
23 static int32 ValueBeforeOverride = INDEX_NONE;
24 static bool bWarnedConsoleOverride =
false;
33 if (ValueBeforeOverride != INDEX_NONE)
35 CVar->Set(ValueBeforeOverride, ECVF_SetByCode);
37 TEXT(
"rt_lens: asynchronous mode, r.RayTracing.NonBlockingPipelineCreation restored to %d"),
39 ValueBeforeOverride = INDEX_NONE;
44 if (CVar->GetInt() == 0)
51 if (((uint32)CVar->GetFlags() & ECVF_SetByMask) > (uint32)ECVF_SetByCode)
53 if (!bWarnedConsoleOverride)
55 bWarnedConsoleOverride =
true;
56 UE_LOG(LogCarla, Warning,
57 TEXT(
"rt_lens: r.RayTracing.NonBlockingPipelineCreation is forced to %d from the console; ")
58 TEXT(
"synchronous-mode frames will miss freshly spawned actors while their ray tracing ")
59 TEXT(
"pipeline compiles (they render with the black, untagged PathTracingDefaultOpaqueCHS)."),
65 ValueBeforeOverride = CVar->GetInt();
66 CVar->Set(0, ECVF_SetByCode);
68 TEXT(
"rt_lens: synchronous mode, r.RayTracing.NonBlockingPipelineCreation 0 (was %d): ")
69 TEXT(
"captures wait for the ray tracing material pipeline instead of rendering new actors ")
70 TEXT(
"with the fallback hit shader"),
76 PostProcessSettings.bOverride_PathTracingLensModel =
true;
77 PostProcessSettings.bOverride_PathTracingLensFocal =
true;
78 PostProcessSettings.bOverride_PathTracingLensCoeffs01 =
true;
79 PostProcessSettings.bOverride_PathTracingLensCoeffs23 =
true;
80 PostProcessSettings.bOverride_PathTracingLensThetaMax =
true;
81 PostProcessSettings.bOverride_PathTracingLensCAScale =
true;
83 PostProcessSettings.PathTracingLensModel = (int32)Descriptor.
Model;
85 PostProcessSettings.PathTracingLensFocal = FVector4(
91 const auto CoeffAt = [&Descriptor](int32 i) ->
float
93 return Descriptor.
Coeffs.IsValidIndex(i) ? Descriptor.
Coeffs[i] : 0.0f;
95 PostProcessSettings.PathTracingLensCoeffs01 = FVector4(
96 CoeffAt(0), CoeffAt(1), CoeffAt(2), CoeffAt(3));
97 PostProcessSettings.PathTracingLensCoeffs23 = FVector4(
98 CoeffAt(4), CoeffAt(5), CoeffAt(6), CoeffAt(7));
100 PostProcessSettings.PathTracingLensThetaMax = Descriptor.
ThetaMax;
101 PostProcessSettings.PathTracingLensCAScale = FVector2f(Descriptor.
CAScaleR, Descriptor.
CAScaleB);
109 UE_LOG(LogCarla, Warning,
110 TEXT(
"RTLensEngineAdapter: camera_model=lut has no per-view upload path for its LUT ")
111 TEXT(
"samples yet; the path tracer will not see them."));