43 UFUNCTION(BlueprintCallable)
44 void SetImageSize(int32 Width, int32 Height);
46 void SetImageSize(uint32 Width, uint32 Height);
52 UFUNCTION(BlueprintCallable)
53 void SetFaceSize(int32 Side)
55 FaceSize = FMath::Max(Side, 0);
58 UFUNCTION(BlueprintCallable, BlueprintPure)
59 int32 GetFaceSize()
const
74 UFUNCTION(BlueprintCallable, BlueprintPure)
75 FIntPoint GetImageSize()
const
77 return FIntPoint(GetImageWidth(), GetImageHeight());
80 UFUNCTION(BlueprintCallable)
81 void EnablePostProcessingEffects(
bool Enable = true)
83 bEnablePostProcessingEffects = Enable;
86 UFUNCTION(BlueprintCallable, BlueprintPure)
89 UFUNCTION(BlueprintCallable)
92 UFUNCTION(BlueprintCallable, BlueprintPure)
93 float GetFOVAngle()
const;
95 UFUNCTION(BlueprintCallable, BlueprintPure)
96 float GetFOVAngleY()
const;
98 UFUNCTION(BlueprintCallable, BlueprintPure)
99 float GetFOVAngleX()
const;
101 UFUNCTION(BlueprintCallable)
102 void SetFOVAngle(
float NewFOV);
104 UFUNCTION(BlueprintCallable, BlueprintPure)
105 float GetFocalLength()
const;
107 UFUNCTION(BlueprintCallable)
108 void SetFocalLength(
float NewFocalLength);
110 void SetCameraCoefficients(TArrayView<const float> Coefficients);
112 UFUNCTION(BlueprintCallable)
113 void SetCameraCoefficients(
const TArray<float>& Coefficients);
115 UFUNCTION(BlueprintCallable, BlueprintPure)
116 const TArray<float>& GetCameraCoefficients()
const;
121 UFUNCTION(BlueprintCallable)
122 void SetLensLUT(
const TArray<float>& Samples,
float ThetaMaxRadians);
124 UFUNCTION(BlueprintCallable, BlueprintPure)
125 const TArray<
float>& GetLensLUT()
const
130 UFUNCTION(BlueprintCallable, BlueprintPure)
131 float GetLensThetaMax()
const
141 UFUNCTION(BlueprintCallable)
142 void SetLensIntrinsics(
float Fx,
float Fy,
float Cx,
float Cy);
144 UFUNCTION(BlueprintCallable, BlueprintPure)
145 bool HasExplicitLensIntrinsics()
const
147 return bExplicitIntrinsics;
150 UFUNCTION(BlueprintCallable, BlueprintPure)
151 UTextureRenderTarget2D* GetCaptureRenderTarget();
153 UFUNCTION(BlueprintCallable, BlueprintPure)
154 float GetTargetGamma()
const;
156 UFUNCTION(BlueprintCallable)
157 void SetTargetGamma(
float Gamma);
159 UFUNCTION(BlueprintCallable)
160 void SetRenderPerspective(
bool bEnable);
162 UFUNCTION(BlueprintCallable, BlueprintPure)
163 bool GetRenderPerspective()
const;
165 UFUNCTION(BlueprintCallable)
166 void SetRenderEquirectangular(
bool bEnable);
168 UFUNCTION(BlueprintCallable, BlueprintPure)
169 bool GetRenderEquirectangular()
const;
171 UFUNCTION(BlueprintCallable)
172 void SetFOVMaskEnable(
bool bEnable);
174 UFUNCTION(BlueprintCallable, BlueprintPure)
175 bool GetFOVMaskEnable()
const;
177 UFUNCTION(BlueprintCallable)
178 void SetFOVFadeSize(
float NewFOVFadeSize);
180 UFUNCTION(BlueprintCallable, BlueprintPure)
181 float GetFOVFadeSize()
const;
183 UFUNCTION(BlueprintCallable)
184 void SetRenderEquirectangularLongitudeOffset(
float Shift);
186 UFUNCTION(BlueprintCallable, BlueprintPure)
187 float GetRenderEquirectangularLongitudeOffset()
const;
191 CubemapSampler = NewCubemapSampler;
196 return CubemapSampler;
205 UFUNCTION(BlueprintCallable)
206 void SetUseRayTracing(
bool Enable);
208 UFUNCTION(BlueprintCallable, BlueprintPure)
209 bool GetUseRayTracing()
const
211 return bUseRayTracing;
216 UFUNCTION(BlueprintCallable)
217 void SetShowOnlyTags(const FString &CommaSeparatedLabels)
219 ShowOnlyFilter.SetShowOnlyTags(CommaSeparatedLabels);
222 UFUNCTION(BlueprintCallable)
223 void SetShadowCatcherTags(const FString &CommaSeparatedLabels)
225 ShowOnlyFilter.SetShadowCatcherTags(CommaSeparatedLabels);
228 UFUNCTION(BlueprintCallable)
229 void SetShowOnlyActorIds(const FString &CommaSeparatedIds)
231 ShowOnlyFilter.SetShowOnlyActorIds(CommaSeparatedIds);
234 UFUNCTION(BlueprintCallable, BlueprintPure)
235 bool IsShowOnlyEnabled()
const
237 return ShowOnlyFilter.IsEnabled();
242 return ShowOnlyFilter;
246 void EnqueueRenderSceneImmediate();
253 template <
typename TSensor>
258 if (!Sensor.AreClientsListening() || !FApp::CanEverRender())
262 Sensor.EnqueueRenderSceneImmediate();
265 *Sensor.GetCaptureRenderTarget(),
266 [&Sensor, CaptureContext](TArrayView<const FColor> Pixels, FIntPoint) ->
bool
268 if (!IsValid(&Sensor))
270 ASensor::SendDataToClient(Sensor, Pixels, CaptureContext);
274 Sensor.GetReadbackPool());
281 FlushRenderingCommands();
284 TArrayView<USceneCaptureComponent2D_CARLA*> GetCaptureComponents2D();
288 UFUNCTION(BlueprintCallable, BlueprintPure)
289 float VerticalToHorizontal(
float Value)
const;
291 UFUNCTION(BlueprintCallable, BlueprintPure)
292 uint8 FindFaceIndex(FVector2D UV)
const;
294 UFUNCTION(BlueprintCallable, BlueprintPure)
295 uint8 ComputeCubemapRenderMask()
const;
297 void CaptureSceneExtended();
299 virtual void BeginPlay()
override;
301 virtual void PrePhysTick(
float DeltaSeconds)
override;
302 virtual void PostPhysTick(UWorld *World, ELevelTick TickType,
float DeltaTime)
override;
311 return FLinearColor(0.0F, 0.0F, 0.0F, 1.0F);
314 virtual void EndPlay(
const EEndPlayReason::Type EndPlayReason)
override;
316 UPROPERTY(EditAnywhere)
319 UPROPERTY(EditAnywhere)
320 TArray<UTextureRenderTarget2D*> FaceRenderTargets;
324 UPROPERTY(EditAnywhere)
325 UTextureRenderTarget2D* CaptureRenderTarget;
327 UPROPERTY(EditAnywhere)
330 UPROPERTY(EditAnywhere)
333 UPROPERTY(EditAnywhere)
336 UPROPERTY(EditAnywhere)
339 UPROPERTY(EditAnywhere)
340 TArray<
float> KannalaBrandtCameraCoefficients;
342 UPROPERTY(EditAnywhere)
343 TArray<
float> LensLUT;
345 UPROPERTY(EditAnywhere)
349 UPROPERTY(EditAnywhere)
350 FVector4f LensIntrinsics;
352 UPROPERTY(EditAnywhere)
355 UPROPERTY(EditAnywhere)
359 UPROPERTY(EditAnywhere)
363 int32 NumCaptures = 0;
365 UPROPERTY(EditAnywhere)
368 UPROPERTY(EditAnywhere)
369 float LongitudeOffset;
371 UPROPERTY(EditAnywhere)
374 uint8 CubemapRenderMask;
376 FRHISamplerState* CubemapSampler;
382 bool bUseRayTracing : 1;
383 bool bEnablePostProcessingEffects : 1;
384 bool bEnable16BitFormat : 1;
385 bool bRenderPerspective : 1;
386 bool bRenderEquirectangular : 1;
387 bool bFOVMaskEnable : 1;
388 bool bExplicitIntrinsics : 1;