You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 23, 2024. It is now read-only.
If the pixels have fully transparent alpha=0, but there's smaller RGB error in "b=1" mode, then alpha would get converted to 4 (in 0..255 scale).
This kind of alpha is fairly visible when drawing 2D images on the screen, so this means that you could see noticable artifacts in places which should be completely transparent.
A simple workaround, is to always force "b=0" mode, when the alpha is zero:
replace code:
for (uniform int p=0; p<4; p++)
qep[i*4+p] = (err0<err1) ? qep_b[0+p] : qep_b[4+p];
with:
if(channels==4 && ep[i*4+3]<=0.5f)err0=-1; // ESENTHEL CHANGED, BC7 allows to encode end points in 2 quantized modes, #1 standard, #2 add "0.5*levels" to all channels (1 extra bit precision, however it affects all channels at the same time, so if we have alpha=0, but RGB channels have smaller error with the extra 0.5 value, then alpha would get the +0.5 too, and it could destroy complete transparency, so this code always forces #1 version if we have alpha=0)
for (uniform int p=0; p<4; p++)
qep[i*4+p] = (err0<err1) ? qep_b[0+p] : qep_b[4+p];
Probably you could optimize it more in aspect to dynamic branching.