Supported image types for blender importer

Hey everyone,



I’m goind to extend support for texture types that can be loaded by blender importer.

I’ll just need a few informations on several texture types (now focusing on RGB types only :wink: ).



1.

There are types like:

RGB16F

… all those that end with ‘F’.



Its obvious that each color factor is stored using 2 bytes which in case of RGB16F there are 6 bytes for pixel.

Each two bytes store a binary value that can be interpreted as a float value.

My question is: what is the range of the stored value ? Is it <0,1> or <0, {maximum float value stored in 2 bytes}> ?

I guess it is <0,1> but I might be wrong.

Are there available jme methods to easy convert the bytes into float?



2.

The second type that causes me problems is: RGB9E5.

r, g and b have 9-bits but what is the meaning of the E5 ?



3.

RGB10 is also a tricky one to read. The idea of this type is simple but the storage method bothers me.

I’d love to see that one in real but cannot find any example in the net.

Doea anyone could provide me an example for this one??





Of coulse I would appreciate examples for other not commonly used image types as well :wink:





Cheers,

Kaelthas

1 Like

Cool, could you update the wiki entry as well at times? Its being used in the sdk manual as well and its what we link to for info about the importer. https://wiki.jmonkeyengine.org/legacy/doku.php/sdk:blender

1 Like

Many of the types you mention are what’s called “HDR formats”. These should only be used for textures that are beyond the range 0 - 1 (for floats) or 0 - 255 (for bytes). Also, those textures will require an HDR tonemapping algorithm to display correctly. Generally they are only used for skyboxes where the luminance of the sun greatly outweights the rest of the scene. You can see a usage example of HDR textures in the TestHDR class.


There are types like:
RGB16F
… all those that end with ‘F’.

If you look up the javadoc for RGB16F it says "half-precision floating point red, green, and blue" - google it and you will end up here:
http://en.wikipedia.org/wiki/Half-precision_floating-point_format

To do the conversion you can use convert float to half-float method: http://hub.jmonkeyengine.org/javadoc/com/jme3/math/FastMath.html#convertFloatToHalf(float)

The second type that causes me problems is: RGB9E5.
r, g and b have 9-bits but what is the meaning of the E5 ?

The E value is the exponent. It allows getting higher luminance values than 1.0. Once again, it is only used for HDR textures. I don't have a conversion function handy but you can probably find it online.

RGB10 is also a tricky one to read. The idea of this type is simple but the storage method bothers me.
I’d love to see that one in real but cannot find any example in the net.
Doea anyone could provide me an example for this one??

Its also an HDR format. You make a good point that this format is rarely mentioned, it would be a good idea to remove it entirely. Besides, RGB9E5 allows you to get much higher luminance values for those same 32 bits.
2 Likes

Thanks for the info.

I have added support for all types except RGB10 and RGB9E5 for now.

Since they are not commonly used on the model this probably is not the most pressing issue at the moment :wink:

I’ll get back to this when I get more familiar with HDR images.


@normen said:
Cool, could you update the wiki entry as well at times? Its being used in the sdk manual as well and its what we link to for info about the importer. https://wiki.jmonkeyengine.org/legacy/doku.php/sdk:blender

Thanks for reminding me that :) I made the necessary changes.
2 Likes