Skip to main content
2 of 2
edited body
Simon F
  • 4.3k
  • 13
  • 30

Having read PaulHK's answer, it occurred to me that a possible alternative to the 'bleed', based on premultiplied alpha, would be to initialise your unfilled area to transparent black rather than opaque green.

When you then perform the bilinear filtering, if the returned alpha is non-zero (not sure if this test is necessary or not as I can't remember the specifics of the shader rcp() function), multiply the returned, filtered (premultiplied) RGB components by the reciprocal of the alpha to get back the appropriate colour.

One would hope the alpha is always non-zero, ie. you never sample outside of regions of interest, but there may be inaccuracies in the pipeline so you might need to special case it.

Simon F
  • 4.3k
  • 13
  • 30