mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 11:17:38 +02:00
Merge pull request #5398 from ZappoMan/removeTextureRescale
remove rescaling of textures
This commit is contained in:
commit
fecb0e3675
1 changed files with 0 additions and 13 deletions
|
@ -325,19 +325,6 @@ void ImageReader::run() {
|
||||||
auto ntex = dynamic_cast<NetworkTexture*>(&*texture);
|
auto ntex = dynamic_cast<NetworkTexture*>(&*texture);
|
||||||
if (ntex && (ntex->getType() == CUBE_TEXTURE)) {
|
if (ntex && (ntex->getType() == CUBE_TEXTURE)) {
|
||||||
qCDebug(renderutils) << "Cube map size:" << _url << image.width() << image.height();
|
qCDebug(renderutils) << "Cube map size:" << _url << image.width() << image.height();
|
||||||
} else {
|
|
||||||
|
|
||||||
// enforce a fixed maximum area (1024 * 2048)
|
|
||||||
const int MAXIMUM_AREA_SIZE = 2097152;
|
|
||||||
if (imageArea > MAXIMUM_AREA_SIZE) {
|
|
||||||
float scaleRatio = sqrtf((float)MAXIMUM_AREA_SIZE) / sqrtf((float)imageArea);
|
|
||||||
int resizeWidth = static_cast<int>(std::floor(scaleRatio * static_cast<float>(image.width())));
|
|
||||||
int resizeHeight = static_cast<int>(std::floor(scaleRatio * static_cast<float>(image.height())));
|
|
||||||
qCDebug(renderutils) << "Image greater than maximum size:" << _url << image.width() << image.height() <<
|
|
||||||
" scaled to:" << resizeWidth << resizeHeight;
|
|
||||||
image = image.scaled(resizeWidth, resizeHeight, Qt::IgnoreAspectRatio);
|
|
||||||
imageArea = image.width() * image.height();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int opaquePixels = 0;
|
int opaquePixels = 0;
|
||||||
|
|
Loading…
Reference in a new issue