Initial commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#version 130
|
||||
out vec4 FragColor;
|
||||
|
||||
in vec3 color;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = vec4(color, 1.0f);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#version 130
|
||||
in vec3 aPos;
|
||||
in vec3 aColor;
|
||||
|
||||
out vec3 color;
|
||||
|
||||
uniform mat4 model;
|
||||
uniform mat4 view;
|
||||
uniform mat4 projection;
|
||||
|
||||
void main()
|
||||
{
|
||||
// Vclip = Mprojection ⋅ Mview ⋅ Mmodel ⋅ Vlocal
|
||||
gl_Position = projection * view * model * vec4(aPos, 1.0);
|
||||
color = aColor;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#version 130
|
||||
in vec2 textCoord;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
uniform vec3 color;
|
||||
uniform sampler2D texture1;
|
||||
|
||||
void main()
|
||||
{
|
||||
// Sample sets the alpha channel to either 0 / 1
|
||||
vec4 sampled = vec4(1.0f, 1.0f, 1.0f, texture(texture1, textCoord).r);
|
||||
fragColor = vec4(color, 1.0f) * sampled;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#version 130
|
||||
in vec4 postex; // <vec2 position, vec2 texture>
|
||||
|
||||
out vec2 textCoord;
|
||||
|
||||
uniform mat4 projection;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection * vec4(postex.xy, 0.0f, 1.0f);
|
||||
textCoord = postex.zw;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#version 130
|
||||
in vec2 textCoord;
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
uniform vec4 color;
|
||||
uniform sampler2D texture1;
|
||||
|
||||
void main()
|
||||
{
|
||||
// FragColor = color;
|
||||
FragColor = texture(texture1, textCoord) * color;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#version 130
|
||||
in vec3 aPos;
|
||||
in vec2 aTextCoord;
|
||||
|
||||
out vec2 textCoord;
|
||||
|
||||
uniform mat4 model;
|
||||
uniform mat4 view;
|
||||
uniform mat4 projection;
|
||||
|
||||
void main()
|
||||
{
|
||||
// Vclip = Mprojection ⋅ Mview ⋅ Mmodel ⋅ Vlocal
|
||||
gl_Position = projection * view * model * vec4(aPos, 1.0);
|
||||
textCoord = aTextCoord;
|
||||
}
|
||||
Reference in New Issue
Block a user