From e61a2e43947cebaafe4c3725414d33e092bb6fad Mon Sep 17 00:00:00 2001 From: Omniscient Date: Fri, 17 May 2024 08:39:51 +1000 Subject: cube working --- assets/shaders/cube.vert | 9 +++++---- assets/shaders/triangle.frag | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'assets/shaders') 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); +} -- cgit v1.2.3-70-g09d2