Unreal Engine 5.3
I have a USceneCaptureComponent2D, Capture Source = BaseColor in RGB, anti-aliasing turned off (see screenshot below):
The scene capture writes to a UTextureRenderTarget2D, size 1024 x 1024, render target format RTF RGBA8 (see screenshot below):
The scene capture is set up to point towards a static mesh which has a basecolor material of solid red (see screenshot below). The top half part of the render target is therefore solid red, while the bottom part is solid black.
However when I count the number of pixels in the render target, I get the following:
LogTemp: Buffer[0] = 649216
LogTemp: Buffer[128] = 1024
LogTemp: Buffer[255] = 398336
The total number of pixels is correct (i.e. 649,216 + 1,024 + 398,336 = 1,048,576), which matches my render target size 1,024 * 1,024 = 1,048,576. However where red meets black, there appears to be some sort of anti-aliasing happening, resulting in a red-black blended value of 128 (0.5) running along the width of the render target a single-pixel wide. I.e. in the render target, the colors are as follows:
Rows 1-634: solid red (1)
Row 635: blend (0.5)
Rows 636-1024: solid black (0)
Note that when the entire render target is solid red, I get a count of 1,048,576 solid red pixels, and similarly when the entire render target is solid black, I get a count of 1,048,576 solid black pixels, suggesting the counting of pixels is working correctly. The issue only arises when the render target contains more than one color - at which point I get blended colors.
Why is my render target capturing colors other than the basecolor when the render target format is set to basecolor and ‘anti-aliasing’ is unchecked in the SceneCaptureComponent2D settings?