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:
parent
ac62e1c262
commit
f7f5a10b66
@ -602,6 +602,7 @@ template <ColorMode M> bool BC1Encoder::RefineEndpointsLS(Color4x4 pixels, Encod
|
||||
return false;
|
||||
}
|
||||
|
||||
std::swap(matrix[0], matrix[3]);
|
||||
matrix *= Vector4(1, -1, -1, 1);
|
||||
matrix *= ((float)denominator / 255.0f) / det;
|
||||
|
||||
|
@ -74,6 +74,7 @@ template <size_t N> class OrderTable {
|
||||
if (fabs(det) < 1e-8f) {
|
||||
factors->at(i) = Vector4(0);
|
||||
} else {
|
||||
std::swap(factor_matrix[0], factor_matrix[3]);
|
||||
factor_matrix *= Vector4(1, -1, -1, 1);
|
||||
factor_matrix *= (denominator / 255.0f) / det;
|
||||
factors->at(i) = factor_matrix;
|
||||
|
Loading…
Reference in New Issue
Block a user