texture_format.txt 917 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ======
  2. Header
  3. ======
  4. ANKITEX1
  5. width
  6. height
  7. depth
  8. texture type 2D | cube | 3D | 2DArray
  9. color_format RGB8 | RGBA8
  10. compression_formats RAW & ETC2 & S3TC
  11. normal
  12. miplevels
  13. ===========
  14. Data layout
  15. ===========
  16. - Format A
  17. - Level 0
  18. - Depth 0 or face 0
  19. - Depth N or face N
  20. - Level N
  21. - Format B
  22. ================
  23. Helper functions
  24. ================
  25. PtrSize getDataSectionSize()
  26. Get The size of all the texture data. header+data_section_size == file_size
  27. PtrSize getCompressedFormatSize(format)
  28. Get the size of the a compressed format
  29. UVec2 getLevelSize(width, height, level)
  30. UVec2 getSurfaceSize(data_compression, level);
  31. Given a data compression format and the level get the size that the data should
  32. be
  33. =============
  34. Sanity checks
  35. =============
  36. - Compressed format and no mipmap should issue a warning
  37. - Get the total size of the file, sub the header, calculate the size and check
  38. if they match