Initial commit
This commit is contained in:
13
engines/myst3/shaders/myst3_box.fragment
Normal file
13
engines/myst3/shaders/myst3_box.fragment
Normal file
@@ -0,0 +1,13 @@
|
||||
in vec2 Texcoord;
|
||||
|
||||
OUTPUT
|
||||
|
||||
uniform UBOOL textured;
|
||||
uniform vec4 color;
|
||||
uniform sampler2D tex;
|
||||
|
||||
void main() {
|
||||
outColor = color;
|
||||
if (UBOOL_TEST(textured))
|
||||
outColor = outColor * texture(tex, Texcoord);
|
||||
}
|
||||
25
engines/myst3/shaders/myst3_box.vertex
Normal file
25
engines/myst3/shaders/myst3_box.vertex
Normal file
@@ -0,0 +1,25 @@
|
||||
in vec2 position;
|
||||
in vec2 texcoord;
|
||||
|
||||
uniform vec2 texOffsetXY;
|
||||
uniform vec2 texSizeWH;
|
||||
uniform vec2 verOffsetXY;
|
||||
uniform vec2 verSizeWH;
|
||||
uniform UBOOL flipY;
|
||||
|
||||
out vec2 Texcoord;
|
||||
|
||||
void main() {
|
||||
Texcoord = texOffsetXY + texcoord * texSizeWH;
|
||||
|
||||
// Coordinates are [0.0;1.0], transform to [-1.0; 1.0]
|
||||
vec2 pos = verOffsetXY + position * verSizeWH;
|
||||
pos.x = pos.x * 2.0 - 1.0;
|
||||
pos.y = -1.0 * (pos.y * 2.0 - 1.0);
|
||||
|
||||
if (UBOOL_TEST(flipY)) {
|
||||
pos.y *= -1.0;
|
||||
}
|
||||
|
||||
gl_Position = vec4(pos, 0.0, 1.0);
|
||||
}
|
||||
9
engines/myst3/shaders/myst3_cube.fragment
Normal file
9
engines/myst3/shaders/myst3_cube.fragment
Normal file
@@ -0,0 +1,9 @@
|
||||
in vec2 Texcoord;
|
||||
|
||||
OUTPUT
|
||||
|
||||
uniform sampler2D tex;
|
||||
|
||||
void main() {
|
||||
outColor = texture(tex, Texcoord);
|
||||
}
|
||||
13
engines/myst3/shaders/myst3_cube.vertex
Normal file
13
engines/myst3/shaders/myst3_cube.vertex
Normal file
@@ -0,0 +1,13 @@
|
||||
in vec3 position;
|
||||
in vec2 texcoord;
|
||||
|
||||
uniform float texScale;
|
||||
uniform mat4 mvpMatrix;
|
||||
|
||||
out vec2 Texcoord;
|
||||
|
||||
void main() {
|
||||
Texcoord = texcoord * texScale;
|
||||
|
||||
gl_Position = mvpMatrix * vec4(position, 1.0);
|
||||
}
|
||||
9
engines/myst3/shaders/myst3_text.fragment
Normal file
9
engines/myst3/shaders/myst3_text.fragment
Normal file
@@ -0,0 +1,9 @@
|
||||
in vec2 Texcoord;
|
||||
|
||||
OUTPUT
|
||||
|
||||
uniform sampler2D tex;
|
||||
|
||||
void main() {
|
||||
outColor = texture(tex, Texcoord);
|
||||
}
|
||||
15
engines/myst3/shaders/myst3_text.vertex
Normal file
15
engines/myst3/shaders/myst3_text.vertex
Normal file
@@ -0,0 +1,15 @@
|
||||
in vec2 position;
|
||||
in vec2 texcoord;
|
||||
|
||||
out vec2 Texcoord;
|
||||
|
||||
void main() {
|
||||
Texcoord = texcoord;
|
||||
|
||||
// Coordinates are [0.0;1.0], transform to [-1.0; 1.0]
|
||||
vec2 pos = position;
|
||||
pos.x = pos.x * 2.0 - 1.0;
|
||||
pos.y = -1.0 * (pos.y * 2.0 - 1.0);
|
||||
|
||||
gl_Position = vec4(pos, 0.0, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user