10 #include "ConstructorHelpers.h" 11 #include "Materials/MaterialInstanceDynamic.h" 12 #include "Components/SceneCaptureComponent2D.h" 17 ConstructorHelpers::FObjectFinder<UMaterial> Loader(*Path);
18 if (Loader.Succeeded())
22 return Loader.Succeeded();
30 AddShader({UMaterialInstanceDynamic::Create(MaterialFound,
this), 1.0});
33 for (
const auto &Shader :
Shaders)
36 SceneCapture.PostProcessSettings.AddBlendable(Shader.PostProcessMaterial, Shader.Weight);
42 Shaders[ParameterValue.ShaderIndex].PostProcessMaterial->SetScalarParameterValue(
43 ParameterValue.ParameterName,
44 ParameterValue.Value);
50 Super::Set(Description);
56 const FName &ParameterName,
TArray< FShaderFloatParameterValue > FloatShaderParams
void SetFloatShaderParameter(uint8_t ShaderIndex, const FName &ParameterName, float Value)
std::vector< cg::Location > Path
TArray< UMaterial * > MaterialsFound
bool AddPostProcessingMaterial(const FString &Path)
Load the UMaterialInstanceDynamic at the given Path and append it to the list of shaders with Weight...
static void SetCamera(const FActorDescription &Description, ASceneCaptureSensor *Camera)
void Set(const FActorDescription &ActorDescription) override
A description of a Carla Actor with all its variation.
void AddShader(const FSensorShader &Shader)
Add a post-processing shader.
TArray< FSensorShader > Shaders
void SetUpSceneCaptureComponent(USceneCaptureComponent2D &SceneCapture) override