OpenGL ES 16-bit Textures?

Hello,

On iPhone SDK, how can I create textures with 16 bit per pixel as texture internal format?

Currently glTexImage2D seems to accept only GL_RGBA as internal format.

Thanks.

Mac Mini, Mac OS X (10.5.4)

Posted on Sep 26, 2008 10:12 AM

Reply
9 replies

Oct 4, 2008 2:39 PM in response to wallclimber21

I have pixel data stored in RGBA, 32 bits per pixel, so I tried to let glTexImage2D convert this to some 16 Bit internal format with:
glTexImage2D(GL TEXTURE2D, 0, GL_RGBA4, width, height, 0, GL_RGBA8, GL UNSIGNEDBYTE, data);
This works with the Mac Version of my app, but not with the iPhone (Simulator) Version.

I haven't tried with glTexImage2D(GL TEXTURE2D, 0, GL_RGB, width, height, 0, GL_RGB, GL UNSIGNED_SHORT_5_65, data);
This means, I'd have to convert the pixel data to 565 before this call. The internal format of GL_RGB would then also be 16 bit (565)?

Message was edited by: charnold

Message was edited by: charnold

Oct 5, 2008 12:30 PM in response to Frogblast

Ok, this works, thanks!

I'm testing only on the iPhone Simulator at the moment (on a device asap). There is not much performance difference when using 16 or 32 bit textures. And the performance is not very high. My test program renders closed 3D rooms / no lighting / low polycount. With the OpenGL Desktop version, I get >1000 fps, with the iPhone Simulator only <60 fps.
Is there anything wrong? Is this the speed, I can expect on the device? (I know, the Simulator tells not much about the performance on the device, but what is your experience with real time 3D on the Simulator compared to the device?)

Oct 6, 2008 8:12 PM in response to charnold

I don't have a desktop OpenGL program, so I really can't compare, but my experience on a MacMini (with the horrendously bad Intel graphics chip, so YMMV) is that the performance between the iPhone simulator and the actual hardware is somewhat equivalent. When I'm using a low poly count (<15000 polys), the iPhone hardware tends to be a bit faster than the simulator. When the poly counts goes up, the situation goes the opposite way.

It would be nice to hear what others have seen...

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

OpenGL ES 16-bit Textures?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.