Palette swapping with iPhone and OpenGLES
I am working on an iPhone game, which will have many types of creeps, and each type of creep may have different colors, so I'm looking for the best way to do it, which so far seems to be palette swaping. Is GL_EXT_paletted_texture avai开发者_如何学编程lable in OpenGLES (it is deprecated in OpenGL)? Since my game must support older devices (iPhone 3G) I can't use shaders, so I'm stuck with fixed pipeline.
How should I do palette swapping with OpenGLES on an iPhone?
- OpenGL Color Index for iPhone's OpenGL ES 1.1?
It sounds that you can use glCompressedTexImage2D with GL_PALETTE4_RGB8_OES or GL_PALETTE8_RGBA8_OES. It would be possible to load texel data with various palette data.
Or you can use OpenGL ES 1.1 Texture Environments. Combine texture or constant color with proper environment.
- iPhone 3D Programming - Chapter 8. Advanced Lighting and Texturing
精彩评论