OpenGL固定功能着色器实现

时间:2011-08-31 22:23:07

标签: opengl-es opengl-es-2.0

是否有任何包装器在OpenGL ES 2.0之上模拟OpenGL ES 1.1 API?我搜索的很多,但找不到任何实际的实现。

4 个答案:

答案 0 :(得分:5)

我正在研究同样的问题,只是偶然发现了这个项目:https://github.com/p3/regal#readme(OpenGL 2.x,3.x,4.x,Core上下文和ES 2.0的OpenGL可移植层)。只是自己尝试一下,但在阅读文章http://www.gamasutra.com/view/news/177233/Indepth_Bringing_Regal_OpenGL_to_Native_Client.php之后,我相信这个库可能是问题的解决方案。

答案 1 :(得分:2)

你可能会喜欢这个教程:Recreating OpenGL's Fixed Function Pipeline using Cg。它在CG中,但它与GLSL非常相似,只需进行一些调整,就可以将它变成一个模仿Android上固定功能管道的着色器。

至于其他已弃用的函数,例如glVertex *(),我会反对它(由于某种原因它已被弃用)。另一方面,如果需要将某些软件从ES 1移植到ES 2,那么编写一个包装器就不是很难了。

答案 2 :(得分:2)

http://code.google.com/p/gles2-bc/

这旨在使用ES 2.0着色器模拟ES 1.1,而不是自己使用它,但将会这样做!

答案 3 :(得分:2)

看看JOGL。

有些软件包使用GLES 2.0来模拟GLES 1.0中的固定管道:

package javax.media.opengl.fixedfunc;
package com.jogamp.opengl.util.glsl.fixedfunc;   
package jogamp.opengl.util.glsl.fixedfunc;

来自jogamp.opengl.util.glsl.fixedfunc.FixedFuncImpl类的Javadoc;

Composable pipeline, implementing the interface javax.media.opengl.GL2ES1
Each method follows the call graph:
* call prolog jogamp.opengl.util.glsl.fixedfunc.FixedFuncHook if available 
* call downstream javax.media.opengl.GL2ES2 if available and if no call to jogamp.opengl.util.glsl.fixedfunc.FixedFuncHook is made 

* Interface javax.media.opengl.GL2ES1 
* Prolog jogamp.opengl.util.glsl.fixedfunc.FixedFuncHook 
* Downstream javax.media.opengl.GL2ES2 

Sample code which installs this pipeline: 
     GL gl = drawable.setGL( new FixedFuncImpl( drawable.getGL().getGL2ES2(), new FixedFuncHook( drawable.getGL().getGL2ES2() ) ) );

此外,请看一下" OpenGL ES 2.0编程指南" (在Alli的Aaftab Munshi。)。有一些关于仿真GLES 1.0 FFP的着色器示例。

相关问题