iPhone glShaderBinary

我与影子孤独终老i 提交于 2019-12-23 23:25:08

问题


Does anyone have an example of how to compile a shader, save the shader binary, and use glShaderBinary to later load the shader with iPhone/iOS (OpenGL ES 2.0)?


回答1:


It's not possible to do this (at least with iOS 4 and below). iOS doesn't support any precompiled binary shaders. If you query OpenGL for the number of binary shader formats it supports, you get back zero.

You're forced to compile the shaders every time you start the app.

(Answered my own question.)




回答2:


The best place to start is the XCode OpenGL template project, which for some time has included ES 2.0 shaders by default. It also has the distinct advantage of being a very, very simple example.



来源:https://stackoverflow.com/questions/5440430/iphone-glshaderbinary

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!