Merge fix for issue 134 into trunk.
This commit is contained in:
@ -132,7 +132,7 @@ void NormalCompressorDXT1a::compressBlock(ColorBlock & rgba, nvtt::AlphaMode alp
|
|||||||
uint alphaMask = 0;
|
uint alphaMask = 0;
|
||||||
for (uint i = 0; i < 16; i++)
|
for (uint i = 0; i < 16; i++)
|
||||||
{
|
{
|
||||||
if (rgba.color(i).a < 128) alphaMask |= (3 << (i * 2)); // Set two bits for each color.
|
if (rgba.color(i).a == 0) alphaMask |= (3 << (i * 2)); // Set two bits for each color.
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool isSingleColor = rgba.isSingleColor();
|
const bool isSingleColor = rgba.isSingleColor();
|
||||||
|
@ -533,7 +533,7 @@ void QuickCompress::compressDXT1a(const ColorBlock & rgba, BlockDXT1 * dxtBlock)
|
|||||||
|
|
||||||
for (uint i = 0; i < 16; i++)
|
for (uint i = 0; i < 16; i++)
|
||||||
{
|
{
|
||||||
if (rgba.color(i).a < 128) {
|
if (rgba.color(i).a == 0) {
|
||||||
hasAlpha = true;
|
hasAlpha = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -482,8 +482,11 @@ int main(int argc, char *argv[])
|
|||||||
// Dither alpha when using BC2.
|
// Dither alpha when using BC2.
|
||||||
compressionOptions.setQuantization(false, true, false);
|
compressionOptions.setQuantization(false, true, false);
|
||||||
}
|
}
|
||||||
|
else if (format == nvtt::Format_BC1a) {
|
||||||
if (format == nvtt::Format_RGBA)
|
// Binary alpha when using BC1a.
|
||||||
|
compressionOptions.setQuantization(false, true, true, 127);
|
||||||
|
}
|
||||||
|
else if (format == nvtt::Format_RGBA)
|
||||||
{
|
{
|
||||||
if (luminance)
|
if (luminance)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user