godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

Some form of explanation for the formats on the Image page.

Open najarvis opened this issue 8 years ago • 5 comments

If you look at the image documentation page, it has an enum called "Format", and 37 different formats. These aren't explained at all and I have no idea which one I should use in which instance. For example, I am trying to create a custom .exr image but I have no idea which of these pertains to that.

Edit: link

najarvis avatar Mar 09 '18 02:03 najarvis

These are Texture Compression Formats.

I looked into the image.cpp and image_etc.cpp but there aren't much comments besides LA8 = LumAlpha8 (Lum = Luminance) and DXT1 = DXT1 RGB8 (s3tc).

But I found some info in the OpenGL ES 3.0 spec:

Further reading:

  • https://blogs.msdn.microsoft.com/shawnhar/2008/10/28/texture-compression/
  • https://www.arm.com/files/event/Developer_Track_5_ASTC-The_Future_of_Texture_Compression.pdf
  • http://renderingpipeline.com/2012/07/texture-compression/
  • https://www.fsdeveloper.com/wiki/index.php?title=DXT_compression_explained
  • https://www.imgtec.com/blog/pvrtc-the-most-efficient-texture-compression-standard-for-the-mobile-graphics-world/
  • https://software.intel.com/en-us/articles/android-texture-compression-a-comparison-study-with-code-sample
  • https://docs.unity3d.com/Manual/class-TextureImporterOverride.html
  • https://www.khronos.org/registry/DataFormat/specs/1.1/dataformat.1.1.html

pwab avatar Mar 09 '18 09:03 pwab

Wow, this is really helpful, thank you! I ended up using FORMAT_RGBAF, since that gave 32 bits of data per color channel, which worked great, but I'm sure your comment would be extremely helpful for anyone else who is working with custom images in Godot. Thank you again!

najarvis avatar Mar 09 '18 13:03 najarvis

You are welcome. And you are totally right that this should be documented somehow. Thanks for pointing this out.

pwab avatar Mar 09 '18 14:03 pwab

Is godotengine/godot#17399 good enough to close this out @najarvis / @pwab?

Dar13 avatar Mar 14 '18 03:03 Dar13

Looks great, thank you for this!

najarvis avatar Mar 14 '18 04:03 najarvis