what done?

This commit is contained in:
=
2016-09-27 15:43:48 +02:00
parent 9d0401496f
commit 8218977825
1443 changed files with 93549 additions and 0 deletions

View File

@ -0,0 +1,29 @@
precision mediump float;
uniform sampler2D texture;
uniform float alpha;
uniform vec2 texAtlasSize;
uniform float texAtlasIndex;
varying vec2 pass_TexCoords;
vec2 getTexCoordsInAtlas(in float atlasIndex);
void main() {
vec2 texAtlasCoords = getTexCoordsInAtlas(texAtlasIndex);
gl_FragColor = texture2D(texture, texAtlasCoords);
gl_FragColor.a = min(gl_FragColor.a, alpha);
}
vec2 getTexCoordsInAtlas(in float atlasIndex){
vec2 texAtlasCoords = vec2(0.0, 0.0);
texAtlasCoords.x = mod(pass_TexCoords.x, 1.0) / texAtlasSize.x;
texAtlasCoords.x += mod(atlasIndex, texAtlasSize.x) / texAtlasSize.x;
texAtlasCoords.y = mod(pass_TexCoords.y, 1.0) / texAtlasSize.y;
texAtlasCoords.y += floor(atlasIndex / texAtlasSize.y) / texAtlasSize.y;
return texAtlasCoords;
}

View File

@ -0,0 +1,15 @@
uniform mat4 mvpMatrix;
uniform mat4 transformationMatrix;
attribute vec4 position;
attribute vec2 texCoords;
varying vec2 pass_TexCoords;
void main() {
vec4 transformatedPosition = transformationMatrix * position;
gl_Position = mvpMatrix * transformatedPosition;
pass_TexCoords = texCoords;
}

View File

@ -0,0 +1,13 @@
precision mediump float;
uniform sampler2D texture;
uniform vec3 color;
varying vec2 pass_TexCoords;
void main() {
gl_FragColor.a = texture2D(texture, pass_TexCoords).a;
gl_FragColor.rgb = color;
}

View File

@ -0,0 +1,11 @@
precision mediump float;
uniform sampler2D texture;
varying vec2 pass_TexCoords;
void main() {
gl_FragColor = texture2D(texture, pass_TexCoords);
}

View File

@ -0,0 +1,12 @@
attribute vec4 position;
attribute vec2 texCoords;
varying vec2 pass_TexCoords;
void main() {
gl_Position = position;
pass_TexCoords.x = texCoords.x;
pass_TexCoords.y = -texCoords.y;
}

View File

@ -0,0 +1,18 @@
uniform mat4 mvpMatrix;
uniform mat4 transformationMatrix;
attribute vec4 position;
attribute vec2 texCoords;
varying vec2 pass_TexCoords;
void main() {
vec4 transformatedPosition = transformationMatrix * position;
gl_Position = mvpMatrix * transformatedPosition;
pass_TexCoords = (transformationMatrix * vec4(texCoords, 0.0, 0.0)).xy;
pass_TexCoords *= vec2(3.0, 3.0);
pass_TexCoords.y = clamp(pass_TexCoords.y, 0.0, 1.0) + 0.01;
}