Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有人有如何编译着色器、保存着色器二进制文件并使用 glShaderBinary 稍后使用 iPhone/iOS (OpenGL ES 2.0) 加载着色器的示例?
这是不可能的(至少在 iOS 4 及更低版本中)。iOS 不支持任何预编译的二进制着色器。如果您向 OpenGL 查询它支持的二进制着色器格式的数量,您会得到零。
每次启动应用程序时,您都必须编译着色器。
(回答了我自己的问题。)
最好的起点是 XCode OpenGL 模板项目,一段时间以来它默认包含 ES 2.0 着色器。它还具有作为一个非常非常简单的示例的明显优势。