From 1322fef56856c1e694e1bcd6192f93115e20b7f5 Mon Sep 17 00:00:00 2001 From: Olivier Prat Date: Fri, 5 Apr 2019 20:15:58 +0200 Subject: [PATCH] Taking into account samuel's remarks --- libraries/baking/src/TextureBaker.cpp | 6 +----- libraries/image/src/image/CubeMap.cpp | 8 ++++---- libraries/image/src/image/TextureProcessing.cpp | 1 - tools/oven/src/ui/SkyboxBakeWidget.cpp | 6 +++--- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/libraries/baking/src/TextureBaker.cpp b/libraries/baking/src/TextureBaker.cpp index bed0e9a40b..54d304b7d8 100644 --- a/libraries/baking/src/TextureBaker.cpp +++ b/libraries/baking/src/TextureBaker.cpp @@ -133,11 +133,7 @@ void TextureBaker::processTexture() { // so we add that to the processed texture before handling it off to be serialized QCryptographicHash hasher(QCryptographicHash::Md5); hasher.addData(_originalTexture); - // An ambient texture is built with the same pixel data as sky texture but its Mip Maps are different - // so we mustn't use one instead of the other. - if (_textureType == image::TextureUsage::AMBIENT_TEXTURE) { - hasher.addData((const char*)&_textureType, sizeof(_textureType)); - } + hasher.addData((const char*)&_textureType, sizeof(_textureType)); auto hashData = hasher.result(); std::string hash = hashData.toHex().toStdString(); diff --git a/libraries/image/src/image/CubeMap.cpp b/libraries/image/src/image/CubeMap.cpp index f5637062af..9196377daa 100644 --- a/libraries/image/src/image/CubeMap.cpp +++ b/libraries/image/src/image/CubeMap.cpp @@ -99,10 +99,10 @@ public: const size_t offsetHL = hiCoords.x + loCoords.y * _lineStride; const size_t offsetLH = loCoords.x + hiCoords.y * _lineStride; const size_t offsetHH = hiCoords.x + hiCoords.y * _lineStride; - assert(offsetLL >= 0 && offsetLL < _lineStride*(_dims.y + 2 * EDGE_WIDTH)); - assert(offsetHL >= 0 && offsetHL < _lineStride*(_dims.y + 2 * EDGE_WIDTH)); - assert(offsetLH >= 0 && offsetLH < _lineStride*(_dims.y + 2 * EDGE_WIDTH)); - assert(offsetHH >= 0 && offsetHH < _lineStride*(_dims.y + 2 * EDGE_WIDTH)); + assert(offsetLL >= 0 && offsetLL < _lineStride * (_dims.y + 2 * EDGE_WIDTH)); + assert(offsetHL >= 0 && offsetHL < _lineStride * (_dims.y + 2 * EDGE_WIDTH)); + assert(offsetLH >= 0 && offsetLH < _lineStride * (_dims.y + 2 * EDGE_WIDTH)); + assert(offsetHH >= 0 && offsetHH < _lineStride * (_dims.y + 2 * EDGE_WIDTH)); glm::vec4 colorLL = pixels[offsetLL]; glm::vec4 colorHL = pixels[offsetHL]; glm::vec4 colorLH = pixels[offsetLH]; diff --git a/libraries/image/src/image/TextureProcessing.cpp b/libraries/image/src/image/TextureProcessing.cpp index ee2f5b280a..5b3d546f8e 100644 --- a/libraries/image/src/image/TextureProcessing.cpp +++ b/libraries/image/src/image/TextureProcessing.cpp @@ -580,7 +580,6 @@ nvtt::OutputHandler* getNVTTCompressionOutputHandler(gpu::Texture* outputTexture compressionOptions.setQuality(nvtt::Quality_Production); - // TODO: gles: generate ETC mips instead? if (outputFormat == gpu::Element::COLOR_COMPRESSED_BCX_HDR_RGB) { useNVTT = true; compressionOptions.setFormat(nvtt::Format_BC6); diff --git a/tools/oven/src/ui/SkyboxBakeWidget.cpp b/tools/oven/src/ui/SkyboxBakeWidget.cpp index 2bea38b571..6c6e0340ac 100644 --- a/tools/oven/src/ui/SkyboxBakeWidget.cpp +++ b/tools/oven/src/ui/SkyboxBakeWidget.cpp @@ -214,12 +214,12 @@ void SkyboxBakeWidget::addBaker(TextureBaker* baker, const QDir& outputDirectory // move the textureBaker to a worker thread textureBaker->moveToThread(Oven::instance().getNextWorkerThread()); - // invoke the bake method on the textureBaker thread - QMetaObject::invokeMethod(textureBaker.get(), "bake"); - // make sure we hear about the results of this textureBaker when it is done connect(textureBaker.get(), &TextureBaker::finished, this, &SkyboxBakeWidget::handleFinishedBaker); + // invoke the bake method on the textureBaker thread + QMetaObject::invokeMethod(textureBaker.get(), "bake"); + // add a pending row to the results window to show that this bake is in process auto resultsWindow = OvenGUIApplication::instance()->getMainWindow()->showResultsWindow(); auto resultsRow = resultsWindow->addPendingResultRow(baker->getBaseFilename(), outputDirectory);