History

Turn off mipmaps. Performance is actually substantially better without them.

Andrzej Kapolka committed 12 years ago

Commit f8e65931 parent 3d9d89e1 file · +3 −6Browse files

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

Unified · Split

interface/src/renderer/TextureCache.cpp+3−6
@@ -113,8 +113,7 @@ GLuint TextureCache::getFileTextureID(const QString& filename) { · 112 unmodified lines
113 glBindTexture(GL_TEXTURE_2D, id);113 glBindTexture(GL_TEXTURE_2D, id);
114 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 1,114 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 1,
115 GL_BGRA, GL_UNSIGNED_BYTE, image.constBits());115 GL_BGRA, GL_UNSIGNED_BYTE, image.constBits());
116 glGenerateMipmap(GL_TEXTURE_2D);116 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
117 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
118 glBindTexture(GL_TEXTURE_2D, 0);117 glBindTexture(GL_TEXTURE_2D, 0);
119 118
120 _fileTextureIDs.insert(filename, id);119 _fileTextureIDs.insert(filename, id);
@@ -330,8 +329,7 @@ void NetworkTexture::setImage(const QImage& image, bool translucent) { · 209 unmodified lines
330 glBindTexture(GL_TEXTURE_2D, getID());329 glBindTexture(GL_TEXTURE_2D, getID());
331 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 1,330 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 1,
332 GL_BGRA, GL_UNSIGNED_BYTE, image.constBits());331 GL_BGRA, GL_UNSIGNED_BYTE, image.constBits());
333 glGenerateMipmap(GL_TEXTURE_2D);332 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
334 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
335 glBindTexture(GL_TEXTURE_2D, 0);333 glBindTexture(GL_TEXTURE_2D, 0);
336}334}
337 335
@@ -364,8 +362,7 @@ QSharedPointer<Texture> DilatableNetworkTexture::getDilatedTexture(float dilatio · 26 unmodified lines
364 glBindTexture(GL_TEXTURE_2D, texture->getID());362 glBindTexture(GL_TEXTURE_2D, texture->getID());
365 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, dilatedImage.width(), dilatedImage.height(), 1,363 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, dilatedImage.width(), dilatedImage.height(), 1,
366 GL_BGRA, GL_UNSIGNED_BYTE, dilatedImage.constBits());364 GL_BGRA, GL_UNSIGNED_BYTE, dilatedImage.constBits());
367 glGenerateMipmap(GL_TEXTURE_2D);365 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
368 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
369 glBindTexture(GL_TEXTURE_2D, 0);366 glBindTexture(GL_TEXTURE_2D, 0);
370 }367 }
371 368