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 has been 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.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The problem lies in the 'ep_quant0367'
https://github.com/GameTechDev/ISPCTextureCompressor/blob/master/ISPC%20Texture%20Compressor/ispc_texcomp/kernel.ispc#L973
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:
with:
Probably you could optimize it more in aspect to dynamic branching.
The text was updated successfully, but these errors were encountered: