diff options
author | Sven Gothel <[email protected]> | 2012-10-31 15:16:56 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-10-31 15:16:56 +0100 |
commit | 7dff066bb823dddb5d6e0e7672f5599afa5a43b9 (patch) | |
tree | 1981fa4c69ae8c2037ed17af5d2987b8cf6b55b1 /src/jogl/classes/jogamp/opengl/shader | |
parent | c2b328ea96b6cb16ca39f13d4bb4d1236c4b8a1d (diff) |
Add OSX CALayer OpenGL 3 (core) support: Derive pixelformat from parent (GL3), use GL3.2 compatible shader; Use VBO in general.
Covered by:
Auto unit tests: TestOffscreenLayer01GLCanvasAWT, TestOffscreenLayer02NewtCanvasAWT
Manual: TestGearsES2AWT '-gl3 -layered'
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/shader')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/shader/texture01_xxx.fp | 19 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/shader/texture01_xxx.vp | 19 |
2 files changed, 38 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/shader/texture01_xxx.fp b/src/jogl/classes/jogamp/opengl/shader/texture01_xxx.fp new file mode 100644 index 000000000..8b30b65f9 --- /dev/null +++ b/src/jogl/classes/jogamp/opengl/shader/texture01_xxx.fp @@ -0,0 +1,19 @@ +// Copyright 2012 JogAmp Community. All rights reserved. + +#if __VERSION__ >= 130 + #define varying in + out vec4 mgl_FragColor; + #define texture2D texture +#else + #define mgl_FragColor gl_FragColor +#endif + +varying vec2 mgl_texCoord; + +uniform sampler2D mgl_Texture0; + +void main (void) +{ + mgl_FragColor = texture2D(mgl_Texture0, mgl_texCoord); +} + diff --git a/src/jogl/classes/jogamp/opengl/shader/texture01_xxx.vp b/src/jogl/classes/jogamp/opengl/shader/texture01_xxx.vp new file mode 100644 index 000000000..d9ef6b493 --- /dev/null +++ b/src/jogl/classes/jogamp/opengl/shader/texture01_xxx.vp @@ -0,0 +1,19 @@ +// Copyright 2012 JogAmp Community. All rights reserved. + +#if __VERSION__ >= 130 + #define attribute in + #define varying out +#endif + +uniform mat4 mgl_PMVMatrix[2]; + +attribute vec4 mgl_Vertex; +attribute vec4 mgl_MultiTexCoord; + +varying vec2 mgl_texCoord; + +void main(void) +{ + mgl_texCoord = mgl_MultiTexCoord.st; + gl_Position = mgl_PMVMatrix[0] * mgl_PMVMatrix[1] * mgl_Vertex; +} |