Entire project
This commit is contained in:
commit
cca31e22c6
115 changed files with 2484 additions and 0 deletions
13
res/shaders/s2a/frag.gls
Normal file
13
res/shaders/s2a/frag.gls
Normal file
|
@ -0,0 +1,13 @@
|
|||
#version 330 core
|
||||
|
||||
uniform sampler2D sampler;
|
||||
|
||||
in vec2 texCoords;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
void main() {
|
||||
color = texture(sampler, texCoords);
|
||||
if(color.a == 0)
|
||||
discard;
|
||||
}
|
15
res/shaders/s2a/vert.gls
Normal file
15
res/shaders/s2a/vert.gls
Normal file
|
@ -0,0 +1,15 @@
|
|||
#version 330 core
|
||||
|
||||
uniform mat4 mvp;
|
||||
|
||||
uniform vec2 animProps; // Loc 0 - Frame Width, Loc 1 - Offset
|
||||
|
||||
layout (location = 0) in vec3 vertices;
|
||||
layout (location = 1) in vec2 iTexCoords;
|
||||
|
||||
out vec2 texCoords;
|
||||
|
||||
void main() {
|
||||
texCoords = vec2(((iTexCoords.x * animProps.x) + animProps.y), iTexCoords.y);
|
||||
gl_Position = mvp * vec4(vertices, 1.0);
|
||||
}
|
9
res/shaders/s2c/frag.gls
Normal file
9
res/shaders/s2c/frag.gls
Normal file
|
@ -0,0 +1,9 @@
|
|||
#version 330 core
|
||||
|
||||
uniform vec4 iColor = vec4(0, 0.6, 0.9, 1);
|
||||
|
||||
out vec4 color;
|
||||
|
||||
void main() {
|
||||
color = iColor;
|
||||
}
|
9
res/shaders/s2c/vert.gls
Normal file
9
res/shaders/s2c/vert.gls
Normal file
|
@ -0,0 +1,9 @@
|
|||
#version 330 core
|
||||
|
||||
uniform mat4 mvp;
|
||||
|
||||
layout (location = 0) in vec3 vertices;
|
||||
|
||||
void main() {
|
||||
gl_Position = mvp * vec4(vertices, 1);
|
||||
}
|
46
res/shaders/s2le/frag.gls
Normal file
46
res/shaders/s2le/frag.gls
Normal file
|
@ -0,0 +1,46 @@
|
|||
#version 330 core
|
||||
|
||||
uniform sampler2D sampler;
|
||||
|
||||
uniform vec4 color1 = vec4(0, 1, 1, 1);
|
||||
uniform vec4 color2 = vec4(0, 0, 1, 1);
|
||||
uniform float time = 0, freq = 1;
|
||||
uniform bool rgb = true, loop = false, textured = false;
|
||||
|
||||
in vec2 iTexCoords;
|
||||
in float percent;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
vec4 hsvToRgb(vec4 hsva);
|
||||
|
||||
void main() {
|
||||
vec4 tcolor;
|
||||
if(textured)
|
||||
tcolor = texture(sampler, iTexCoords);
|
||||
if(!textured || tcolor.xyz == vec3(1, 1, 1)) {
|
||||
float finalPercent = mod((percent + time) * freq, 1);
|
||||
if(loop) {
|
||||
if(finalPercent > 0.5)
|
||||
finalPercent = 1 - finalPercent;
|
||||
finalPercent *= 2;
|
||||
}
|
||||
vec4 interpolated = color1 + (color2 - color1) * finalPercent;
|
||||
if(rgb)
|
||||
color = interpolated;
|
||||
else
|
||||
color = hsvToRgb(interpolated);
|
||||
if(textured)
|
||||
color.w = texture(sampler, iTexCoords).w;
|
||||
}
|
||||
else if(tcolor.w != 0)
|
||||
color = tcolor;
|
||||
else
|
||||
discard;
|
||||
}
|
||||
|
||||
vec4 hsvToRgb(vec4 c) {
|
||||
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||
return vec4(c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y), c.w);
|
||||
}
|
16
res/shaders/s2le/vert.gls
Normal file
16
res/shaders/s2le/vert.gls
Normal file
|
@ -0,0 +1,16 @@
|
|||
#version 330 core
|
||||
|
||||
uniform mat4 mvp;
|
||||
|
||||
layout (location = 0) in vec3 vertices;
|
||||
layout (location = 1) in vec2 texCoords;
|
||||
|
||||
out vec2 iTexCoords;
|
||||
out float percent;
|
||||
|
||||
void main() {
|
||||
iTexCoords = texCoords;
|
||||
vec4 position = mvp * vec4(vertices, 1);
|
||||
percent = (position.x + 1) / 4 - (position.y - 1) / 4;
|
||||
gl_Position = position;
|
||||
}
|
11
res/shaders/s2t/frag.gls
Normal file
11
res/shaders/s2t/frag.gls
Normal file
|
@ -0,0 +1,11 @@
|
|||
#version 330 core
|
||||
|
||||
uniform sampler2D sampler;
|
||||
|
||||
in vec2 texCoords;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
void main() {
|
||||
color = texture(sampler, texCoords);
|
||||
}
|
13
res/shaders/s2t/vert.gls
Normal file
13
res/shaders/s2t/vert.gls
Normal file
|
@ -0,0 +1,13 @@
|
|||
#version 330 core
|
||||
|
||||
uniform mat4 mvp;
|
||||
|
||||
layout (location = 0) in vec3 vertices;
|
||||
layout (location = 1) in vec2 itexCoords;
|
||||
|
||||
out vec2 texCoords;
|
||||
|
||||
void main() {
|
||||
texCoords = itexCoords;
|
||||
gl_Position = mvp * vec4(vertices, 1);
|
||||
}
|
15
res/shaders/s2x/frag.gls
Normal file
15
res/shaders/s2x/frag.gls
Normal file
|
@ -0,0 +1,15 @@
|
|||
#version 330 core
|
||||
|
||||
uniform vec4 iColor;
|
||||
|
||||
uniform sampler2D sampler;
|
||||
|
||||
in vec2 texCoords;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
void main() {
|
||||
color = iColor * texture(sampler, texCoords);
|
||||
if(color.a == 0)
|
||||
discard;
|
||||
}
|
15
res/shaders/s2x/vert.gls
Normal file
15
res/shaders/s2x/vert.gls
Normal file
|
@ -0,0 +1,15 @@
|
|||
#version 330 core
|
||||
|
||||
uniform mat4 mvp;
|
||||
|
||||
uniform vec2 character;
|
||||
|
||||
layout (location = 0) in vec3 vertices;
|
||||
layout (location = 1) in vec2 iTexCoords;
|
||||
|
||||
out vec2 texCoords;
|
||||
|
||||
void main() {
|
||||
texCoords = iTexCoords + character;
|
||||
gl_Position = mvp * vec4(vertices, 1.0);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue