Changeset 7492

Show
Ignore:
Timestamp:
09/27/07 12:22:09
Author:
robert
Message:

Added support for selecting internal texture format via the internalFormat <numbits> entry in the .osg file

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OpenSceneGraph/trunk/src/osgPlugins/osgViewer/View.cpp

    r7488 r7492  
    104104        fr.matchSequence("setUpViewForPanoramicSphericalDisplay {")) 
    105105    { 
    106         double radius=1.0; 
    107         double collar=0.45; 
    108         unsigned int screenNum=0; 
     106        double radius = 1.0; 
     107        double collar = 0.45; 
     108        unsigned int screenNum = 0; 
     109        unsigned int intensityFormat = 8; 
    109110        std::string filename; 
    110111        osg::ref_ptr<osg::Image> intensityMap; 
     
    121122            if (fr.read("intensityFile",filename)) local_itrAdvanced = true; 
    122123            if (fr.matchSequence("intensityMap {")) intensityMap = readIntensityImage(fr,local_itrAdvanced); 
     124            if (fr.read("intensityFormat",intensityFormat)) local_itrAdvanced = true; 
    123125             
    124126            if (!local_itrAdvanced) ++fr; 
     
    134136            intensityMap = osgDB::readImageFile(filename); 
    135137        } 
     138 
     139        if (intensityMap.valid()) 
     140        { 
     141            if (intensityFormat==16) intensityMap->setInternalTextureFormat(GL_LUMINANCE16F_ARB); 
     142            else if (intensityFormat==32) intensityMap->setInternalTextureFormat(GL_LUMINANCE32F_ARB); 
     143            // else intensityMap->setInternalTextureFormat(image->getPixelFormat()); 
     144        } 
     145 
    136146 
    137147        if (matchedFirst) view.setUpViewFor3DSphericalDisplay(radius, collar, screenNum, intensityMap.get());