Quote from: Prog_11 on January 13, 2020, 10:24:06 AM
Hi pauljiao,
Thanks for your answer, but please have a heart and read my specification. There are still alias effects and the ring should be 100% transparent and the surrounding area should not be.
The very simple problem seems to be more and more an unsolvable problem...
@ BRT Community: What does your development team say?
Apologies for bumping an old thread, but I believe the issue was with the aliasing on the inner portion of the ring. By adding an additional point with blending to @pauljiao provided snippet, anti-aliasing of the inner portion can be achieved while still allowing for transparency.
Code Select
CLEAR_COLOR_RGB(255,255,255)
CLEAR_COLOR_A(255)
CLEAR(1, 1, 1)
CMD_GRADIENT(100, 207, 0x007FFF, 244, 189, 0x7FFF00)
SAVE_CONTEXT()
SCISSOR_XY(100, 100)
SCISSOR_SIZE(101, 101)
COLOR_RGB(255,255,255)
COLOR_A(255)
COLOR_MASK(0,0,0,1)
BLEND_FUNC(ZERO, ZERO)
BEGIN(RECTS)
VERTEX2F(1600, 1600)
VERTEX2F(3200, 3200)
COLOR_A(255) // Circle transparency
BLEND_FUNC(SRC_ALPHA, ZERO)
POINT_SIZE(800)
BEGIN(POINTS)
VERTEX2F(2400, 2400)
BLEND_FUNC(ZERO, ZERO)
POINT_SIZE(384)
BEGIN(POINTS)
VERTEX2F(2400, 2400)
//Anti-aliasing inner portion
BLEND_FUNC(ZERO, ONE_MINUS_SRC_ALPHA)
POINT_SIZE(416)
BEGIN(POINTS)
VERTEX2F(2400, 2400)
COLOR_RGB(245,58,41)
COLOR_A(255)
COLOR_MASK(1,1,1,1)
BLEND_FUNC(DST_ALPHA, ONE_MINUS_DST_ALPHA)
BEGIN(RECTS)
VERTEX2F(1600, 1600)
VERTEX2F(3200, 3200)
RESTORE_CONTEXT()