Closed filipwasil closed 6 years ago
Current class diagram looks like this:
@startuml TextureSystem o-- TextureLoader TextureSystem o-- TMSTexture1D TextureSystem o-- TMSTexture2D TextureSystem o-- TMSTexture2DRendreable TextureSystem o-- TMSTexture2DRendreableDynamic TextureSystem o-- TMSTexture3D TextureSystem o-- TMSTexture3DRenderable TextureSystem o-- TMSTexture3DRenderableDynamic @enduml
Now the problem is that TextureLoader should actually be an interface, which will be able derive from ITextureLoader.
@startuml TextureSystem o-- ITextureLoader ITextureLoader <|-- ITextureLoaderSTB ITextureLoader <|-- ITextureLoaderGLI TextureSystem o-- Template_ManagerSmartTextureXXX @enduml
The thing is that every model, while being created, uses the Texture system to get the texture, and the output of the loading operation is a "FIle".
@startuml Texture2DFile o-- Texture2DFileConfig Texture2DFile o-- Texture2DFileHeader Texture2DFile o-- Texture2DFileData Texture2DFile o-- eMemoryAllocation Texture3DFile <|-- Texture2DFile Texture3D o-- Texture3DFile Texture2D o-- Texture2DFile @enduml
The diagram shows the relations. Each 2D Texture has a 2D file. Each 3D texture has a 3D File.
IN GLI implementation GLI, basically returns only handlers to textures. We want to take the construct our texture from gli::texture.
Of course better ideas are welcome. This is just a draft.
Compressed fle size is needed to read.
Also Texture Generator
Checking available compresssions:
glGetIntegerv (GL_NUM_COMPRESSED_TEXTURE_FORMATS, localInt)
also put the verification here:
Thread to read about compression matter
analysis for compressions in OpenGL
Conclusion:
As default option, keep a set of uncompressed textures and a set of compressed S3TC (DXT1, DXT3, DXT5) or ETC/ETC2 (good enough for RGB w/o transparency).
example compression tool for S3TC
http://www.xnview.com/en/nconvert/