From e66fd1dc709a0409081861ae43a2bc61f9e9e45a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 26 Oct 2005 20:00:10 +0000 Subject: [PATCH] Changed the minimum tile image size to be 4x4 to avoid problems in mipmap generation that was occuring at sizes of 2x2, seemingly somewhere in the OpenGL driver. --- src/osgTerrain/DataSet.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/osgTerrain/DataSet.cpp b/src/osgTerrain/DataSet.cpp index 1575a81f7..5684723ce 100644 --- a/src/osgTerrain/DataSet.cpp +++ b/src/osgTerrain/DataSet.cpp @@ -1451,8 +1451,10 @@ bool DataSet::DestinationTile::computeImageResolution(unsigned int layer, unsign unsigned int numColumnsRequired = osg::minimum(_imagery_maxNumColumns,numColumnsAtFullRes); unsigned int numRowsRequired = osg::minimum(_imagery_maxNumRows,numRowsAtFullRes); - numColumns = 1; - numRows = 1; + // use a minimum image size of 4x4 to avoid mipmap generation problems in OpenGL at sizes at 2x2. + numColumns = 4; + numRows = 4; + // round to nearest power of two above or equal to the required resolution while (numColumnsgetDestinationTileExtension()==".ive"; bool compressedImageSupported = inlineImageFile || imageExension==".dds"; - bool mipmapImageSupported = inlineImageFile; + bool mipmapImageSupported = compressedImageSupported; // inlineImageFile; int minumCompressedTextureSize = 64; int minumDXT3CompressedTextureSize = 256;