Changeset 10934
- Timestamp:
- 01/08/10 12:32:55 (3 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 6 modified
-
include/osg/Texture (modified) (1 diff)
-
src/osg/Image.cpp (modified) (1 diff)
-
src/osgPlugins/ive/IveVersion.h (modified) (1 diff)
-
src/osgPlugins/ive/Texture.cpp (modified) (2 diffs)
-
src/osgPlugins/osg/Texture.cpp (modified) (5 diffs)
-
src/osgPlugins/tiff/ReaderWriterTIFF.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/Texture
r10833 r10934 538 538 * See http://oss.sgi.com/projects/ogl-sample/registry/ARB/shadow.txt. */ 539 539 void setShadowComparison(bool flag) { _use_shadow_comparison = flag; } 540 540 bool getShadowComparison() const { return _use_shadow_comparison; } 541 541 542 enum ShadowCompareFunc { 542 543 NEVER = GL_NEVER, -
OpenSceneGraph/trunk/src/osg/Image.cpp
r10924 r10934 1417 1417 switch(pixelFormat) 1418 1418 { 1419 case(GL_DEPTH_COMPONENT): //intentionally fall through and execute the code for GL_LUMINANCE 1419 1420 case(GL_LUMINANCE): { float l = float(*data++)*scale; return Vec4(l, l, l, 1.0f); } 1420 1421 case(GL_ALPHA): { float a = float(*data++)*scale; return Vec4(1.0f, 1.0f, 1.0f, a); } -
OpenSceneGraph/trunk/src/osgPlugins/ive/IveVersion.h
r10513 r10934 52 52 #define VERSION_0041 41 53 53 #define VERSION_0042 42 54 #define VERSION_0043 43 54 55 55 #define VERSION VERSION_004 256 #define VERSION VERSION_0043 56 57 57 58 /* The BYTE_SEX tag is used to check the endian -
OpenSceneGraph/trunk/src/osgPlugins/ive/Texture.cpp
r10762 r10934 63 63 out->writeInt(_sourceType); 64 64 } 65 66 if( out->getVersion() >= VERSION_0043 ) 67 { 68 out->writeBool( _use_shadow_comparison ); 69 out->writeInt( _shadow_compare_func ); 70 out->writeInt( _shadow_texture_mode ); 71 } 65 72 } 66 73 … … 113 120 _sourceType = in->readInt(); 114 121 } 122 123 if( in->getVersion() >= VERSION_0043 ) 124 { 125 _use_shadow_comparison = in->readBool(); 126 _shadow_compare_func = (osg::Texture::ShadowCompareFunc)in->readInt(); 127 _shadow_texture_mode = (osg::Texture::ShadowTextureMode)in->readInt(); 128 } 115 129 } 116 130 else -
OpenSceneGraph/trunk/src/osgPlugins/osg/Texture.cpp
r9475 r10934 27 27 bool Texture_matchSourceTypeStr(const char* str,int& value); 28 28 const char* Texture_getSourceTypeStr(int value); 29 bool Texture_matchShadowCompareFuncStr(const char* str,Texture::ShadowCompareFunc& value); 30 const char* Texture_getShadowCompareFuncStr(Texture::ShadowCompareFunc value); 31 bool Texture_matchShadowTextureModeStr(const char* str,Texture::ShadowTextureMode& value); 32 const char* Texture_getShadowTextureModeStr(Texture::ShadowTextureMode value); 29 33 30 34 // register the read and write functions with the osgDB::Registry. … … 202 206 } 203 207 208 if (fr[0].matchWord("shadowComparison")) 209 { 210 if (fr[1].matchWord("TRUE")) 211 { 212 texture.setShadowComparison(true); 213 fr +=2 ; 214 iteratorAdvanced = true; 215 } 216 else if (fr[1].matchWord("FALSE")) 217 { 218 texture.setShadowComparison(false); 219 fr +=2 ; 220 iteratorAdvanced = true; 221 } 222 } 223 224 if (fr[0].matchWord("shadowCompareFunc")) 225 { 226 Texture::ShadowCompareFunc value; 227 if (Texture_matchShadowCompareFuncStr(fr[1].getStr(),value)) 228 { 229 texture.setShadowCompareFunc(value); 230 fr+=2; 231 iteratorAdvanced = true; 232 } 233 } 234 235 if (fr[0].matchWord("shadowTextureMode")) 236 { 237 Texture::ShadowTextureMode value; 238 if (Texture_matchShadowTextureModeStr(fr[1].getStr(),value)) 239 { 240 texture.setShadowTextureMode(value); 241 fr+=2; 242 iteratorAdvanced = true; 243 } 244 } 245 204 246 return iteratorAdvanced; 205 247 } … … 254 296 255 297 fw.indent() << "resizeNonPowerOfTwo "<< (texture.getResizeNonPowerOfTwoHint()?"TRUE":"FALSE") << std::endl; 298 299 fw.indent() << "shadowComparison "<< (texture.getShadowComparison()?"TRUE":"FALSE") << std::endl; 300 301 fw.indent() << "shadowCompareFunc " << Texture_getShadowCompareFuncStr(texture.getShadowCompareFunc()) << std::endl; 302 303 fw.indent() << "shadowTextureMode " << Texture_getShadowTextureModeStr(texture.getShadowTextureMode()) << std::endl; 256 304 257 305 return true; … … 427 475 } 428 476 429 430 477 const char* Texture_getSourceTypeStr(int value) 431 478 { … … 442 489 return NULL; 443 490 } 491 492 bool Texture_matchShadowCompareFuncStr(const char* str, Texture::ShadowCompareFunc& value) 493 { 494 if ( strcmp(str,"GL_LEQUAL")==0) value = Texture::LEQUAL; 495 else if (strcmp(str,"GL_GEQUAL")==0) value = Texture::GEQUAL; 496 else return false; 497 498 return true; 499 } 500 501 const char* Texture_getShadowCompareFuncStr(Texture::ShadowCompareFunc value) 502 { 503 switch(value) 504 { 505 case( Texture::LEQUAL ): return "GL_LEQUAL"; 506 case( Texture::GEQUAL ): return "GL_GEQUAL"; 507 } 508 return NULL; 509 } 510 511 bool Texture_matchShadowTextureModeStr(const char* str,Texture::ShadowTextureMode& value) 512 { 513 if ( strcmp(str,"GL_LUMINANCE")==0) value = Texture::LUMINANCE; 514 else if (strcmp(str,"GL_INTENSITY")==0) value = Texture::INTENSITY; 515 else if (strcmp(str,"GL_ALPHA")==0) value = Texture::ALPHA; 516 else return false; 517 518 return true; 519 } 520 521 const char* Texture_getShadowTextureModeStr(Texture::ShadowTextureMode value) 522 { 523 switch(value) 524 { 525 case( Texture::LUMINANCE ): return "GL_LUMINANCE"; 526 case( Texture::INTENSITY ): return "GL_INTENSITY"; 527 case( Texture::ALPHA ): return "GL_ALPHA"; 528 } 529 return NULL; 530 } -
OpenSceneGraph/trunk/src/osgPlugins/tiff/ReaderWriterTIFF.cpp
r9556 r10934 784 784 785 785 switch(img.getPixelFormat()) { 786 case GL_DEPTH_COMPONENT: 786 787 case GL_LUMINANCE: 787 788 case GL_ALPHA:
