简体   繁体   English

调色板与iPhone和OpenGLES交换

[英]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. 我正在开发一款iPhone游戏,它有很多类型的小怪物,每种类型的蠕变都可能有不同的颜色,所以我正在寻找最好的方法,到目前为止似乎是调色板交换。 Is GL_EXT_paletted_texture available in OpenGLES (it is deprecated in OpenGL)? GL_EXT_paletted_texture在OpenGLES中是否可用(在OpenGL中已弃用)? Since my game must support older devices (iPhone 3G) I can't use shaders, so I'm stuck with fixed pipeline. 由于我的游戏必须支持旧设备(iPhone 3G),我不能使用着色器,所以我坚持使用固定管道。

How should I do palette swapping with OpenGLES on an iPhone? 我应该如何在iPhone上使用OpenGLES进行调色板交换?

It sounds that you can use glCompressedTexImage2D with GL_PALETTE4_RGB8_OES or GL_PALETTE8_RGBA8_OES. 听起来你可以将glCompressedTexImage2D与GL_PALETTE4_RGB8_OES或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. 或者您可以使用OpenGL ES 1.1纹理环境。 Combine texture or constant color with proper environment. 将纹理或恒定颜色与适当的环境相结合。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM