Description:
When setting the LoadAction::clear, the renderer always multiplies the RGB channels with the alpha channel value.
The Issue:
This behavior is undesired in certain scenarios where artifacts show at the borders of rendered shapes. The attached image shows artifacts around the white stroke of the camera button. Usually this issue can be fixed by using a clearColor with the same RGB values as the stroke and an alpha of 0. However, when the multiplication is applied, that clearColor becomes effectively black. In other words: the renderer lacks the option to accept an already premultiplied clearColor.
Proposed Fix:
Introduce a secondary clear mode named LoadAction::clearPremultiplied or a boolean option in RenderContext::FrameDescriptor named premultipliedClearColor (with default false to preserve previously expected behavior).
Description:
When setting the LoadAction::clear, the renderer always multiplies the RGB channels with the alpha channel value.
The Issue:
This behavior is undesired in certain scenarios where artifacts show at the borders of rendered shapes. The attached image shows artifacts around the white stroke of the camera button. Usually this issue can be fixed by using a clearColor with the same RGB values as the stroke and an alpha of 0. However, when the multiplication is applied, that clearColor becomes effectively black. In other words: the renderer lacks the option to accept an already premultiplied clearColor.
Proposed Fix:
Introduce a secondary clear mode named LoadAction::clearPremultiplied or a boolean option in RenderContext::FrameDescriptor named premultipliedClearColor (with default false to preserve previously expected behavior).