summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorOmniscient <omniscient.oce@gmail.com>2024-05-17 08:39:51 +1000
committerOmniscient <omniscient.oce@gmail.com>2024-05-17 08:39:51 +1000
commite61a2e43947cebaafe4c3725414d33e092bb6fad (patch)
tree84f2e52a1eb62ec6b1957628307f59ad39a621af /assets
parent634f22e2b6d538fc5a45da2b1b23af631f6f8703 (diff)
cube working
Diffstat (limited to 'assets')
-rw-r--r--assets/shaders/cube.vert9
-rw-r--r--assets/shaders/triangle.frag4
2 files changed, 8 insertions, 5 deletions
diff --git a/assets/shaders/cube.vert b/assets/shaders/cube.vert
index 80ad854..1818c3c 100644
--- a/assets/shaders/cube.vert
+++ b/assets/shaders/cube.vert
@@ -7,12 +7,13 @@ layout(binding = 0) uniform UniformBufferObject {
}
ubo;
-layout(location = 0) in vec2 inPosition;
-layout(location = 1) in vec3 inColor;
+layout(location = 0) in vec3 inPosition;
+layout(location = 1) in vec3 inNormal;
+layout(location = 2) in vec3 inTexCoords;
layout(location = 0) out vec3 fragColor;
void main() {
- gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 0.0, 1.0);
- fragColor = inColor;
+ gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 1.0);
+ fragColor = abs(inNormal);
}
diff --git a/assets/shaders/triangle.frag b/assets/shaders/triangle.frag
index 2151162..a8c6e69 100644
--- a/assets/shaders/triangle.frag
+++ b/assets/shaders/triangle.frag
@@ -3,4 +3,6 @@
layout(location = 0) in vec3 fragColor;
layout(location = 0) out vec4 outColor;
-void main() { outColor = vec4(fragColor, 1.0); } \ No newline at end of file
+void main() {
+ outColor = vec4(fragColor, 0.0);
+}