Can a UTextureRenderTarget2D have any pixel format other than the default “PF_FloatRGBA” when used with a USceneCaptureComponent2D source?
These are defined in te header file:
USceneCaptureComponent2D *Camera;
UTextureRenderTarget2D *RenderTarget;
Then in the Actor class definition:
Camera = CreateDefaultSubobject<USceneCaptureComponent2D>(TEXT(“Camera”));
RenderTarget = NewObject<UTextureRenderTarget2D>();
RenderTarget->InitAutoFormat(512, 512);
Camera->TextureTarget = RenderTarget;
Above compiles no problem but…
Camera = CreateDefaultSubobject<USceneCaptureComponent2D>(TEXT(“Camera”));
RenderTarget = NewObject<UTextureRenderTarget2D>();
RenderTarget->InitAutoFormat(512, 512);
RenderTarget->OverrideFormat = EPixelFormat::PF_A8R8G8B8;
Camera->TextureTarget = RenderTarget;
Crashes the editor.
Is there a way to configure this correctly?
Thanks for any help!