Shader first pass
This commit is contained in:
32
src/duskgl/display/shader/shaderunlitgl.c
Normal file
32
src/duskgl/display/shader/shaderunlitgl.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "display/shader/shaderunlit.h"
|
||||
|
||||
shaderdefinition_t SHADER_UNLIT_DEFINITION = {
|
||||
.vert =
|
||||
"#version 330 core\n"
|
||||
"layout(location = 0) in vec3 aPos;\n"
|
||||
"layout(location = 1) in vec2 aTexCoord;\n"
|
||||
"uniform mat4 u_Proj;\n"
|
||||
"uniform mat4 u_View;\n"
|
||||
"uniform mat4 u_Model;\n"
|
||||
"out vec2 v_TexCoord;\n"
|
||||
"void main() {\n"
|
||||
" gl_Position = u_Proj * u_View * u_Model * vec4(aPos, 1.0);\n"
|
||||
" v_TexCoord = aTexCoord;\n"
|
||||
"}\n",
|
||||
|
||||
.frag =
|
||||
"#version 330 core\n"
|
||||
"in vec2 v_TexCoord;\n"
|
||||
"out vec4 FragColor;\n"
|
||||
"uniform sampler2D u_Texture;\n"
|
||||
"void main() {\n"
|
||||
" FragColor = texture(u_Texture, v_TexCoord);\n"
|
||||
"}\n"
|
||||
};
|
||||
Reference in New Issue
Block a user