|
Hi,
I am using TextureIO.newTextureData to create some OpenGL textures, which is convenient for me. Some of these textures contain normal and height data, for the purpose of bump mapping and parallax occlusion mapping. The RGB channels store the normal, and the A channel stores the height. There are two problems with this:
1) When I am loading a PNG, the RGB channels get modified due to the "convenient" alpha premultiplication. Of course premultiplication with normal/height data is nonsense, so I'd like to disable it. Surely there is a simple way to do this? I don't care about the "mathematically correct" way to do blending (to quote the Javadoc) since that's not my use case.
2) TGA files apparently don't get alpha-premultiplied, which is good for me (despite being weirdly inconsistent), so I am using TGA. Now the problem is that they load upside-down relative to how JPG and PNG are loaded. I tried switching the "vertical flip" flag in the header as specified in the TGA file format, but this seems to be ignored by the TGA loader.
It would be super useful if I could fix either or both of these issues. As of now I can't load any RGBA texture without it either being alpha-premultiplied or flipped upside-down.
Thanks!
P.S. I am using jogl-2.0-b45-20111219-linux-amd64
|