Luminance (L8) DDS files incorrectly handled

Panda supports loading DDS textures since 1.6 version and that’s great!

However it seems to always consider that DDS files have RGBA format.

Here are two DDS files:

  • first one has RGBA format: dl.dropbox.com/u/3545118/rgba.dds
    Open it in DirectX Texture Tool, you’ll read “rgba.dds (A8R8G8B8, 100%)” and see yellow & black stripes

  • second one has Luminance format: dl.dropbox.com/u/3545118/luminance.dds
    Open it in DirectX Texture Tool, you’ll read “luminance.dds (L8, Mip1 of 10, 100%)” and see white and gray stripes

When I try to load the “luminance.dds” texture on a mesh, I can see red stripes whereas it should be gray stripes: the luminance channel has been interpreted as the “red” channel of a RGBA texture.

I tried:

 Texture.setFormat(Texture.FLuminance) 

but didn’t get correct result. Also tried FLuminanceAlpha, FLuminanceAlphamask and even FRed but without success.

-David

You are correct; it is a bug. I have just committed a fix to the cvs trunk. I tagged this fix to be part of the 1.7.1 release.

Thanks!
David

Wow, that’s what I call efficiency!