summaryrefslogtreecommitdiffhomepage
path: root/src/shaders
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2022-11-25 17:36:37 -0500
committerrealtradam <[email protected]>2022-11-25 17:36:37 -0500
commit62de63a0d26ece5c0dc2cd48c0a41d35de1e38d4 (patch)
treeb91117aabf53eb1dec0b8dc0d34c7656872f71e8 /src/shaders
parent4e7226ad1b081982e5cbed349edca1c5b0e1b779 (diff)
downloadOgle-62de63a0d26ece5c0dc2cd48c0a41d35de1e38d4.tar.gz
Ogle-62de63a0d26ece5c0dc2cd48c0a41d35de1e38d4.zip
cleanup code
Diffstat (limited to 'src/shaders')
-rw-r--r--src/shaders/default.frag18
-rw-r--r--src/shaders/default.vert4
2 files changed, 10 insertions, 12 deletions
diff --git a/src/shaders/default.frag b/src/shaders/default.frag
index 2176a7d..6038bb1 100644
--- a/src/shaders/default.frag
+++ b/src/shaders/default.frag
@@ -1,4 +1,5 @@
#version 330 core
+
out vec4 FragColor;
in vec4 v_Color;
@@ -9,14 +10,13 @@ uniform sampler2D texture_1;
void main()
{
- FragColor = texture(texture_1, v_TexCoord) * v_Color;
- //if(v_TexId > 0)
- //{
- // FragColor = texture(texture_1, v_TexCoord) * v_Color;
- //}
- //else
- //{
- // FragColor = v_Color;
- //}
+ if(v_TexId > 0)
+ {
+ FragColor = texture(texture_1, v_TexCoord) * v_Color;
+ }
+ else
+ {
+ FragColor = v_Color;
+ }
}
diff --git a/src/shaders/default.vert b/src/shaders/default.vert
index 404e583..6cab025 100644
--- a/src/shaders/default.vert
+++ b/src/shaders/default.vert
@@ -1,11 +1,10 @@
#version 330 core
+
layout (location = 0) in vec3 a_Pos;
layout (location = 1) in vec4 a_Color;
layout (location = 2) in vec2 a_TexCoord;
layout (location = 3) in float a_TexId;
-//uniform float offset_x;
-
out vec4 v_Color;
out vec2 v_TexCoord;
out float v_TexId;
@@ -15,7 +14,6 @@ uniform mat4 transform;
void main()
{
gl_Position = transform * vec4(a_Pos, 1.0);
- //gl_Position = vec4(a_Pos, 1.0);
v_Color = a_Color;
v_TexCoord = a_TexCoord;
v_TexId = a_TexId;