From Johannes Baeuerele, "I have extended the pvr reader plugin to support etc1 compression(GL_ETC1_RGB8_OES). The changes attached to this submission are based on today's trunk.

The pvr format which can be used as a wrapper for different compressed and uncompressed formats supports this compression algorithm. The original pvr compression uses the pvrtc format. The handling of pvrtc is already implemented in the pvr plugin. PVR provides wrapper functionality for some formats, e.g. etc or even dxt/dds.

Our target system (gles2) is able to use the etc compression format. With minor changes in the submitted files, there is no need to write a separate plugin. However the original pvr texture compression formats are not supported on our target, which is the reason for this extension.

The changes mainly consist in the definition on new enum values in the classes and headers of ReaderWriterPVR,Image and Texture. I also found some locations where the handling of the original pvr textures was not implemented. These are also part of this submission."
This commit is contained in:
Robert Osfield
2011-04-21 17:04:50 +00:00
parent 634344aef5
commit a793958836
4 changed files with 89 additions and 6 deletions

View File

@@ -71,6 +71,10 @@
#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
#endif
#ifndef GL_OES_compressed_ETC1_RGB8_texture
#define GL_ETC1_RGB8_OES 0x8D64
#endif
#ifndef GL_ARB_INTERNAL_TEXTURE_FORMAT
#define GL_RGBA32F_ARB 0x8814
#define GL_RGB32F_ARB 0x8815
@@ -446,6 +450,9 @@ class OSG_EXPORT Texture : public osg::StateAttribute
USE_S3TC_DXT1_COMPRESSION,
USE_S3TC_DXT3_COMPRESSION,
USE_S3TC_DXT5_COMPRESSION,
USE_PVRTC_2BPP_COMPRESSION,
USE_PVRTC_4BPP_COMPRESSION,
USE_ETC_COMPRESSION,
USE_RGTC1_COMPRESSION,
USE_RGTC2_COMPRESSION,
USE_S3TC_DXT1c_COMPRESSION,
@@ -644,6 +651,15 @@ class OSG_EXPORT Texture : public osg::StateAttribute
void setTextureCompressionS3TCSupported(bool flag) { _isTextureCompressionS3TCSupported=flag; }
bool isTextureCompressionS3TCSupported() const { return _isTextureCompressionS3TCSupported; }
void setTextureCompressionPVRTC2BPPSupported(bool flag) { _isTextureCompressionPVRTC2BPPSupported=flag; }
bool isTextureCompressionPVRTC2BPPSupported() const { return _isTextureCompressionPVRTC2BPPSupported; }
void setTextureCompressionPVRTC4BPPSupported(bool flag) { _isTextureCompressionPVRTC4BPPSupported=flag; }
bool isTextureCompressionPVRTC4BPPSupported() const { return _isTextureCompressionPVRTC4BPPSupported; }
void setTextureCompressionETCSupported(bool flag) { _isTextureCompressionETCSupported=flag; }
bool isTextureCompressionETCSupported() const { return _isTextureCompressionETCSupported; }
void setTextureCompressionRGTCSupported(bool flag) { _isTextureCompressionRGTCSupported=flag; }
bool isTextureCompressionRGTCSupported() const { return _isTextureCompressionRGTCSupported; }
@@ -748,6 +764,9 @@ class OSG_EXPORT Texture : public osg::StateAttribute
bool _isTextureFilterAnisotropicSupported;
bool _isTextureCompressionARBSupported;
bool _isTextureCompressionS3TCSupported;
bool _isTextureCompressionPVRTC2BPPSupported;
bool _isTextureCompressionPVRTC4BPPSupported;
bool _isTextureCompressionETCSupported;
bool _isTextureCompressionRGTCSupported;
bool _isTextureCompressionPVRTCSupported;
bool _isTextureMirroredRepeatSupported;