From 64830ce51a185091f54c2b42b365110d89d44f1b Mon Sep 17 00:00:00 2001 From: Omniscient Date: Sun, 9 Jun 2024 11:42:17 +1000 Subject: triangle on opengl works again. happy days --- assets/shaders/cube.frag | 3 ++- assets/shaders/cube.vert | 3 ++- assets/shaders/triangle.frag | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'assets') diff --git a/assets/shaders/cube.frag b/assets/shaders/cube.frag index 88ba822..796f1c8 100644 --- a/assets/shaders/cube.frag +++ b/assets/shaders/cube.frag @@ -8,5 +8,6 @@ layout(binding = 1) uniform sampler2D texSampler; layout(location = 0) out vec4 outColor; void main() { - outColor = texture(texSampler, fragTexCoord); // vec4(fragTexCoord, 0.0); + // outColor = texture(texSampler, fragTexCoord); // vec4(fragTexCoord, 0.0); + outColor = vec4(1.0); } diff --git a/assets/shaders/cube.vert b/assets/shaders/cube.vert index 2f1d76d..57475e7 100644 --- a/assets/shaders/cube.vert +++ b/assets/shaders/cube.vert @@ -1,6 +1,6 @@ #version 430 -layout(binding = 0) uniform UniformBufferObject { +layout(binding = 0) uniform Matrices { mat4 model; mat4 view; mat4 proj; @@ -15,6 +15,7 @@ layout(location = 1) out vec2 fragTexCoord; void main() { gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 1.0); + // gl_Position = vec4(inPosition, 1.0); fragColor = abs(inNormal); fragTexCoord = inTexCoords; } diff --git a/assets/shaders/triangle.frag b/assets/shaders/triangle.frag index c3ff328..ad6de8e 100644 --- a/assets/shaders/triangle.frag +++ b/assets/shaders/triangle.frag @@ -1,4 +1,4 @@ -#version 450 +#version 430 layout(location = 0) in vec3 fragColor; layout(location = 0) out vec4 outColor; -- cgit v1.2.3-70-g09d2