Unreal Engine 5.4, Alpha channel is enabled in project setting as below
So alpha channel is included in final output, I can get the rendered result with alpha channel from back buffer.
I am trying to remove(cut) pixels basing on stencil buffer. For those pixels they should be rendered as transparent on the RenderTarget.
First I tried PostProcessingMaterial, it does not work because it just does not support. This is also clarified in its document.
So I am trying to implement custom render pass. Full code example is here
I tried to change the above shader code to return specific alpha value. I do see color change when it swap x
and z
. but the alpha component does not take effect no matter I supply 0
or 1
float4 OutputColor = float4(OriginalColor.z, OriginalColor.y, OriginalColor.x, 0.0 /* 1.0*/ );
From the source code, the output alpha channel is copied into SceneColor.
I don’t quite understand. There are transparent pixels. But why I cannot change the alpha in SceneColor.
The alphas are stored seperated than SceneColor
? cant believe that.
Can anyone provide some hint?