From 41cd6c47b23975098cd155517790e018670785e7 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Mon, 15 Jun 2009 23:12:27 +0000 Subject: Copied JOGL_2_SANDBOX r350 on to trunk; JOGL_2_SANDBOX branch is now closed git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@352 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4 --- .../es2/openmax/shader/bin/nvidia/moviesimple.bfp | Bin 0 -> 684 bytes .../es2/openmax/shader/bin/nvidia/moviesimple.bvp | Bin 0 -> 940 bytes src/demos/es2/openmax/shader/moviesimple.fp | 21 ++++++++++++++++++++ src/demos/es2/openmax/shader/moviesimple.vp | 22 +++++++++++++++++++++ .../openmax/shader/scripts/nvidia-apx/glslc-ff.bat | 9 +++++++++ 5 files changed, 52 insertions(+) create mode 100755 src/demos/es2/openmax/shader/bin/nvidia/moviesimple.bfp create mode 100755 src/demos/es2/openmax/shader/bin/nvidia/moviesimple.bvp create mode 100644 src/demos/es2/openmax/shader/moviesimple.fp create mode 100644 src/demos/es2/openmax/shader/moviesimple.vp create mode 100755 src/demos/es2/openmax/shader/scripts/nvidia-apx/glslc-ff.bat (limited to 'src/demos/es2/openmax/shader') diff --git a/src/demos/es2/openmax/shader/bin/nvidia/moviesimple.bfp b/src/demos/es2/openmax/shader/bin/nvidia/moviesimple.bfp new file mode 100755 index 0000000..97a6980 Binary files /dev/null and b/src/demos/es2/openmax/shader/bin/nvidia/moviesimple.bfp differ diff --git a/src/demos/es2/openmax/shader/bin/nvidia/moviesimple.bvp b/src/demos/es2/openmax/shader/bin/nvidia/moviesimple.bvp new file mode 100755 index 0000000..2ca3dff Binary files /dev/null and b/src/demos/es2/openmax/shader/bin/nvidia/moviesimple.bvp differ diff --git a/src/demos/es2/openmax/shader/moviesimple.fp b/src/demos/es2/openmax/shader/moviesimple.fp new file mode 100644 index 0000000..c711641 --- /dev/null +++ b/src/demos/es2/openmax/shader/moviesimple.fp @@ -0,0 +1,21 @@ + +#ifdef GL_ES + #define MEDIUMP mediump + #define HIGHP highp +#else + #define MEDIUMP + #define HIGHP +#endif + +uniform sampler2D mgl_ActiveTexture; +varying HIGHP vec4 mgl_texCoord; +varying HIGHP vec4 frontColor; + +void main (void) +{ + vec4 texColor = texture2D(mgl_ActiveTexture, mgl_texCoord.st); + + // mix frontColor with texture .. + gl_FragColor = vec4(frontColor.rgb*texColor.rgb, frontColor.a); +} + diff --git a/src/demos/es2/openmax/shader/moviesimple.vp b/src/demos/es2/openmax/shader/moviesimple.vp new file mode 100644 index 0000000..0b78eb9 --- /dev/null +++ b/src/demos/es2/openmax/shader/moviesimple.vp @@ -0,0 +1,22 @@ + +#ifdef GL_ES + #define MEDIUMP mediump + #define HIGHP highp +#else + #define MEDIUMP + #define HIGHP +#endif + +uniform MEDIUMP mat4 mgl_PMVMatrix[2]; +attribute HIGHP vec4 mgl_Vertex; +attribute HIGHP vec4 mgl_Color; +attribute HIGHP vec4 mgl_MultiTexCoord; +varying HIGHP vec4 frontColor; +varying HIGHP vec4 mgl_texCoord; + +void main(void) +{ + frontColor=mgl_Color; + mgl_texCoord = mgl_MultiTexCoord; + gl_Position = mgl_PMVMatrix[0] * mgl_PMVMatrix[1] * mgl_Vertex; +} diff --git a/src/demos/es2/openmax/shader/scripts/nvidia-apx/glslc-ff.bat b/src/demos/es2/openmax/shader/scripts/nvidia-apx/glslc-ff.bat new file mode 100755 index 0000000..a93f43c --- /dev/null +++ b/src/demos/es2/openmax/shader/scripts/nvidia-apx/glslc-ff.bat @@ -0,0 +1,9 @@ +REM +REM You have to call it from the 'shader' directory, e.g.: +REM scripts\nvidia-apx\glslc-ff.bat +REM +IF !"%JOGLDIR%"==""! GOTO YESPATH +set JOGLDIR=..\lib +:YESPATH + +java -cp %JOGLDIR%\jogl.core.jar;%JOGLDIR%\jogl.gles2.jar;%JOGLDIR%\jogl.fixed.jar;%JOGLDIR%\jogl.sdk.jar javax.media.opengl.sdk.glsl.CompileShaderNVidia moviesimple.vp moviesimple.fp -- cgit v1.2.3