Changeset 13041 for OpenSceneGraph/trunk/src/osg/Texture.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osg/Texture.cpp (modified) (57 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osg/Texture.cpp
r12993 r13041 1 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 436 436 static_cast<unsigned int>(ceil(double(sizeRequired) / double(_profile._size))): 437 437 _orphanedTextureObjects.size(); 438 438 439 439 OSG_INFO<<"_parent->getCurrTexturePoolSize()="<<_parent->getCurrTexturePoolSize() <<" _parent->getMaxTexturePoolSize()="<< _parent->getMaxTexturePoolSize()<<std::endl; 440 440 OSG_INFO<<"Looking to reclaim "<<sizeRequired<<", going to look to remove "<<maxNumObjectsToDelete<<" from "<<_orphanedTextureObjects.size()<<" orhpans"<<std::endl; … … 810 810 } 811 811 812 Texture::TextureObject* Texture::TextureObjectManager::generateTextureObject(const Texture* texture, 812 Texture::TextureObject* Texture::TextureObjectManager::generateTextureObject(const Texture* texture, 813 813 GLenum target, 814 814 GLint numMipmapLevels, … … 1156 1156 1157 1157 COMPARE_StateAttribute_Parameter(_internalFormatType); 1158 1158 1159 1159 return 0; 1160 1160 } … … 1162 1162 int Texture::compareTextureObjects(const Texture& rhs) const 1163 1163 { 1164 if (_textureObjectBuffer.size()<rhs._textureObjectBuffer.size()) return -1; 1164 if (_textureObjectBuffer.size()<rhs._textureObjectBuffer.size()) return -1; 1165 1165 if (rhs._textureObjectBuffer.size()<_textureObjectBuffer.size()) return 1; 1166 1166 for(unsigned int i=0; i<_textureObjectBuffer.size(); ++i) … … 1181 1181 default : OSG_WARN<<"Error: invalid 'which' passed Texture::setWrap("<<(unsigned int)which<<","<<(unsigned int)wrap<<")"<<std::endl; break; 1182 1182 } 1183 1183 1184 1184 } 1185 1185 … … 1222 1222 if (_maxAnisotropy!=anis) 1223 1223 { 1224 _maxAnisotropy = anis; 1224 _maxAnisotropy = anis; 1225 1225 dirtyTextureParameters(); 1226 1226 } … … 1309 1309 switch(image.getPixelFormat()) 1310 1310 { 1311 case(3): 1312 case(4): 1313 case(GL_RGB): 1311 case(3): 1312 case(4): 1313 case(GL_RGB): 1314 1314 case(GL_RGBA): internalFormat = GL_COMPRESSED_RGB_S3TC_DXT1_EXT; break; 1315 1315 default: internalFormat = image.getInternalTextureFormat(); break; … … 1323 1323 switch(image.getPixelFormat()) 1324 1324 { 1325 case(3): 1326 case(4): 1327 case(GL_RGB): 1325 case(3): 1326 case(4): 1327 case(GL_RGB): 1328 1328 case(GL_RGBA): internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; break; 1329 1329 default: internalFormat = image.getInternalTextureFormat(); break; … … 1413 1413 } 1414 1414 break; 1415 1415 1416 1416 case(USE_RGTC2_COMPRESSION): 1417 1417 if (extensions->isTextureCompressionRGTCSupported()) … … 1432 1432 } 1433 1433 } 1434 1434 1435 1435 _internalFormat = internalFormat; 1436 1436 … … 1442 1442 1443 1443 computeInternalFormatType(); 1444 1444 1445 1445 //OSG_NOTICE<<"Internal format="<<std::hex<<internalFormat<<std::dec<<std::endl; 1446 1446 } … … 1452 1452 // (i.e. rgba integer texture --> _sourceFormat = GL_RGBA_INTEGER_EXT) 1453 1453 // Should we do this? ( Art, 09. Sept. 2007) 1454 1454 1455 1455 // compute internal format type based on the internal format 1456 1456 switch(_internalFormat) … … 1464 1464 case GL_RGB8UI_EXT: 1465 1465 1466 case GL_LUMINANCE32UI_EXT: 1467 case GL_LUMINANCE16UI_EXT: 1468 case GL_LUMINANCE8UI_EXT: 1469 1470 case GL_INTENSITY32UI_EXT: 1471 case GL_INTENSITY16UI_EXT: 1472 case GL_INTENSITY8UI_EXT: 1473 1474 case GL_LUMINANCE_ALPHA32UI_EXT: 1475 case GL_LUMINANCE_ALPHA16UI_EXT: 1476 case GL_LUMINANCE_ALPHA8UI_EXT : 1466 case GL_LUMINANCE32UI_EXT: 1467 case GL_LUMINANCE16UI_EXT: 1468 case GL_LUMINANCE8UI_EXT: 1469 1470 case GL_INTENSITY32UI_EXT: 1471 case GL_INTENSITY16UI_EXT: 1472 case GL_INTENSITY8UI_EXT: 1473 1474 case GL_LUMINANCE_ALPHA32UI_EXT: 1475 case GL_LUMINANCE_ALPHA16UI_EXT: 1476 case GL_LUMINANCE_ALPHA8UI_EXT : 1477 1477 _internalFormatType = UNSIGNED_INTEGER; 1478 1478 break; … … 1486 1486 case GL_RGB8I_EXT: 1487 1487 1488 case GL_LUMINANCE32I_EXT: 1489 case GL_LUMINANCE16I_EXT: 1490 case GL_LUMINANCE8I_EXT: 1491 1492 case GL_INTENSITY32I_EXT: 1493 case GL_INTENSITY16I_EXT: 1494 case GL_INTENSITY8I_EXT: 1495 1496 case GL_LUMINANCE_ALPHA32I_EXT: 1497 case GL_LUMINANCE_ALPHA16I_EXT: 1498 case GL_LUMINANCE_ALPHA8I_EXT: 1488 case GL_LUMINANCE32I_EXT: 1489 case GL_LUMINANCE16I_EXT: 1490 case GL_LUMINANCE8I_EXT: 1491 1492 case GL_INTENSITY32I_EXT: 1493 case GL_INTENSITY16I_EXT: 1494 case GL_INTENSITY8I_EXT: 1495 1496 case GL_LUMINANCE_ALPHA32I_EXT: 1497 case GL_LUMINANCE_ALPHA16I_EXT: 1498 case GL_LUMINANCE_ALPHA8I_EXT: 1499 1499 _internalFormatType = SIGNED_INTEGER; 1500 1500 break; 1501 1501 1502 1502 case GL_RGBA32F_ARB: 1503 1503 case GL_RGBA16F_ARB: … … 1507 1507 1508 1508 case GL_LUMINANCE32F_ARB: 1509 case GL_LUMINANCE16F_ARB: 1509 case GL_LUMINANCE16F_ARB: 1510 1510 1511 1511 case GL_INTENSITY32F_ARB: 1512 case GL_INTENSITY16F_ARB: 1512 case GL_INTENSITY16F_ARB: 1513 1513 1514 1514 case GL_LUMINANCE_ALPHA32F_ARB: 1515 case GL_LUMINANCE_ALPHA16F_ARB: 1515 case GL_LUMINANCE_ALPHA16F_ARB: 1516 1516 _internalFormatType = FLOAT; 1517 1517 break; 1518 1518 1519 1519 default: 1520 1520 _internalFormatType = NORMALIZED; … … 1546 1546 case(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT): 1547 1547 case(GL_COMPRESSED_RED_GREEN_RGTC2_EXT): 1548 case(GL_ETC1_RGB8_OES): 1548 case(GL_ETC1_RGB8_OES): 1549 1549 case(GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG): 1550 1550 case(GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG): … … 1568 1568 blockSize = 8; 1569 1569 else if (internalFormat == GL_COMPRESSED_RED_GREEN_RGTC2_EXT || internalFormat == GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT) 1570 blockSize = 16; 1570 blockSize = 16; 1571 1571 else if (internalFormat == GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG || internalFormat == GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG) 1572 1572 { … … 1575 1575 GLint heightBlocks = height / 4; 1576 1576 GLint bpp = 2; 1577 1577 1578 1578 // Clamp to minimum number of blocks 1579 1579 if(widthBlocks < 2) … … 1581 1581 if(heightBlocks < 2) 1582 1582 heightBlocks = 2; 1583 1584 size = widthBlocks * heightBlocks * ((blockSize * bpp) / 8); 1583 1584 size = widthBlocks * heightBlocks * ((blockSize * bpp) / 8); 1585 1585 return; 1586 1586 } … … 1591 1591 GLint heightBlocks = height / 4; 1592 1592 GLint bpp = 4; 1593 1593 1594 1594 // Clamp to minimum number of blocks 1595 1595 if(widthBlocks < 2) … … 1597 1597 if(heightBlocks < 2) 1598 1598 heightBlocks = 2; 1599 1600 size = widthBlocks * heightBlocks * ((blockSize * bpp) / 8); 1599 1600 size = widthBlocks * heightBlocks * ((blockSize * bpp) / 8); 1601 1601 return; 1602 1602 } … … 1606 1606 blockSize = 0; 1607 1607 } 1608 1609 size = ((width+3)/4)*((height+3)/4)*depth*blockSize; 1608 1609 size = ((width+3)/4)*((height+3)/4)*depth*blockSize; 1610 1610 } 1611 1611 1612 1612 void Texture::applyTexParameters(GLenum target, State& state) const 1613 1613 { 1614 // get the contextID (user defined ID of 0 upwards) for the 1614 // get the contextID (user defined ID of 0 upwards) for the 1615 1615 // current OpenGL context. 1616 1616 const unsigned int contextID = state.getContextID(); … … 1651 1651 } 1652 1652 1653 #if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) 1653 #if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) 1654 1654 if (ws == CLAMP) ws = CLAMP_TO_EDGE; 1655 1655 if (wt == CLAMP) wt = CLAMP_TO_EDGE; 1656 1656 if (wr == CLAMP) wr = CLAMP_TO_EDGE; 1657 1657 #endif 1658 1658 1659 1659 const Image * image = getImage(0); 1660 1660 if( image && … … 1663 1663 int( image->getNumMipmapLevels() ) < 1664 1664 Image::computeNumberOfMipmapLevels( image->s(), image->t(), image->r() ) ) 1665 glTexParameteri( target, GL_TEXTURE_MAX_LEVEL, image->getNumMipmapLevels() - 1 ); 1665 glTexParameteri( target, GL_TEXTURE_MAX_LEVEL, image->getNumMipmapLevels() - 1 ); 1666 1666 1667 1667 1668 1668 glTexParameteri( target, GL_TEXTURE_WRAP_S, ws ); 1669 1669 1670 1670 if (target!=GL_TEXTURE_1D) glTexParameteri( target, GL_TEXTURE_WRAP_T, wt ); 1671 1671 1672 1672 if (target==GL_TEXTURE_3D) glTexParameteri( target, GL_TEXTURE_WRAP_R, wr ); 1673 1673 1674 1674 1675 1675 glTexParameteri( target, GL_TEXTURE_MIN_FILTER, _min_filter); 1676 1676 glTexParameteri( target, GL_TEXTURE_MAG_FILTER, _mag_filter); … … 1709 1709 // integer textures are not supported by the shadow 1710 1710 // GL_TEXTURE_1D_ARRAY_EXT could be included in the check below but its not yet implemented in OSG 1711 if (extensions->isShadowSupported() && 1711 if (extensions->isShadowSupported() && 1712 1712 (target == GL_TEXTURE_2D || target == GL_TEXTURE_1D || target == GL_TEXTURE_RECTANGLE || target == GL_TEXTURE_CUBE_MAP || target == GL_TEXTURE_2D_ARRAY_EXT ) && 1713 1713 _internalFormatType != SIGNED_INTEGER && _internalFormatType != UNSIGNED_INTEGER) … … 1726 1726 } 1727 1727 } 1728 else 1728 else 1729 1729 { 1730 1730 glTexParameteri(target, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE); … … 1760 1760 inwidth = width; 1761 1761 inheight = height; 1762 1762 1763 1763 if( _min_filter == LINEAR || _min_filter == NEAREST) 1764 1764 { … … 1775 1775 } 1776 1776 1777 // OSG_NOTICE<<"Texture::computeRequiredTextureDimensions() image.s() "<<image.s()<<" image.t()="<<image.t()<<" width="<<width<<" height="<<height<<" numMipmapLevels="<<numMipmapLevels<<std::endl; 1778 // OSG_NOTICE<<" _resizeNonPowerOfTwoHint="<<_resizeNonPowerOfTwoHint<<" extensions->isNonPowerOfTwoTextureSupported(_min_filter)="<<extensions->isNonPowerOfTwoTextureSupported(_min_filter) <<std::endl; 1777 // OSG_NOTICE<<"Texture::computeRequiredTextureDimensions() image.s() "<<image.s()<<" image.t()="<<image.t()<<" width="<<width<<" height="<<height<<" numMipmapLevels="<<numMipmapLevels<<std::endl; 1778 // OSG_NOTICE<<" _resizeNonPowerOfTwoHint="<<_resizeNonPowerOfTwoHint<<" extensions->isNonPowerOfTwoTextureSupported(_min_filter)="<<extensions->isNonPowerOfTwoTextureSupported(_min_filter) <<std::endl; 1779 1779 } 1780 1780 … … 1800 1800 #endif 1801 1801 1802 // get the contextID (user defined ID of 0 upwards) for the 1802 // get the contextID (user defined ID of 0 upwards) for the 1803 1803 // current OpenGL context. 1804 1804 const unsigned int contextID = state.getContextID(); … … 1810 1810 // If the texture's internal format is a compressed type, then the 1811 1811 // user is requesting that the graphics card compress the image if it's 1812 // not already compressed. However, if the image is not a multiple of 1812 // not already compressed. However, if the image is not a multiple of 1813 1813 // four in each dimension the subsequent calls to glTexSubImage* will 1814 1814 // fail. Revert to uncompressed format in this case. … … 1854 1854 #endif 1855 1855 1856 #ifdef GL_TEXTURE_STORAGE_HINT_APPLE 1856 #ifdef GL_TEXTURE_STORAGE_HINT_APPLE 1857 1857 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_STORAGE_HINT_APPLE , GL_STORAGE_CACHED_APPLE); 1858 1858 #endif … … 1867 1867 { 1868 1868 // resize the image to power of two. 1869 1869 1870 1870 if (image->isMipmap()) 1871 1871 { … … 1878 1878 return; 1879 1879 } 1880 1880 1881 1881 unsigned int newTotalSize = osg::Image::computeRowWidthInBytes(inwidth,image->getPixelFormat(),image->getDataType(),image->getPacking())*inheight; 1882 1882 dataPtr = new unsigned char [newTotalSize]; 1883 1883 1884 1884 if (!dataPtr) 1885 1885 { … … 1949 1949 getCompressedSize(_internalFormat, inwidth, inheight, 1, blockSize,size); 1950 1950 1951 extensions->glCompressedTexImage2D(target, 0, _internalFormat, 1952 inwidth, inheight,0, 1953 size, 1951 extensions->glCompressedTexImage2D(target, 0, _internalFormat, 1952 inwidth, inheight,0, 1953 size, 1954 1954 dataPtr); 1955 1955 } … … 1964 1964 1965 1965 // image is mip mapped so we take the mip map levels from the image. 1966 1966 1967 1967 numMipmapLevels = image->getNumMipmapLevels(); 1968 1968 … … 2002 2002 2003 2003 getCompressedSize(_internalFormat, width, height, 1, blockSize,size); 2004 2005 extensions->glCompressedTexImage2D(target, k, _internalFormat, 2006 width, height, _borderWidth, 2004 2005 extensions->glCompressedTexImage2D(target, k, _internalFormat, 2006 width, height, _borderWidth, 2007 2007 size, dataPtr + image->getMipmapOffset(k)); 2008 2008 … … 2031 2031 } 2032 2032 } 2033 else 2033 else 2034 2034 { 2035 2035 OSG_WARN<<"Warning:: Compressed image cannot be mip mapped"<<std::endl; … … 2051 2051 } 2052 2052 } 2053 2053 2054 2054 #ifdef DO_TIMING 2055 2055 static double s_total_time = 0.0; … … 2064 2064 delete [] dataPtr; 2065 2065 } 2066 2066 2067 2067 if (useClientStorage) 2068 2068 { … … 2080 2080 2081 2081 // image size has changed so we have to re-load the image from scratch. 2082 if (image->s()!=inwidth || image->t()!=inheight || image->getInternalTextureFormat()!=inInternalFormat ) 2083 { 2084 applyTexImage2D_load(state, target, image, inwidth, inheight,numMipmapLevels); 2082 if (image->s()!=inwidth || image->t()!=inheight || image->getInternalTextureFormat()!=inInternalFormat ) 2083 { 2084 applyTexImage2D_load(state, target, image, inwidth, inheight,numMipmapLevels); 2085 2085 return; 2086 2086 } 2087 2087 // else image size the same as when loaded so we can go ahead and subload 2088 2088 2089 2089 // If the texture's internal format is a compressed type, then the 2090 2090 // user is requesting that the graphics card compress the image if it's 2091 // not already compressed. However, if the image is not a multiple of 2091 // not already compressed. However, if the image is not a multiple of 2092 2092 // four in each dimension the subsequent calls to glTexSubImage* will 2093 2093 // fail. Revert to uncompressed format in this case. … … 2104 2104 OSG_NOTICE<<"glTexSubImage2D pixelFormat = "<<std::hex<<image->getPixelFormat()<<std::dec<<std::endl; 2105 2105 #endif 2106 2107 2108 // get the contextID (user defined ID of 0 upwards) for the 2106 2107 2108 // get the contextID (user defined ID of 0 upwards) for the 2109 2109 // current OpenGL context. 2110 2110 const unsigned int contextID = state.getContextID(); … … 2113 2113 // select the internalFormat required for the texture. 2114 2114 bool compressed_image = isCompressedInternalFormat((GLenum)image->getPixelFormat()); 2115 2115 2116 2116 glPixelStorei(GL_UNPACK_ALIGNMENT,image->getPacking()); 2117 2117 unsigned int rowLength = image->getRowLength(); 2118 2118 2119 2119 unsigned char* dataPtr = (unsigned char*)image->data(); 2120 2120 … … 2196 2196 } 2197 2197 else if (extensions->isCompressedTexImage2DSupported()) 2198 { 2198 { 2199 2199 GLint blockSize,size; 2200 2200 getCompressedSize(image->getInternalTextureFormat(), inwidth, inheight, 1, blockSize,size); 2201 2201 2202 extensions->glCompressedTexSubImage2D(target, 0, 2202 extensions->glCompressedTexSubImage2D(target, 0, 2203 2203 0,0, 2204 2204 inwidth, inheight, … … 2229 2229 height = 1; 2230 2230 2231 glTexSubImage2D( target, k, 2231 glTexSubImage2D( target, k, 2232 2232 0, 0, 2233 2233 width, height, … … 2254 2254 //state.checkGLErrors("before extensions->glCompressedTexSubImage2D("); 2255 2255 2256 extensions->glCompressedTexSubImage2D(target, k, 2256 extensions->glCompressedTexSubImage2D(target, k, 2257 2257 0, 0, 2258 width, height, 2258 width, height, 2259 2259 (GLenum)image->getPixelFormat(), 2260 2260 size, … … 2272 2272 { 2273 2273 //OSG_WARN<<"Warning:: cannot subload mip mapped texture from non mipmapped image."<<std::endl; 2274 applyTexImage2D_load(state, target, image, inwidth, inheight,numMipmapLevels); 2275 } 2276 } 2277 2274 applyTexImage2D_load(state, target, image, inwidth, inheight,numMipmapLevels); 2275 } 2276 } 2277 2278 2278 if (pbo) 2279 2279 { … … 2318 2318 if (hardwareMipmapOn) 2319 2319 { 2320 #if defined( OSG_GLES2_AVAILABLE ) || defined( OSG_GL3_AVAILABLE ) 2320 #if defined( OSG_GLES2_AVAILABLE ) || defined( OSG_GL3_AVAILABLE ) 2321 2321 return GENERATE_MIPMAP; 2322 2322 #else … … 2380 2380 2381 2381 _texMipmapGenerationDirtyList[contextID] = 0; 2382 2382 2383 2383 // if internal format does not provide automatic mipmap generation, then do manual allocation 2384 2384 if (_internalFormatType == SIGNED_INTEGER || _internalFormatType == UNSIGNED_INTEGER) … … 2387 2387 return; 2388 2388 } 2389 2389 2390 2390 // get fbo extension which provides us with the glGenerateMipmapEXT function 2391 2391 osg::FBOExtensions* fbo_ext = osg::FBOExtensions::instance(state.getContextID(), true); … … 2396 2396 textureObject->bind(); 2397 2397 fbo_ext->glGenerateMipmap(textureObject->target()); 2398 2398 2399 2399 // inform state that this texture is the current one bound. 2400 2400 state.haveAppliedTextureAttribute(state.getActiveTextureUnit(), this); 2401 2401 2402 2402 // if the function is not supported, then do manual allocation 2403 2403 }else … … 2405 2405 allocateMipmap(state); 2406 2406 } 2407 2407 2408 2408 } 2409 2409 … … 2457 2457 return; 2458 2458 } 2459 2459 2460 2460 const char* renderer = (const char*) glGetString(GL_RENDERER); 2461 2461 std::string rendererString(renderer ? renderer : ""); 2462 2462 2463 2463 bool builtInSupport = OSG_GLES2_FEATURES || OSG_GL3_FEATURES; 2464 2465 _isMultiTexturingSupported = builtInSupport || OSG_GLES1_FEATURES || 2464 2465 _isMultiTexturingSupported = builtInSupport || OSG_GLES1_FEATURES || 2466 2466 isGLExtensionOrVersionSupported( contextID,"GL_ARB_multitexture", 1.3f) || 2467 2467 isGLExtensionOrVersionSupported(contextID,"GL_EXT_multitexture", 1.3f); 2468 2468 2469 2469 _isTextureFilterAnisotropicSupported = isGLExtensionSupported(contextID,"GL_EXT_texture_filter_anisotropic"); 2470 2470 2471 2471 _isTextureCompressionARBSupported = builtInSupport || isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_compression", 1.3f); 2472 2472 2473 2473 _isTextureCompressionS3TCSupported = isGLExtensionSupported(contextID,"GL_EXT_texture_compression_s3tc"); 2474 2474 … … 2478 2478 2479 2479 _isTextureCompressionETCSupported = isGLExtensionSupported(contextID,"GL_OES_compressed_ETC1_RGB8_texture"); 2480 2480 2481 2481 2482 2482 _isTextureCompressionRGTCSupported = isGLExtensionSupported(contextID,"GL_EXT_texture_compression_rgtc"); … … 2484 2484 _isTextureCompressionPVRTCSupported = isGLExtensionSupported(contextID,"GL_IMG_texture_compression_pvrtc"); 2485 2485 2486 _isTextureMirroredRepeatSupported = builtInSupport || 2486 _isTextureMirroredRepeatSupported = builtInSupport || 2487 2487 isGLExtensionOrVersionSupported(contextID,"GL_IBM_texture_mirrored_repeat", 1.4f) || 2488 2488 isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_mirrored_repeat", 1.4f); 2489 2489 2490 2490 _isTextureEdgeClampSupported = builtInSupport || 2491 isGLExtensionOrVersionSupported(contextID,"GL_EXT_texture_edge_clamp", 1.2f) || 2491 isGLExtensionOrVersionSupported(contextID,"GL_EXT_texture_edge_clamp", 1.2f) || 2492 2492 isGLExtensionOrVersionSupported(contextID,"GL_SGIS_texture_edge_clamp", 1.2f); 2493 2493 2494 2494 2495 2495 _isTextureBorderClampSupported = OSG_GL3_FEATURES || 2496 2496 ((OSG_GL1_FEATURES || OSG_GL2_FEATURES) && isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_border_clamp", 1.3f)); 2497 2497 2498 2498 _isGenerateMipMapSupported = builtInSupport || isGLExtensionOrVersionSupported(contextID,"GL_SGIS_generate_mipmap", 1.4f); 2499 2499 2500 2500 _isTextureMultisampledSupported = isGLExtensionSupported(contextID,"GL_ARB_texture_multisample"); 2501 2501 2502 2502 _isShadowSupported = OSG_GL3_FEATURES || isGLExtensionSupported(contextID,"GL_ARB_shadow"); 2503 2503 2504 2504 _isShadowAmbientSupported = isGLExtensionSupported(contextID,"GL_ARB_shadow_ambient"); 2505 2505 … … 2509 2509 2510 2510 _isNonPowerOfTwoTextureMipMappedSupported = builtInSupport || _isNonPowerOfTwoTextureNonMipMappedSupported; 2511 2511 2512 2512 _isTextureIntegerEXTSupported = OSG_GL3_FEATURES || isGLExtensionSupported(contextID, "GL_EXT_texture_integer"); 2513 2513 … … 2519 2519 } 2520 2520 #endif 2521 2521 2522 2522 if (rendererString.find("GeForce FX")!=std::string::npos) 2523 2523 {
