mirror of
https://github.com/drewcassidy/quicktex.git
synced 2024-09-13 06:37:34 +00:00
Fix matrix inversion
This commit is contained in:
@ -602,6 +602,7 @@ template <ColorMode M> bool BC1Encoder::RefineEndpointsLS(Color4x4 pixels, Encod
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::swap(matrix[0], matrix[3]);
|
||||||
matrix *= Vector4(1, -1, -1, 1);
|
matrix *= Vector4(1, -1, -1, 1);
|
||||||
matrix *= ((float)denominator / 255.0f) / det;
|
matrix *= ((float)denominator / 255.0f) / det;
|
||||||
|
|
||||||
|
@ -74,6 +74,7 @@ template <size_t N> class OrderTable {
|
|||||||
if (fabs(det) < 1e-8f) {
|
if (fabs(det) < 1e-8f) {
|
||||||
factors->at(i) = Vector4(0);
|
factors->at(i) = Vector4(0);
|
||||||
} else {
|
} else {
|
||||||
|
std::swap(factor_matrix[0], factor_matrix[3]);
|
||||||
factor_matrix *= Vector4(1, -1, -1, 1);
|
factor_matrix *= Vector4(1, -1, -1, 1);
|
||||||
factor_matrix *= (denominator / 255.0f) / det;
|
factor_matrix *= (denominator / 255.0f) / det;
|
||||||
factors->at(i) = factor_matrix;
|
factors->at(i) = factor_matrix;
|
||||||
|
Reference in New Issue
Block a user