Created
August 10, 2013 21:39
-
-
Save Themaister/6202258 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if defined(VERTEX) | |
#if __VERSION__ >= 130 | |
#define COMPAT_varying out | |
#define COMPAT_attribute in | |
#else | |
#define COMPAT_varying varying | |
#define COMPAT_attribute attribute | |
#endif | |
#ifdef GL_ES | |
#define COMPAT_PRECISION mediump | |
#else | |
#define COMPAT_PRECISION | |
#endif | |
COMPAT_varying float _frame_rotation; | |
COMPAT_varying vec4 _color1; | |
struct output_dummy { | |
vec4 _color1; | |
}; | |
struct input_dummy { | |
vec2 _video_size; | |
vec2 _texture_size; | |
vec2 _output_dummy_size; | |
float _frame_count; | |
float _frame_direction; | |
float _frame_rotation; | |
}; | |
vec4 _oPosition1; | |
vec4 _r0005; | |
COMPAT_attribute vec4 VertexCoord; | |
COMPAT_attribute vec4 COLOR; | |
COMPAT_attribute vec4 TexCoord; | |
COMPAT_varying vec4 COL0; | |
COMPAT_varying vec4 TEX0; | |
uniform mat4 MVPMatrix; | |
uniform int FrameDirection; | |
uniform int FrameCount; | |
uniform COMPAT_PRECISION vec2 OutputSize; | |
uniform COMPAT_PRECISION vec2 TextureSize; | |
uniform COMPAT_PRECISION vec2 InputSize; | |
void main() | |
{ | |
vec4 _oColor; | |
vec2 _otexCoord; | |
_r0005 = VertexCoord.x*MVPMatrix[0]; | |
_r0005 = _r0005 + VertexCoord.y*MVPMatrix[1]; | |
_r0005 = _r0005 + VertexCoord.z*MVPMatrix[2]; | |
_r0005 = _r0005 + VertexCoord.w*MVPMatrix[3]; | |
_oPosition1 = _r0005; | |
_oColor = COLOR; | |
_otexCoord = TexCoord.xy; | |
gl_Position = _r0005; | |
COL0 = COLOR; | |
TEX0.xy = TexCoord.xy; | |
} | |
#elif defined(FRAGMENT) | |
#if __VERSION__ >= 130 | |
#define COMPAT_varying in | |
out vec4 FragColor; | |
#else | |
#define COMPAT_varying varying | |
#define FragColor gl_FragColor | |
#endif | |
#ifdef GL_ES | |
#ifdef GL_FRAGMENT_PRECISION_HIGH | |
precision highp float; | |
#else | |
precision mediump float; | |
#endif | |
#define COMPAT_PRECISION mediump | |
#else | |
#define COMPAT_PRECISION | |
#endif | |
COMPAT_varying float _frame_rotation; | |
COMPAT_varying vec4 _color; | |
struct output_dummy { | |
vec4 _color; | |
}; | |
struct input_dummy { | |
vec2 _video_size; | |
vec2 _texture_size; | |
vec2 _output_dummy_size; | |
float _frame_count; | |
float _frame_direction; | |
float _frame_rotation; | |
}; | |
uniform sampler2D Texture; | |
COMPAT_varying vec4 TEX0; | |
uniform int FrameDirection; | |
uniform int FrameCount; | |
uniform COMPAT_PRECISION vec2 OutputSize; | |
uniform COMPAT_PRECISION vec2 TextureSize; | |
uniform COMPAT_PRECISION vec2 InputSize; | |
void main() | |
{ | |
output_dummy _OUT; | |
_OUT._color = texture2D(Texture, TEX0.xy); | |
FragColor = _OUT._color; | |
return; | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment