From 2eb22f8debec811cdea32ed7b8cf3ec98c752f7c Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Thu, 14 Sep 2023 19:24:43 -0400 Subject: Load model textures checkpoint. Refactors some Vulkan items related to CompGrBinds and EntityTypes. Adds some Vulkan globals related to textures. Adds a number of placeholder items: - Iffy use of setting Vulkan globals on instanced structs. - Unimplemented and inaccurate shaders - Iffy gltf sub-buffer logic (ignores vertex color data) - MipMap TODOs - TextureArray TODOs --- assets/shaders/vert.vert | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 assets/shaders/vert.vert (limited to 'assets/shaders/vert.vert') diff --git a/assets/shaders/vert.vert b/assets/shaders/vert.vert new file mode 100644 index 0000000..f3e7cf2 --- /dev/null +++ b/assets/shaders/vert.vert @@ -0,0 +1,32 @@ +#version 450 + +layout(binding = 0) uniform UniformBufferObject { + mat4 model; + mat4 view; + mat4 proj; +} ubo; + +// vertex +layout(location = 0) in vec4 inColor; +layout(location = 1) in vec3 inPosition; +layout(location = 2) in vec3 inNorm; +layout(location = 3) in vec2 inTexCoord; + +// instance +layout(location = 4) in mat4 instPosRotScale; +layout(location = 8) in float textureIndex; + +// output +layout(location = 0) out vec3 fragColor; +layout(location = 1) out vec3 fragTexCoord; + +void main() { + gl_Position = + ubo.proj * + ubo.view * + ubo.model * + instPosRotScale * + vec4(inPosition, 1.0); + fragColor = inColor; + fragTexCoord = vec3(inTexCoord, textureIndex); +} -- cgit v1.2.3