Shader stuff.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#version 440
|
||||
|
||||
uniform mat4 MVP;
|
||||
uniform sampler2D texture0;
|
||||
|
||||
in VertexData {
|
||||
vec3 Position;
|
||||
vec3 Color;
|
||||
vec2 TextureCoord;
|
||||
} Input;
|
||||
|
||||
out vec4 FragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 texel = texture2D(texture0, Input.TextureCoord);
|
||||
FragmentColor = texel * vec4(Input.Color, 0);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#version 440
|
||||
|
||||
uniform mat4 MVP;
|
||||
|
||||
layout(location = 0) in vec3 Position;
|
||||
layout(location = 1) in vec3 Normal;
|
||||
layout(location = 2) in vec2 TextureCoord;
|
||||
|
||||
out VertexData {
|
||||
vec3 Position;
|
||||
vec3 Normal;
|
||||
vec2 TextureCoord;
|
||||
} Output;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = MVP * vec4(Position, 1.0);
|
||||
|
||||
Output.Position = Position;
|
||||
Output.Normal = Normal;
|
||||
Output.TextureCoord = TextureCoord;
|
||||
}
|
||||
Reference in New Issue
Block a user