Modifed the .attr loaders handling if TX_BILINEAR minification filter so that

it remaps it to LINEAR_MIPMAP_LINEAR to get round image quality issue of some
OpenFlight databases.
This commit is contained in:
Robert Osfield 2002-12-08 17:22:20 +00:00
parent 6f16193a7a
commit 55d04ef381

View File

@ -613,7 +613,11 @@ StateSet* Attr::createOsgStateSet()
osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::NEAREST); osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::NEAREST);
break; break;
case MIN_FILTER_BILINEAR: case MIN_FILTER_BILINEAR:
osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::LINEAR); // TX_BILINEAR is an old IrisGL mode which should map to OpenGL's LINEAR
// osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::LINEAR);
// but we're getting awful quality so we'll use LINEAR_MIP_MAP_LINEAR instead.
osg::notify(osg::INFO) << "texture mode MIN_FILTER_BILINEAR encountered, remapping to LINEAR_MIPMAP_LINEAR"<<std::endl;
osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::LINEAR_MIPMAP_LINEAR);
break; break;
case MIN_FILTER_MIPMAP_POINT: case MIN_FILTER_MIPMAP_POINT:
osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::NEAREST_MIPMAP_NEAREST); osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::NEAREST_MIPMAP_NEAREST);
@ -628,15 +632,22 @@ StateSet* Attr::createOsgStateSet()
osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::LINEAR_MIPMAP_LINEAR); osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::LINEAR_MIPMAP_LINEAR);
break; break;
case MIN_FILTER_BICUBIC: case MIN_FILTER_BICUBIC:
cout << "MIN_FILTER_BICUBIC"<<endl;
osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::LINEAR); osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::LINEAR);
break; break;
case MIN_FILTER_BILINEAR_GEQUAL: case MIN_FILTER_BILINEAR_GEQUAL:
case MIN_FILTER_BILINEAR_LEQUAL: case MIN_FILTER_BILINEAR_LEQUAL:
// from IrisGL->OpenGL doc its looks like this is old IrisGL mdoe for shadowing support.
// should probably look
osg::notify(osg::INFO) << "texture mode MIN_FILTER_BILINEAR_*EQUAL encountered, remapping to LINEAR"<<std::endl;
osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::LINEAR); osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::LINEAR);
break; break;
case MIN_FILTER_BICUBIC_GEQUAL: case MIN_FILTER_BICUBIC_GEQUAL:
case MIN_FILTER_BICUBIC_LEQUAL: case MIN_FILTER_BICUBIC_LEQUAL:
default: default:
// from IrisGL->OpenGL doc its looks like this is old IrisGL mdoe for shadowing support.
// should probably look
osg::notify(osg::INFO) << "texture mode MIN_FILTER_BICUBIC_*EQUAL encountered, remapping to LINEAR"<<std::endl;
osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::LINEAR); osgTexture->setFilter(osg::Texture2D::MIN_FILTER, Texture2D::LINEAR);
break; break;
} }