开发者

OpenGL Fixed function shader implementation [closed]

Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 2 years ago.

Improve this question

Is there any 开发者_运维百科wrapper which emulates the OpenGL ES 1.1 API on top of OpenGL ES 2.0? I was searching quite a bit but could not find any actual implementation.


I'm currently investigating same question, just stumbled upon this project: https://github.com/p3/regal#readme (OpenGL portability layer for OpenGL 2.x, 3.x, 4.x, Core contexts and ES 2.0). Only going to try it myself, but after reading the article http://www.gamasutra.com/view/news/177233/Indepth_Bringing_Regal_OpenGL_to_Native_Client.php, I believe this library may be solution to the problem.


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

this aims to emulate ES 1.1 with ES 2.0 shaders, not used it myself but will be doing!


Take a look at JOGL.

There are some packages about emulation the fixed pipeline from GLES 1.0 using the GLES 2.0:

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

Javadoc from the jogamp.opengl.util.glsl.fixedfunc.FixedFuncImpl class;

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() ) ) );

Besides, take a look at "OpenGL ES 2.0 Programming Guide" (Aaftab Munshi at alli.). There are some shaders examples about emulation of GLES 1.0 FFP.


you might like this tutorial: Recreating OpenGL's Fixed Function Pipeline using Cg. It is in CG, but that is rather similar to GLSL, with a few tweaks, one could surely turn it into a shader that would mimic fixed-function pipeline on Android.

As for the other deprecated functions, such as glVertex*(), i would advise against it (it was deprecated for a reason). If, on the other hand, one needed to port some software from ES 1 to ES 2, it should not be very hard to write a wrapper even on that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜