[4.13] How to write alpha channel when rendering to RenderTarget from Blueprints
When rendering to RenderTarget in a blueprint I need to write all 4 channels of the render target. There's no problem in writing color values (rgb), but I can't find the way to write directly to the alpha channel of the render target. Value in alpha channel is not related to color, but will be used as the mask in subsequent calls.
asked Sep 06 '16 at 10:19 AM in Rendering
After inspecting source code I found that there's not correct way to make it. However there's workaround if one wants to output all 4 channels to the empty render target. Here are the steps:
This way you will have RGBA written into render target.
It works because of blend state descripion. Following code is taken from the sources:
Since Dst.RGB is black it will not affect the result. However Alpha equation is SrcAlpha*Zero+Dst*InverseSrcAlpha, so by inversing Opacity ouput and clearing render target alpha to 1 you will have what you need.
It's shame we don't have the ability to specify custom blend state in a material...
answered Sep 13 '16 at 11:38 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here