model loading

This commit is contained in:
Mars 2024-10-11 20:04:28 -04:00
parent 02cd99a73a
commit 8285b60211
Signed by untrusted user: pupbrained
GPG key ID: 874E22DF2F9DFCB5
11 changed files with 19622 additions and 27 deletions

BIN
shaders/frag.spv Normal file

Binary file not shown.

12
shaders/shader.frag Normal file
View file

@ -0,0 +1,12 @@
#version 450
layout(binding = 1) uniform sampler2D texSampler;
layout(location = 0) in vec3 fragColor;
layout(location = 1) in vec2 fragTexCoord;
layout(location = 0) out vec4 outColor;
void main() {
outColor = texture(texSampler, fragTexCoord);
}

20
shaders/shader.vert Normal file
View file

@ -0,0 +1,20 @@
#version 450
layout(binding = 0) uniform UniformBufferObject {
mat4 model;
mat4 view;
mat4 proj;
} ubo;
layout(location = 0) in vec3 inPosition;
layout(location = 1) in vec3 inColor;
layout(location = 2) in vec2 inTexCoord;
layout(location = 0) out vec3 fragColor;
layout(location = 1) out vec2 fragTexCoord;
void main() {
gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 1.0);
fragColor = inColor;
fragTexCoord = inTexCoord;
}

7
shaders/shaderc Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env sh
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR" || exit
glslc -c ./shader.vert -o ./vert.spv
glslc -c ./shader.frag -o ./frag.spv

BIN
shaders/vert.spv Normal file

Binary file not shown.