From 131c40a80427d5e35824ad41da375edd4792fb60 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 16 Apr 2012 01:17:56 +0200 Subject: TexSequence/Movie Demo's Shader: Remove profile specific 'header' files, prepare for shader code injection. --- .../junit/jogl/demos/es2/shader/texsequence_xxx.fp | 22 ++++++++++++++++++++++ .../junit/jogl/demos/es2/shader/texsequence_xxx.vp | 17 +++++++++++++++++ .../junit/jogl/demos/es2/shader/texsimple_es2.fp | 9 --------- .../junit/jogl/demos/es2/shader/texsimple_es2.vp | 7 ------- .../jogl/demos/es2/shader/texsimple_es2_exttex.fp | 11 ----------- .../junit/jogl/demos/es2/shader/texsimple_gl2.fp | 7 ------- .../junit/jogl/demos/es2/shader/texsimple_gl2.vp | 5 ----- .../junit/jogl/demos/es2/shader/texsimple_xxx.fp | 18 ------------------ .../junit/jogl/demos/es2/shader/texsimple_xxx.vp | 17 ----------------- 9 files changed, 39 insertions(+), 74 deletions(-) create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsequence_xxx.fp create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsequence_xxx.vp delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_es2.fp delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_es2.vp delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_es2_exttex.fp delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_gl2.fp delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_gl2.vp delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_xxx.fp delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_xxx.vp diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsequence_xxx.fp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsequence_xxx.fp new file mode 100644 index 000000000..adde23d0a --- /dev/null +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsequence_xxx.fp @@ -0,0 +1,22 @@ +// Copyright 2012 JogAmp Community. All rights reserved. + +varying vec2 mgl_texCoord; +varying vec4 frontColor; + +// Insert dynamic code after the following tag: +// TEXTURE-SEQUENCE-CODE-BEGIN +// TEXTURE-SEQUENCE-CODE-END + +void main (void) +{ + vec4 texColor; + if(0.0 <= mgl_texCoord.t && mgl_texCoord.t<=1.0) { + texColor = myTexture2D(mgl_ActiveTexture, mgl_texCoord); + } else { + texColor = vec4(1, 1, 1, 1); + } + + // mix frontColor with texture .. + gl_FragColor = vec4(frontColor*texColor); +} + diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsequence_xxx.vp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsequence_xxx.vp new file mode 100644 index 000000000..c521e3757 --- /dev/null +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsequence_xxx.vp @@ -0,0 +1,17 @@ +// Copyright 2012 JogAmp Community. All rights reserved. + +uniform mat4 mgl_PMVMatrix[2]; +// uniform mat4 mgl_STMatrix; +attribute vec4 mgl_Vertex; +attribute vec4 mgl_Color; +attribute vec4 mgl_MultiTexCoord; +varying vec4 frontColor; +varying vec2 mgl_texCoord; + +void main(void) +{ + frontColor=mgl_Color; + // mgl_texCoord = (mgl_STMatrix * mgl_MultiTexCoord).st; + mgl_texCoord = mgl_MultiTexCoord.st; + gl_Position = mgl_PMVMatrix[0] * mgl_PMVMatrix[1] * mgl_Vertex; +} diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_es2.fp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_es2.fp deleted file mode 100644 index 3a7dcf7a2..000000000 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_es2.fp +++ /dev/null @@ -1,9 +0,0 @@ -//Copyright 2010 JogAmp Community. All rights reserved. - -#version 100 - -precision mediump float; - -uniform sampler2D mgl_ActiveTexture; - -#include texsimple_xxx.fp diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_es2.vp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_es2.vp deleted file mode 100644 index 16c070a31..000000000 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_es2.vp +++ /dev/null @@ -1,7 +0,0 @@ -//Copyright 2010 JogAmp Community. All rights reserved. - -#version 100 - -precision mediump float; - -#include texsimple_xxx.vp diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_es2_exttex.fp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_es2_exttex.fp deleted file mode 100644 index c45cebaf3..000000000 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_es2_exttex.fp +++ /dev/null @@ -1,11 +0,0 @@ -//Copyright 2010 JogAmp Community. All rights reserved. - -#version 100 - -#extension GL_OES_EGL_image_external : require - -precision mediump float; - -uniform samplerExternalOES mgl_ActiveTexture; - -#include texsimple_xxx.fp diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_gl2.fp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_gl2.fp deleted file mode 100644 index 31a63e6a4..000000000 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_gl2.fp +++ /dev/null @@ -1,7 +0,0 @@ -//Copyright 2010 JogAmp Community. All rights reserved. - -#version 110 - -uniform sampler2D mgl_ActiveTexture; - -#include texsimple_xxx.fp diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_gl2.vp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_gl2.vp deleted file mode 100644 index 8fcdc0ac9..000000000 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_gl2.vp +++ /dev/null @@ -1,5 +0,0 @@ -//Copyright 2010 JogAmp Community. All rights reserved. - -#version 110 - -#include texsimple_xxx.vp diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_xxx.fp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_xxx.fp deleted file mode 100644 index 1465b28ed..000000000 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_xxx.fp +++ /dev/null @@ -1,18 +0,0 @@ -//Copyright 2010 JogAmp Community. All rights reserved. - -varying vec2 mgl_texCoord; -varying vec4 frontColor; - -void main (void) -{ - vec4 texColor; - if(0.0 <= mgl_texCoord.t && mgl_texCoord.t<=1.0) { - texColor = texture2D(mgl_ActiveTexture, mgl_texCoord); - } else { - texColor = vec4(1, 1, 1, 1); - } - - // mix frontColor with texture .. - gl_FragColor = vec4(frontColor*texColor); -} - diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_xxx.vp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_xxx.vp deleted file mode 100644 index dea57ca9e..000000000 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texsimple_xxx.vp +++ /dev/null @@ -1,17 +0,0 @@ -//Copyright 2010 JogAmp Community. All rights reserved. - -uniform mat4 mgl_PMVMatrix[2]; -// uniform mat4 mgl_STMatrix; -attribute vec4 mgl_Vertex; -attribute vec4 mgl_Color; -attribute vec4 mgl_MultiTexCoord; -varying vec4 frontColor; -varying vec2 mgl_texCoord; - -void main(void) -{ - frontColor=mgl_Color; - // mgl_texCoord = (mgl_STMatrix * mgl_MultiTexCoord).st; - mgl_texCoord = mgl_MultiTexCoord.st; - gl_Position = mgl_PMVMatrix[0] * mgl_PMVMatrix[1] * mgl_Vertex; -} -- cgit v1.2.3