Basic 3D rendering
This commit is contained in:
13
res/glsl/fragment.glsl
Normal file
13
res/glsl/fragment.glsl
Normal file
@@ -0,0 +1,13 @@
|
||||
#version 450 core
|
||||
|
||||
in vec3 textureCoord;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
uniform sampler2DArray textureSampler;
|
||||
|
||||
void main()
|
||||
{
|
||||
color = texture(textureSampler, textureCoord);
|
||||
if (color.w < 0.1) discard;
|
||||
}
|
||||
17
res/glsl/vertex.glsl
Normal file
17
res/glsl/vertex.glsl
Normal file
@@ -0,0 +1,17 @@
|
||||
#version 450 core
|
||||
|
||||
layout (location = 0) in vec3 position;
|
||||
layout (location = 1) in vec2 texCoord;
|
||||
layout (location = 2) in float texIndex;
|
||||
layout (location = 3) in mat4 theModelMatrix;
|
||||
|
||||
out vec3 textureCoord;
|
||||
|
||||
uniform mat4 theViewMatrix;
|
||||
uniform mat4 theProjMatrix;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = theProjMatrix * theViewMatrix * theModelMatrix * vec4(position, 1.0);
|
||||
textureCoord = vec3(1.0 - texCoord.x, 1.0 - texCoord.y, texIndex);
|
||||
}
|
||||
Reference in New Issue
Block a user