summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/util
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-10-18 16:50:40 +0200
committerSven Gothel <[email protected]>2012-10-18 16:50:40 +0200
commit1aea29bb5d253600213024fd2c12a91bf3599202 (patch)
tree44e43329002021da1a2749758f35d9ccfa996539 /src/jogl/classes/jogamp/opengl/util
parentf25682cabc5f421c3126e75833ae70b5a16e5b2e (diff)
FixedFuncPipeline: Don't handle CullFace, ES2 impl. already takes care of discarding pixels of culled faces.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java15
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColor.fp3
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColorTexture.fp7
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_uniform.glsl2
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<cullFace && !enable) {
_cullFace = cullFace * -1;
@@ -542,7 +544,7 @@ public class FixedFuncPipeline {
if(_cullFace != cullFace) {
cullFaceDirty=true;
cullFace=_cullFace;
- }
+ } */
return true;
case GL.GL_TEXTURE_2D:
@@ -660,6 +662,7 @@ public class FixedFuncPipeline {
}
colorVAEnabledDirty = false;
}
+ /** ES2 supports CullFace implicit
if(cullFaceDirty) {
ud = shaderState.getUniform(mgl_CullFace);
if(null!=ud) {
@@ -667,7 +670,7 @@ public class FixedFuncPipeline {
shaderState.uniform(gl, ud);
}
cullFaceDirty = false;
- }
+ } */
if(alphaTestDirty) {
ud = shaderState.getUniform(mgl_AlphaTestFunc);
@@ -926,7 +929,8 @@ public class FixedFuncPipeline {
shaderState.uniform(gl, new GLUniformData(mgl_Texture+i, i));
}
shaderState.uniform(gl, new GLUniformData(mgl_ShadeModel, 0));
- shaderState.uniform(gl, new GLUniformData(mgl_CullFace, cullFace));
+ /** ES2 supports CullFace implicit
+ shaderState.uniform(gl, new GLUniformData(mgl_CullFace, cullFace)); */
shaderState.uniform(gl, new GLUniformData(mgl_AlphaTestFunc, alphaTestFunc));
shaderState.uniform(gl, new GLUniformData(mgl_AlphaTestRef, alphaTestRef));
for(int i=0; i<MAX_LIGHTS; i++) {
@@ -978,8 +982,10 @@ public class FixedFuncPipeline {
private final IntBuffer textureFormat = Buffers.newDirectIntBuffer(new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }); // per unit
private boolean textureFormatDirty = false;
+ /** ES2 supports CullFace implicit
private int cullFace=-2; // <=0 disabled, 1 GL_FRONT, 2 GL_BACK (default) and 3 GL_FRONT_AND_BACK
private boolean cullFaceDirty = false;
+ private static final String mgl_CullFace = "mgl_CullFace"; // 1i (lowp int) */
private boolean colorVAEnabledDirty = false;
private boolean lightingEnabled=false;
@@ -1010,7 +1016,6 @@ public class FixedFuncPipeline {
private static final String mgl_FrontMaterial = "mgl_FrontMaterial"; // struct mgl_MaterialParameters
private static final String mgl_LightsEnabled = "mgl_LightsEnabled"; // int mgl_LightsEnabled[MAX_LIGHTS];
- private static final String mgl_CullFace = "mgl_CullFace"; // 1i (lowp int)
private static final String mgl_AlphaTestFunc = "mgl_AlphaTestFunc"; // 1i (lowp int)
private static final String mgl_AlphaTestRef = "mgl_AlphaTestRef"; // 1f
private static final String mgl_ShadeModel = "mgl_ShadeModel"; // 1i
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColor.fp b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColor.fp
index bb0ca0123..0ed10b345 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColor.fp
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColor.fp
@@ -9,12 +9,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);
- }
+ } */
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