Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro Assets
glsl-shaders
Commits
dc9900a3
Commit
dc9900a3
authored
Aug 01, 2015
by
hunterk
Browse files
add stock shader, which is needed by some other shaders
parent
ba54514c
Changes
1
Hide whitespace changes
Inline
Side-by-side
stock.glsl
0 → 100644
View file @
dc9900a3
#if defined(VERTEX)
#if __VERSION__ >= 130
#define COMPAT_VARYING out
#define COMPAT_ATTRIBUTE in
#define COMPAT_TEXTURE texture
#else
#define COMPAT_VARYING varying
#define COMPAT_ATTRIBUTE attribute
#define COMPAT_TEXTURE texture2D
#endif
#ifdef GL_ES
#define COMPAT_PRECISION mediump
#else
#define COMPAT_PRECISION
#endif
COMPAT_ATTRIBUTE
vec4
VertexCoord
;
COMPAT_ATTRIBUTE
vec4
COLOR
;
COMPAT_ATTRIBUTE
vec4
TexCoord
;
COMPAT_VARYING
vec4
COL0
;
COMPAT_VARYING
vec4
TEX0
;
vec4
_oPosition1
;
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
;
gl_Position
=
VertexCoord
.
x
*
MVPMatrix
[
0
]
+
VertexCoord
.
y
*
MVPMatrix
[
1
]
+
VertexCoord
.
z
*
MVPMatrix
[
2
]
+
VertexCoord
.
w
*
MVPMatrix
[
3
];
_oPosition1
=
gl_Position
;
_oColor
=
COLOR
;
_otexCoord
=
TexCoord
.
xy
;
COL0
=
COLOR
;
TEX0
.
xy
=
TexCoord
.
xy
;
}
#elif defined(FRAGMENT)
#if __VERSION__ >= 130
#define COMPAT_VARYING in
#define COMPAT_TEXTURE texture
out
vec4
FragColor
;
#else
#define COMPAT_VARYING varying
#define FragColor gl_FragColor
#define COMPAT_TEXTURE texture2D
#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
struct
output_dummy
{
vec4
_color
;
};
uniform
int
FrameDirection
;
uniform
int
FrameCount
;
uniform
COMPAT_PRECISION
vec2
OutputSize
;
uniform
COMPAT_PRECISION
vec2
TextureSize
;
uniform
COMPAT_PRECISION
vec2
InputSize
;
uniform
sampler2D
Texture
;
COMPAT_VARYING
vec4
TEX0
;
//standard texture sample looks like this: COMPAT_TEXTURE(Texture, TEX0.xy);
void
main
()
{
output_dummy
_OUT
;
_OUT
.
_color
=
COMPAT_TEXTURE
(
Texture
,
TEX0
.
xy
);
FragColor
=
_OUT
.
_color
;
return
;
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment