1
\$\begingroup\$

How do I blend two colors using SrcAlpha and OneMinusSrcAlpha when I have HDR range (rgb and a values can be > 1)?

The typical formula for non-HDR is (src * srcAlpha) + (dst * (1.0 - srcAlpha)) but this generates a negative value if srcAlpha is > 1.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ How did alpha end up greater than 1? Only the RGB channels should exceed the 0-1 range in HDR, not the 'opaqueness' or 'transparency' of a scene. \$\endgroup\$ Sep 20, 2017 at 20:29

1 Answer 1

1
\$\begingroup\$

Clamp your srcAlpha between 0 and 1.

Your pixels can't be more opaque than 100% or more transparent than 0% opacity.

\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .