History

Support for scaling splat textures in S and T, use mipmaps for them.

Andrzej Kapolka committed 12 years ago

Commit 2dfabdf1 parent 4f3f0989 files · +71 −11Browse files

Showing the changes to interface/src/renderer/TextureCache.cpp (1 of 9 files). Show all

Unified · Split

interface/src/renderer/TextureCache.cpp+8−1
@@ -320,6 +320,7 @@ Texture::~Texture() { · 319 unmodified lines
320320
321321 NetworkTexture::NetworkTexture(const QUrl& url, TextureType type, const QByteArray& content) :
322322 Resource(url, !content.isEmpty()),
323+ _type(type),
323324 _translucent(false) {
324325
325326 if (!url.isValid()) {
@@ -474,7 +475,13 @@ void NetworkTexture::setImage(const QImage& image, bool translucent, const QColo · 148 unmodified lines
474475 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.width(), image.height(), 0,
475476 GL_RGB, GL_UNSIGNED_BYTE, image.constBits());
476477 }
477− glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
478+ if (_type == SPLAT_TEXTURE) {
479+ // generate mipmaps for splat textures
480+ glGenerateMipmap(GL_TEXTURE_2D);
481+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
482+ } else {
483+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
484+ }
478485 glBindTexture(GL_TEXTURE_2D, 0);
479486 }
480487