VERSIÓ 1.2.5
- [NEW] Soport bàsic per a shaders.
This commit is contained in:
32
data/basic.glsl
Normal file
32
data/basic.glsl
Normal file
@@ -0,0 +1,32 @@
|
||||
varying vec2 TEX0;
|
||||
|
||||
#if defined(VERTEX)
|
||||
|
||||
void main()
|
||||
{
|
||||
TEX0 = vec2(gl_MultiTexCoord0.x, 1.0-gl_MultiTexCoord0.y)*1.0001;
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
}
|
||||
|
||||
#elif defined(FRAGMENT)
|
||||
|
||||
uniform sampler2D Texture;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 winsize = vec2(640.0,480.0);
|
||||
vec2 pixpos = TEX0 * winsize;
|
||||
float y = floor(pixpos.y);
|
||||
if (mod(y,4.0) == 0.0)
|
||||
{
|
||||
vec4 color = texture2D(Texture, TEX0);
|
||||
vec4 blend = vec4(0.8, 0.8, 0.8, 1.0);
|
||||
gl_FragColor = color * blend;
|
||||
}
|
||||
else
|
||||
{
|
||||
gl_FragColor = texture2D(Texture, TEX0);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user