Showing the changes to interface/src/renderer/TextureCache.cpp (1 of 9 files). Show all
Unified · Split
| @@ -320,6 +320,7 @@ Texture::~Texture() { · 319 unmodified lines | ||
| 320 | 320 | |
| 321 | 321 | NetworkTexture::NetworkTexture(const QUrl& url, TextureType type, const QByteArray& content) : |
| 322 | 322 | Resource(url, !content.isEmpty()), |
| 323 | + _type(type), | |
| 323 | 324 | _translucent(false) { |
| 324 | 325 | |
| 325 | 326 | if (!url.isValid()) { |
| @@ -474,7 +475,13 @@ void NetworkTexture::setImage(const QImage& image, bool translucent, const QColo · 148 unmodified lines | ||
| 474 | 475 | glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.width(), image.height(), 0, |
| 475 | 476 | GL_RGB, GL_UNSIGNED_BYTE, image.constBits()); |
| 476 | 477 | } |
| 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 | + } | |
| 478 | 485 | glBindTexture(GL_TEXTURE_2D, 0); |
| 479 | 486 | } |
| 480 | 487 | |