Changeset 950
- Timestamp:
- 10/20/08 10:43:41
- Files:
-
- trunk/include/vpb/BuildOptions (modified) (1 diff)
- trunk/src/vpb/Commandline.cpp (modified) (1 diff)
- trunk/src/vpb/Destination.cpp (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/include/vpb/BuildOptions
r949 r950 66 66 void setPowerOfTwoImages(bool powerOfTwoImages) { _powerOfTwoImages = powerOfTwoImages; } 67 67 bool getPowerOfTwoImages() const { return _powerOfTwoImages; } 68 68 69 69 /** Set the Archive name if one is to be used.*/ 70 70 void setArchiveName(const std::string& filename) { _archiveName = filename; } trunk/src/vpb/Commandline.cpp
r949 r950 455 455 usage.addCommandLineOption("--RGBA-compressed","Use OpenGL compression on RGBA destination imagery"); 456 456 usage.addCommandLineOption("--RGB-16","Use 16bit RGB destination imagery"); 457 usage.addCommandLineOption("--RGB A-24","Use 24bit RGB destination imagery");458 usage.addCommandLineOption("--RGB -16","Use 16bit RGBA destination imagery");457 usage.addCommandLineOption("--RGB-24","Use 24bit RGB destination imagery"); 458 usage.addCommandLineOption("--RGBA-16","Use 16bit RGBA destination imagery"); 459 459 usage.addCommandLineOption("--RGBA","Use 32bit RGBA destination imagery"); 460 460 usage.addCommandLineOption("--vector","Interpret input as a vector data set"); trunk/src/vpb/Destination.cpp
r949 r950 271 271 } 272 272 273 osg::notify(osg::NOTICE)<<"numColumnsAtFullRes = "<<numColumnsRequired<<"\tnumColumns = "<< numColumns<<std::endl;274 osg::notify(osg::NOTICE)<<"numRowsAtFullRes = "<<numRowsRequired<<"\tnumRows = "<< numRows<<std::endl;273 log(osg::NOTICE,"numColumnsAtFullRes = %itnumColumns = %i",numColumnsRequired,numColumns); 274 log(osg::NOTICE,"numRowsAtFullRes = %i\tnumRows = ",numRowsRequired,numRows); 275 275 } 276 276 … … 1192 1192 case(DataSet::NO_MIP_MAPPING): 1193 1193 { 1194 log(osg::NOTICE,"DestinationTile::createStateSet() - DataSet::NO_MIP_MAPPING"); 1195 1194 1196 texture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR); 1195 1197 texture->setFilter(osg::Texture::MAG_FILTER,osg::Texture::LINEAR); … … 1198 1200 case(DataSet::MIP_MAPPING_HARDWARE): 1199 1201 { 1202 log(osg::NOTICE,"DestinationTile::createStateSet() - DataSet::MIP_MAPPING_HARDWARE"); 1200 1203 texture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR_MIPMAP_LINEAR); 1201 1204 texture->setFilter(osg::Texture::MAG_FILTER,osg::Texture::LINEAR); … … 1204 1207 case(DataSet::MIP_MAPPING_IMAGERY): 1205 1208 { 1209 log(osg::NOTICE,"DestinationTile::createStateSet() - DataSet::MIP_MAPPING_IMAGERY"); 1206 1210 texture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR_MIPMAP_LINEAR); 1207 1211 texture->setFilter(osg::Texture::MAG_FILTER,osg::Texture::LINEAR); … … 1214 1218 1215 1219 bool inlineImageFile = _dataSet->getDestinationTileExtension()==".ive"; 1216 bool compressedImageSupported = inlineImageFile || imageExtension==" .dds";1220 bool compressedImageSupported = inlineImageFile || imageExtension=="dds"; 1217 1221 bool mipmapImageSupported = compressedImageSupported; // inlineImageFile; 1218 1222 … … 1225 1229 (image->getPixelFormat()==GL_RGB || image->getPixelFormat()==GL_RGBA)) 1226 1230 { 1231 log(osg::NOTICE,"Compressed image"); 1227 1232 1228 1233 if (image->s()>=minumDXT3CompressedTextureSize && image->t()>=minumDXT3CompressedTextureSize) … … 1233 1238 // force the mip mapping off temporay if we intend the graphics hardware to do the mipmapping. 1234 1239 if (_dataSet->getMipMappingMode()==DataSet::MIP_MAPPING_HARDWARE) 1240 { 1241 log(osg::INFO," switching off MIP_MAPPING for compile"); 1235 1242 texture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR); 1243 } 1236 1244 1237 1245 // make sure the OSG doesn't rescale images if it doesn't need to. … … 1258 1266 else 1259 1267 { 1268 log(osg::NOTICE,"Non compressed image mipmapImageSupported=%i imageExtension=%s",mipmapImageSupported,imageExtension.c_str()); 1269 1260 1270 if (_dataSet->getTextureType()==DataSet::RGB_16 && image->getPixelFormat()==GL_RGB) 1261 1271 { … … 1269 1279 if (mipmapImageSupported && _dataSet->getMipMappingMode()==DataSet::MIP_MAPPING_IMAGERY) 1270 1280 { 1271 1272 osg::ref_ptr<osg::State> state = new osg::State; 1281 log(osg::NOTICE,"Doing mipmapping"); 1282 1283 // make sure the OSG doesn't rescale images if it doesn't need to. 1284 texture->setResizeNonPowerOfTwoHint(_dataSet->getPowerOfTwoImages()); 1273 1285 1274 1286 // get OpenGL driver to create texture from image. … … 1349 1361 } 1350 1362 } 1363 1364 _dataSet->getState()->checkGLErrors("DestinationTile::createStateSet()"); 1365 1351 1366 return _stateset.get(); 1352 1367 } … … 1365 1380 _terrain->_heightField->allocate(8,8); 1366 1381 _terrain->_heightField->setOrigin(osg::Vec3(_extents.xMin(),_extents.yMin(),0.0f)); 1367 _terrain->_heightField->setXInterval(_extents.xMax()-_extents.xMin() );1368 _terrain->_heightField->setYInterval(_extents.yMax()-_extents.yMin() );1382 _terrain->_heightField->setXInterval(_extents.xMax()-_extents.xMin()/7.0); 1383 _terrain->_heightField->setYInterval(_extents.yMax()-_extents.yMin()/7.0); 1369 1384 } 1370 1385 … … 1576 1591 } 1577 1592 1593 osg::Texture::FilterMode minFilter = _dataSet->getMipMappingMode()==BuildOptions::NO_MIP_MAPPING ? 1594 osg::Texture::LINEAR : 1595 osg::Texture::LINEAR_MIPMAP_LINEAR; 1596 1597 osg::Texture::FilterMode magFilter = osg::Texture::LINEAR; 1578 1598 1579 1599 // assign the imagery … … 1591 1611 osgTerrain::SwitchLayer* switchLayer = new osgTerrain::SwitchLayer; 1592 1612 switchLayer->setLocator(locator); 1613 switchLayer->setMinFilter(minFilter); 1614 switchLayer->setMagFilter(magFilter); 1593 1615 for(ImageSet::LayerSetImageDataMap::iterator litr = imageSet._layerSetImageDataMap.begin(); 1594 1616 litr != imageSet._layerSetImageDataMap.end(); … … 1601 1623 1602 1624 osgTerrain::ImageLayer* imageLayer = new osgTerrain::ImageLayer; 1625 imageLayer->setMinFilter(minFilter); 1626 imageLayer->setMagFilter(magFilter); 1603 1627 imageLayer->setImage(image); 1604 1628 imageLayer->setSetName(litr->first); … … 1621 1645 imageLayer->setImage(image); 1622 1646 imageLayer->setLocator(locator); 1647 imageLayer->setMinFilter(minFilter); 1648 imageLayer->setMagFilter(magFilter); 1623 1649 1624 1650 terrainTile->setColorLayer(layerNum, imageLayer);
