mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:27:04 +02:00
Taking into account samuel's remarks
This commit is contained in:
parent
08aa133472
commit
1322fef568
4 changed files with 8 additions and 13 deletions
|
@ -133,11 +133,7 @@ void TextureBaker::processTexture() {
|
||||||
// so we add that to the processed texture before handling it off to be serialized
|
// so we add that to the processed texture before handling it off to be serialized
|
||||||
QCryptographicHash hasher(QCryptographicHash::Md5);
|
QCryptographicHash hasher(QCryptographicHash::Md5);
|
||||||
hasher.addData(_originalTexture);
|
hasher.addData(_originalTexture);
|
||||||
// An ambient texture is built with the same pixel data as sky texture but its Mip Maps are different
|
hasher.addData((const char*)&_textureType, sizeof(_textureType));
|
||||||
// so we mustn't use one instead of the other.
|
|
||||||
if (_textureType == image::TextureUsage::AMBIENT_TEXTURE) {
|
|
||||||
hasher.addData((const char*)&_textureType, sizeof(_textureType));
|
|
||||||
}
|
|
||||||
auto hashData = hasher.result();
|
auto hashData = hasher.result();
|
||||||
std::string hash = hashData.toHex().toStdString();
|
std::string hash = hashData.toHex().toStdString();
|
||||||
|
|
||||||
|
|
|
@ -99,10 +99,10 @@ public:
|
||||||
const size_t offsetHL = hiCoords.x + loCoords.y * _lineStride;
|
const size_t offsetHL = hiCoords.x + loCoords.y * _lineStride;
|
||||||
const size_t offsetLH = loCoords.x + hiCoords.y * _lineStride;
|
const size_t offsetLH = loCoords.x + hiCoords.y * _lineStride;
|
||||||
const size_t offsetHH = hiCoords.x + hiCoords.y * _lineStride;
|
const size_t offsetHH = hiCoords.x + hiCoords.y * _lineStride;
|
||||||
assert(offsetLL >= 0 && offsetLL < _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(offsetHL >= 0 && offsetHL < _lineStride * (_dims.y + 2 * EDGE_WIDTH));
|
||||||
assert(offsetLH >= 0 && offsetLH < _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(offsetHH >= 0 && offsetHH < _lineStride * (_dims.y + 2 * EDGE_WIDTH));
|
||||||
glm::vec4 colorLL = pixels[offsetLL];
|
glm::vec4 colorLL = pixels[offsetLL];
|
||||||
glm::vec4 colorHL = pixels[offsetHL];
|
glm::vec4 colorHL = pixels[offsetHL];
|
||||||
glm::vec4 colorLH = pixels[offsetLH];
|
glm::vec4 colorLH = pixels[offsetLH];
|
||||||
|
|
|
@ -580,7 +580,6 @@ nvtt::OutputHandler* getNVTTCompressionOutputHandler(gpu::Texture* outputTexture
|
||||||
|
|
||||||
compressionOptions.setQuality(nvtt::Quality_Production);
|
compressionOptions.setQuality(nvtt::Quality_Production);
|
||||||
|
|
||||||
// TODO: gles: generate ETC mips instead?
|
|
||||||
if (outputFormat == gpu::Element::COLOR_COMPRESSED_BCX_HDR_RGB) {
|
if (outputFormat == gpu::Element::COLOR_COMPRESSED_BCX_HDR_RGB) {
|
||||||
useNVTT = true;
|
useNVTT = true;
|
||||||
compressionOptions.setFormat(nvtt::Format_BC6);
|
compressionOptions.setFormat(nvtt::Format_BC6);
|
||||||
|
|
|
@ -214,12 +214,12 @@ void SkyboxBakeWidget::addBaker(TextureBaker* baker, const QDir& outputDirectory
|
||||||
// move the textureBaker to a worker thread
|
// move the textureBaker to a worker thread
|
||||||
textureBaker->moveToThread(Oven::instance().getNextWorkerThread());
|
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
|
// make sure we hear about the results of this textureBaker when it is done
|
||||||
connect(textureBaker.get(), &TextureBaker::finished, this, &SkyboxBakeWidget::handleFinishedBaker);
|
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
|
// add a pending row to the results window to show that this bake is in process
|
||||||
auto resultsWindow = OvenGUIApplication::instance()->getMainWindow()->showResultsWindow();
|
auto resultsWindow = OvenGUIApplication::instance()->getMainWindow()->showResultsWindow();
|
||||||
auto resultsRow = resultsWindow->addPendingResultRow(baker->getBaseFilename(), outputDirectory);
|
auto resultsRow = resultsWindow->addPendingResultRow(baker->getBaseFilename(), outputDirectory);
|
||||||
|
|
Loading…
Reference in a new issue