summaryrefslogtreecommitdiffstats
path: root/src/demos/es2/shader
diff options
context:
space:
mode:
Diffstat (limited to 'src/demos/es2/shader')
-rwxr-xr-xsrc/demos/es2/shader/bin/nvidia/redsquare.bfpbin0 -> 524 bytes
-rwxr-xr-xsrc/demos/es2/shader/bin/nvidia/redsquare.bvpbin0 -> 864 bytes
-rw-r--r--src/demos/es2/shader/redsquare.fp16
-rw-r--r--src/demos/es2/shader/redsquare.vp19
-rwxr-xr-xsrc/demos/es2/shader/scripts/nvidia-apx/glslc-ff.bat9
5 files changed, 44 insertions, 0 deletions
diff --git a/src/demos/es2/shader/bin/nvidia/redsquare.bfp b/src/demos/es2/shader/bin/nvidia/redsquare.bfp
new file mode 100755
index 0000000..454354c
--- /dev/null
+++ b/src/demos/es2/shader/bin/nvidia/redsquare.bfp
Binary files differ
diff --git a/src/demos/es2/shader/bin/nvidia/redsquare.bvp b/src/demos/es2/shader/bin/nvidia/redsquare.bvp
new file mode 100755
index 0000000..ba0c982
--- /dev/null
+++ b/src/demos/es2/shader/bin/nvidia/redsquare.bvp
Binary files differ
diff --git a/src/demos/es2/shader/redsquare.fp b/src/demos/es2/shader/redsquare.fp
new file mode 100644
index 0000000..a94f705
--- /dev/null
+++ b/src/demos/es2/shader/redsquare.fp
@@ -0,0 +1,16 @@
+
+#ifdef GL_ES
+ #define MEDIUMP mediump
+ #define HIGHP highp
+#else
+ #define MEDIUMP
+ #define HIGHP
+#endif
+
+varying HIGHP vec4 frontColor;
+
+void main (void)
+{
+ gl_FragColor = frontColor;
+}
+
diff --git a/src/demos/es2/shader/redsquare.vp b/src/demos/es2/shader/redsquare.vp
new file mode 100644
index 0000000..0348e90
--- /dev/null
+++ b/src/demos/es2/shader/redsquare.vp
@@ -0,0 +1,19 @@
+
+#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;
+varying HIGHP vec4 frontColor;
+
+void main(void)
+{
+ frontColor=mgl_Color;
+ gl_Position = mgl_PMVMatrix[0] * mgl_PMVMatrix[1] * mgl_Vertex;
+}
diff --git a/src/demos/es2/shader/scripts/nvidia-apx/glslc-ff.bat b/src/demos/es2/shader/scripts/nvidia-apx/glslc-ff.bat
new file mode 100755
index 0000000..024e469
--- /dev/null
+++ b/src/demos/es2/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 redsquare.vp redsquare.fp