added barebones ui rendering
This commit is contained in:
16
Shaders/ui.frag
Normal file
16
Shaders/ui.frag
Normal file
@@ -0,0 +1,16 @@
|
||||
#version 440 core
|
||||
|
||||
in vec2 TexCoord;
|
||||
in vec4 Color;
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
uniform sampler2D uTexture; // Ensure this name matches C# exactly
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 texColor = texture(uTexture, TexCoord);
|
||||
|
||||
// If you don't use texColor, uTexture gets deleted by the compiler
|
||||
FragColor = texColor * Color;
|
||||
}
|
||||
18
Shaders/ui.vert
Normal file
18
Shaders/ui.vert
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 440 core
|
||||
|
||||
layout (location = 0) in vec2 aPos;
|
||||
layout (location = 1) in vec2 aTexCoord;
|
||||
layout (location = 2) in vec4 aColor;
|
||||
|
||||
out vec2 TexCoord;
|
||||
out vec4 Color;
|
||||
|
||||
uniform mat4 projection; // Ensure this name matches C# exactly
|
||||
|
||||
void main()
|
||||
{
|
||||
// If you don't multiply by projection, the compiler deletes the uniform
|
||||
gl_Position = projection * vec4(aPos, 0.0, 1.0);
|
||||
TexCoord = aTexCoord;
|
||||
Color = aColor;
|
||||
}
|
||||
Reference in New Issue
Block a user