3D Textures & DevIL

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
iso
Halfling
Posts: 73
Joined: Fri Mar 18, 2005 11:43 am
Location: Slovakia

Post by iso »

That's it! I absolutely forget about it as I changed form 512 targa to 1024 raw. Thanks a lot!
Of course I don't see textures as images. Who would?

User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

The CVS version now throws an exception in this case, instead of a divide by zero. Might be more clear :)

iso
Halfling
Posts: 73
Joined: Fri Mar 18, 2005 11:43 am
Location: Slovakia

Post by iso »

So, I returned to the image loading.Now I have a 512x512x8 3D Texture, but I increased the pixel depth, so instead of PF_L8 it is PF_L16 now. Unfortunately Ogre recognizes it as PF_A8B8G8R8.

The file can be found here:
http://leon.svf.stuba.sk/~iso/Horizon.raw ~4 MB
or here
http://leon.svf.stuba.sk/~iso/Horizon16.exe ~ 3MB
The second is packed self-extracting winrar.

The header is surely correct, also the size of the file is ok. Can someone help to debug it? I think, I'll have to change something in the oger files (but I don't know what).

When I load the texture manually by DevIL and then just send the data by Image->loadDynamicImage and set the format by myself, everything is ok and the texture gets loaded and displayed correctly.
Last edited by iso on Wed Apr 27, 2005 10:36 pm, edited 1 time in total.
Of course I don't see textures as images. Who would?

User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Are you sure your card can do PF_L16 3D textures (of that size)? It doesn't sound unlikely that OpenGL will "try to be nice" and convert the texture to the default (PF_A8R8G8B8) in case the cards doesn't want to do it.
I'll try some debugging later.

For now, can you post the log entries regarding the loading of this particular image?

Ah, never mind. It turned out I still had the test case from this topic, so I plugged in the new .raw and yeah
Texture: Horizon.raw: Loading 1 faces(PF_A8B8G8R8,512x512x8) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x8.

Weirdness. Must be either an Ogre or DevIL bug.

DevIL identifies it as (0x1908 0x1401) IL_RGBA,IL_UNSIGNED_BYTE which Ogre maps to PF_A8R8G8B8. Can you blame it?

This is either a bug in DevIL or in your file.

Ah, I see. Your file is wrong:
iCurImage->Bpp == 2
iCurImage->Bpc == 1

Please change this to:
iCurImage->Bpp == 1
iCurImage->Bpc == 2

And it works.. Make sure you get the files right next time before you raise an issue, this is the second time already :P

iso
Halfling
Posts: 73
Joined: Fri Mar 18, 2005 11:43 am
Location: Slovakia

Post by iso »

Thank you for debugging. I always try to chatch out my errors, but when I can't find one for a long time, I better search for help.

An old saying in our country: "More heads, more wisdom."
:wumpus: wrote: Ah, I see. Your file is wrong:
iCurImage->Bpp == 2
iCurImage->Bpc == 1

Please change this to:
iCurImage->Bpp == 1
iCurImage->Bpc == 2
What's the difference between Bpp and Bpc?
Bpc = bytes per color?
I thought, that bpp = bytes per pixel, so I've set it to 2.
Of course I don't see textures as images. Who would?

User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

iso wrote:Thank you for debugging. I always try to chatch out my errors, but when I can't find one for a long time, I better search for help.
Sure..
:wumpus: wrote: What's the difference between Bpp and Bpc?
Bpc = bytes per color?
I thought, that bpp = bytes per pixel, so I've set it to 2.
Don't quote me on this, I'm not the writer of DevIL, and I do in no way endorse its naming convention, but, it seems:

Bpc -- bytes per component
Bpp -- components per pixel

Isn't it logical? (not really...)

iso
Halfling
Posts: 73
Joined: Fri Mar 18, 2005 11:43 am
Location: Slovakia

Post by iso »

No, it really isn't.
Live long and prosper, all the illogical beings between us \\//
Of course I don't see textures as images. Who would?

Post Reply