From 1aea29bb5d253600213024fd2c12a91bf3599202 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 18 Oct 2012 16:50:40 +0200 Subject: FixedFuncPipeline: Don't handle CullFace, ES2 impl. already takes care of discarding pixels of culled faces. --- .../jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java | 4 +++- .../opengl/util/glsl/fixedfunc/FixedFuncPipeline.java | 15 ++++++++++----- .../opengl/util/glsl/fixedfunc/shaders/FixedFuncColor.fp | 3 ++- .../util/glsl/fixedfunc/shaders/FixedFuncColorTexture.fp | 7 ++++--- .../opengl/util/glsl/fixedfunc/shaders/mgl_uniform.glsl | 2 +- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java index ee2a08d1f..fad81226d 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java @@ -341,10 +341,12 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun public void glAlphaFunc(int func, float ref) { fixedFunction.glAlphaFunc(func, ref); } + + /** ES2 supports CullFace implicit public void glCullFace(int faceName) { fixedFunction.glCullFace(faceName); gl.glCullFace(faceName); - } + } */ // // PointerIf diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java index f92c02403..72d105a44 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java @@ -447,6 +447,7 @@ public class FixedFuncPipeline { } } + /** ES2 supports CullFace implicit public void glCullFace(int faceName) { int _cullFace; switch(faceName) { @@ -471,7 +472,7 @@ public class FixedFuncPipeline { cullFaceDirty=true; } } - } + } */ public void glAlphaFunc(int func, float ref) { int _func; @@ -533,6 +534,7 @@ public class FixedFuncPipeline { return true; case GL.GL_CULL_FACE: + /** ES2 supports CullFace implicit final int _cullFace; if(0>cullFace && enable || 0 0 && ( ( MGL_FRONT == mgl_CullFace && gl_FrontFacing ) || ( MGL_BACK == mgl_CullFace && !gl_FrontFacing ) || ( MGL_FRONT_AND_BACK == mgl_CullFace ) ) ) { DISCARD(color); - } + } */ if( mgl_AlphaTestFunc > 0 ) { alphaTest(color); } diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColorTexture.fp b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColorTexture.fp index 1810891b3..9a7e5217b 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColorTexture.fp +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColorTexture.fp @@ -53,12 +53,13 @@ void main (void) { vec4 color = frontColor; + /** ES2 supports CullFace implicit .. if( mgl_CullFace > 0 && ( ( MGL_FRONT == mgl_CullFace && gl_FrontFacing ) || ( MGL_BACK == mgl_CullFace && !gl_FrontFacing ) || ( MGL_FRONT_AND_BACK == mgl_CullFace ) ) ) { DISCARD(color); - } else { + } else { */ #if MAX_TEXTURE_UNITS >= 2 if( 0 != mgl_TextureEnabled[0] ) { calcTexColor(color, texture2D(mgl_Texture0, mgl_TexCoords[0].st), mgl_TexFormat[0], mgl_TexEnvMode[0]); @@ -90,9 +91,9 @@ void main (void) } #endif if( mgl_AlphaTestFunc > 0 ) { - alphaTest(color); + alphaTest(color); } - } + // } /* CullFace */ gl_FragColor = color; /** diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_uniform.glsl b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_uniform.glsl index b92037ef9..68245a62c 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_uniform.glsl +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_uniform.glsl @@ -11,6 +11,7 @@ uniform LOWP int mgl_ColorEnabled; uniform vec4 mgl_ColorStatic; uniform LOWP int mgl_AlphaTestFunc; uniform float mgl_AlphaTestRef; +// uniform LOWP int mgl_CullFace; // ES2 supports CullFace implicit .. #if MAX_TEXTURE_UNITS > 0 uniform LOWP int mgl_TextureEnabled[MAX_TEXTURE_UNITS]; uniform LOWP int mgl_TexCoordEnabled[MAX_TEXTURE_UNITS]; @@ -31,6 +32,5 @@ uniform sampler2D mgl_Texture6; uniform sampler2D mgl_Texture7; #endif #endif -uniform LOWP int mgl_CullFace; #endif // mgl_uniform_glsl -- cgit v1.2.3