SceneCaptureComponent2D low fps

I am making a car simulation. There are a three mirrors in the car for observing back. For these mirros, i used SceneCapture2D component. I am creating materials and textures at runtime.

UCanvasRenderTarget2D* RightMirrorTexture = UCanvasRenderTarget2D::CreateCanvasRenderTarget2D(GetWorld(), UCanvasRenderTarget2D::StaticClass(), 1250, 350);
RightMaterial->SetTextureParameterValue("RenderTargetTexture", RightMirrorTexture);

UCanvasRenderTarget2D* MiddleMirrorTexture = UCanvasRenderTarget2D::CreateCanvasRenderTarget2D(GetWorld(), UCanvasRenderTarget2D::StaticClass(), 1250, 350);
MiddleMaterial->SetTextureParameterValue("RenderTargetTexture", MiddleMirrorTexture);

UCanvasRenderTarget2D* LeftMirrorTexture = UCanvasRenderTarget2D::CreateCanvasRenderTarget2D(GetWorld(), UCanvasRenderTarget2D::StaticClass(), 1250, 350);
LeftMaterial->SetTextureParameterValue("RenderTargetTexture", LeftMirrorTexture);

RightMiddleRenderer->TextureTarget = RightMirrorTexture
MiddleMirrorRenderer->TextureTarget = MiddleMirrorTexture;
LeftMirrorRenderer->TextureTarget = LeftMirrorTexture;

Images are fine but performance impact is HUGE. When i lower the Width and Height fileds of textures, image quality reduces but there is no impact to performance. (I tried 125x35 over 1250x350, low image quality, same FPS.) I disabled “CaptureEveryFrame” field for every SceneCaptureComponent2D but I need more performance. Size of mirrors are little so reducing render resolution is fine for me. How can i reduce render resolution for SceneCapture2D Component?

what about this:

put a single angular camera and one single capture in the back of the car
then by materials you just crop the capture and put each part in each mirror.
this way you triple performance.

also check flags in the scene capture camera :slight_smile:

Idk…just an idea.
Cheers!

Dany

Thanks a lot for the flags. I removed unnecessary flags already.

put a single angular camera and one single capture in the back of the car
then by materials you just crop the capture and put each part in each mirror.
this way you triple performance.

Thanks for this advice also. How can i crop the capture? One SceneCapture and only one texture? How can i split one texture to three parts at runtime ?

you can tweak a material like this so you can adjust tiling/offset of the texture:

I did a video to show you:

Cheers!
Dany

1 Like

Thank you so much. I am starting to try right now.

1 Like

Is it possible do this for three planes ?

split a texture into different crops by material?
sure why noy

1 Like

you can tweak a material like this so you can adjust tiling/offset of the texture:

This method did indeed impact performance. But I still get 90fps at 1080p resolution on blank scene with 3070. Considering that the scene is empty, I need to increase the fps even more. I set Tick Interval of SceneCaptureComponent to 0,04 btw. Is there really no way to make SceneCaptureComponent render at lower resolution?

I dont believe a simple material with tiling and offset would be noticeable in terms of performance. But not 100% sure. With regular bitmaps performance of this method is not relevant