Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OpenGL compressed textures



I've filed a bug at bugreport.apple.com, but it seems that the bug I've submitted is locked and I'm unable to add the info apple required...

I'll explain the problem here since I'm not so sure it's a bug also if win32 / linux don't complain that code and most macs give GL_INVALID_OPERATION but do the right thing...

The short thing is that a texture mipmap created with:

glTexImage2D(GL_TEXTURE_2D, i, format,
                    nWidth, nHeight, 0,
                    GL_RGBA, GL_UNSIGNED_BYTE, 0);

So with a NULL buffer, is uploaded in a second time with the real COMPRESSED DXTx texture data with:

glCompressedTexSubImage2DARB( GL_TEXTURE_2D,
                       i, 0, 0, nWidth, nHeight,
                      format,
                      nSize,
                      pixels + nOffset);

This second operation gives GL_INVALID_OPERATION on every mac I tried, BUT it works on my NVIDIA based powerbook while it gives TRASHED textures (not white, it seems random memory data)  on an intel macmini.

format and nWidth/nHeight obviously match in the two calls, you can find a full example provided with two textures at the following url:

http://www.ggsoft.org/sources/test_dds.tar.gz

It requires SDL.framework, the archive is quite big because it contains a bmp texture and a dds one with 10 mipmap levels, the applebugform.txt in the archive explains maybe better what I wrote here.

BTW: this way to prebuild the "mipmap pyramid" is used by EVERY Ogre3d game/application, I already spoken with Ogre project leader and he will change the prebuilt method in the Mac version, but the change will be less performant cause the texture will be uploaded TWICE (in the prebuild stage it will be uploaded an all null empty texture).

--
Bye,
Gabry

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.