BRT Community

General Category => Discussion - EVE => Topic started by: JeffC on June 08, 2020, 01:11:27 PM

Title: Color Mask and Blending ... Background
Post by: JeffC on June 08, 2020, 01:11:27 PM
Hi. I would like to (better) understand the EVE engine. I am drawing a red colored rectangle, with COLOR_MASK set to only affect reds, yet the result is a vaguely red rectangle. Allowing green and blue in the COLOR_MASK makes the red rectangle more red. Here's the display list:

CLEAR_COLOR_RGB(127,127,127) // mid grey background
CLEAR(1, 1, 1)
BEGIN(RECTS)

COLOR_RGB(255,0,0)

COLOR_MASK(1, 0, 0, 0)
BLEND_FUNC(ONE, ZERO)
VERTEX2II(124, 309, 0, 0)
VERTEX2II(260, 444, 0, 0)

I thought the math was
target red = ONE (from BLEND_FUNC) * 255 (source color) + ZERO (from BLEND_FUNC) * 127 (destination/background)
target green/blue/alpha unaffected due to COLOR_MASK

What am I missing ? Thanks !