diff options
author | RunitaiLinden <davep@lindenlab.com> | 2023-11-06 16:15:52 -0600 |
---|---|---|
committer | RunitaiLinden <davep@lindenlab.com> | 2023-11-06 16:15:52 -0600 |
commit | 001f2915ea24a030b9a6fb26a3ecbeedee6402bc (patch) | |
tree | b763635396895fa194c991e9e34a58f89b452d25 | |
parent | 89e4e6993f3cb11dd2206795c30834594880f52f (diff) |
SL-20570 Fix for lossy (and square) normal maps when importing GLTF materials.
-rw-r--r-- | indra/newview/llmaterialeditor.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 7a65231a2d..5be1aa08ab 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -1622,17 +1622,9 @@ static void pack_textures( if (normal_img) { - normal_j2c = LLViewerTextureList::convertToUploadFile(normal_img); - - LLPointer<LLImageJ2C> test; - test = LLViewerTextureList::convertToUploadFile(normal_img, 1024, true); - - S32 lossy_bytes = normal_j2c->getDataSize(); - S32 lossless_bytes = test->getDataSize(); - - LL_DEBUGS("MaterialEditor") << llformat("Lossless vs Lossy: (%d/%d) = %.2f", lossless_bytes, lossy_bytes, (F32)lossless_bytes / lossy_bytes) << LL_ENDL; - - normal_j2c = test; + // create a losslessly compressed version of the normal map + normal_j2c = LLViewerTextureList::convertToUploadFile(normal_img, 1024, false, true); + LL_DEBUGS("MaterialEditor") << "Normal: " << normal_j2c->getDataSize() << LL_ENDL; } if (mr_img) |