CARLA
Loading...
Searching...
No Matches
InstanceSegmentationCamera_WideAngleLens.cpp
Go to the documentation of this file.
1// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
8#include "Carla.h"
11
13
19
21 const FObjectInitializer &ObjectInitializer)
22 : Super(ObjectInitializer)
23{
24 Super::SetCubemapSampler(CameraModelUtil::GetSampler(ESamplerFilter::SF_Point));
25
27 TEXT("Material'/Game/Carla/PostProcessMaterials/M_InstanceSegmentationSensorMaterial'"));
28}
29
31 TArrayView<USceneCaptureComponent2D_CARLA*> SceneCaptures)
32{
33 Super::SetUpSceneCaptureComponents(SceneCaptures);
34 // The post-process material samples the segmentation ID buffer; the
35 // renderer only produces it for captures that opt in (same as the pinhole
36 // AInstanceSegmentationCamera). Without this the six faces read an
37 // unwritten buffer and the projected image is noise.
38 for (auto SceneCapture : SceneCaptures)
39 if (SceneCapture != nullptr)
40 SceneCapture->bRequiresSegmentationPass = true;
41}
42
44 UWorld *World, ELevelTick TickType, float DeltaSeconds)
45{
47 // Skip the whole 6-face capture + compute + readback pipeline when no
48 // client is subscribed.
50 return;
52}
void SetUpSceneCaptureComponents(TArrayView< USceneCaptureComponent2D_CARLA * > SceneCaptures) override
AInstanceSegmentationCamera_WideAngleLens(const FObjectInitializer &ObjectInitializer)
void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds) override
static void CaptureAndSendToClient(TSensor &Sensor)
Capture the six faces, project them into the lens, and deliver the image through ImageUtil's per-tick...
static FActorDefinition MakeWideAngleLensCameraDefinition(const FString &Id, bool bEnableModifyingPostProcessEffects=false)
FRHISamplerState * GetSampler(ESamplerFilter Filter)
A definition of a Carla Actor with all the variation and attributes.