diff --git a/openVulkanoCpp/Scene/Texture.hpp b/openVulkanoCpp/Scene/Texture.hpp index 205f26c..5e08449 100644 --- a/openVulkanoCpp/Scene/Texture.hpp +++ b/openVulkanoCpp/Scene/Texture.hpp @@ -32,7 +32,7 @@ namespace OpenVulkano::Scene - void MakePlaceholder(uint32_t width = 128, uint32_t height = 128, + void MakePlaceholder(uint32_t width = 32, uint32_t height = 32, Math::Vector4uc color1 = {255, 135, 255, 255}, Math::Vector4uc color2 = {255, 225, 255, 255}); }; } \ No newline at end of file diff --git a/openVulkanoCpp/Shader/Shaders.c b/openVulkanoCpp/Shader/Shaders.c index 10c4071..4795fcc 100644 --- a/openVulkanoCpp/Shader/Shaders.c +++ b/openVulkanoCpp/Shader/Shaders.c @@ -297,9 +297,9 @@ const unsigned char basic_frag_spv[376] = { }; /* Contents of file basicTexture.frag.spv */ -const long int basicTexture_frag_spv_size = 632; -const unsigned char basicTexture_frag_spv[632] = { - 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x16, 0x00, 0x00, 0x00, +const long int basicTexture_frag_spv_size = 668; +const unsigned char basicTexture_frag_spv[668] = { + 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4C, 0x53, 0x4C, 0x2E, 0x73, 0x74, 0x64, 0x2E, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, @@ -337,21 +337,23 @@ const unsigned char basicTexture_frag_spv[632] = { 0x3D, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, - 0x12, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, - 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00 + 0x12, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x15, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x13, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x17, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00 }; /* Contents of file basic.vert.spv */ -const long int basic_vert_spv_size = 2996; -const unsigned char basic_vert_spv[2996] = { - 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x63, 0x00, 0x00, 0x00, +const long int basic_vert_spv_size = 2972; +const unsigned char basic_vert_spv[2972] = { + 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4C, 0x53, 0x4C, 0x2E, 0x73, 0x74, 0x64, 0x2E, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, - 0x3C, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, - 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x3C, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0xC2, 0x01, 0x00, 0x00, 0x04, 0x00, 0x09, 0x00, 0x47, 0x4C, 0x5F, 0x41, 0x52, 0x42, 0x5F, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x5F, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5F, 0x6F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x73, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, @@ -381,12 +383,12 @@ const unsigned char basic_vert_spv[2996] = { 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x54, 0x00, 0x00, 0x00, 0x63, 0x61, 0x6D, 0x00, - 0x05, 0x00, 0x08, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x66, 0x72, 0x61, 0x67, 0x54, 0x65, 0x78, 0x74, + 0x05, 0x00, 0x08, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x66, 0x72, 0x61, 0x67, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6F, 0x6F, 0x72, 0x64, 0x69, 0x6E, 0x61, 0x74, 0x65, 0x73, 0x00, 0x00, - 0x05, 0x00, 0x07, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, + 0x05, 0x00, 0x07, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6F, 0x6F, 0x72, 0x64, 0x69, 0x6E, 0x61, 0x74, 0x65, 0x73, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, - 0x61, 0x00, 0x00, 0x00, 0x74, 0x61, 0x6E, 0x67, 0x65, 0x6E, 0x74, 0x00, 0x05, 0x00, 0x05, 0x00, - 0x62, 0x00, 0x00, 0x00, 0x62, 0x69, 0x54, 0x61, 0x6E, 0x67, 0x65, 0x6E, 0x74, 0x00, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x74, 0x61, 0x6E, 0x67, 0x65, 0x6E, 0x74, 0x00, 0x05, 0x00, 0x05, 0x00, + 0x61, 0x00, 0x00, 0x00, 0x62, 0x69, 0x54, 0x61, 0x6E, 0x67, 0x65, 0x6E, 0x74, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -409,10 +411,10 @@ const unsigned char basic_vert_spv[2996] = { 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x52, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x62, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x60, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, @@ -451,12 +453,12 @@ const unsigned char basic_vert_spv[2996] = { 0x1E, 0x00, 0x03, 0x00, 0x52, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, - 0x5B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, - 0x5C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, - 0x5C, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, - 0x18, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, - 0x18, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, - 0x18, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, + 0x5A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x5B, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x5B, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, @@ -523,15 +525,13 @@ const unsigned char basic_vert_spv[2996] = { 0x54, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x91, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x00, 0x00, - 0x58, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x06, 0x00, - 0x0C, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, - 0x58, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x39, 0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, - 0x51, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x5A, 0x00, 0x00, 0x00, - 0x59, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, - 0x5E, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, - 0x5F, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x3E, 0x00, 0x03, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, - 0x38, 0x00, 0x01, 0x00 + 0x58, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, + 0x39, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x59, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, + 0x5A, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x5C, 0x00, 0x00, 0x00, + 0x5F, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00 }; /* Contents of file grid.frag.spv */ @@ -1162,8 +1162,8 @@ const TFileTableEntry fileTable[] = { {"background.frag.spv", background_frag_spv, 1076}, {"background.vert.spv", background_vert_spv, 2980}, {"basic.frag.spv", basic_frag_spv, 376}, - {"basicTexture.frag.spv", basicTexture_frag_spv, 632}, - {"basic.vert.spv", basic_vert_spv, 2996}, + {"basicTexture.frag.spv", basicTexture_frag_spv, 668}, + {"basic.vert.spv", basic_vert_spv, 2972}, {"grid.frag.spv", grid_frag_spv, 6472}, {"grid.vert.spv", grid_vert_spv, 3340} }; diff --git a/openVulkanoCpp/Shader/Shaders.h b/openVulkanoCpp/Shader/Shaders.h index 39bca66..ee1a6fa 100644 --- a/openVulkanoCpp/Shader/Shaders.h +++ b/openVulkanoCpp/Shader/Shaders.h @@ -16,11 +16,11 @@ extern const unsigned char basic_frag_spv[376]; /* Contents of file basicTexture.frag.spv */ extern const long int basicTexture_frag_spv_size; -extern const unsigned char basicTexture_frag_spv[632]; +extern const unsigned char basicTexture_frag_spv[668]; /* Contents of file basic.vert.spv */ extern const long int basic_vert_spv_size; -extern const unsigned char basic_vert_spv[2996]; +extern const unsigned char basic_vert_spv[2972]; /* Contents of file grid.frag.spv */ extern const long int grid_frag_spv_size; diff --git a/openVulkanoCpp/Shader/basic.vert b/openVulkanoCpp/Shader/basic.vert index 239eaff..1c952cb 100644 --- a/openVulkanoCpp/Shader/basic.vert +++ b/openVulkanoCpp/Shader/basic.vert @@ -21,11 +21,11 @@ layout(set = 1, binding = 0) uniform CameraData { void main() { - vec3 light = normalize(vec3(1)); + vec3 light = normalize(vec3(10)); vec4 worldPos = node.world * vec4(position, 1.0); vec3 worldNormal = normalize(transpose(inverse(mat3(node.world))) * normal); float brightness = max(0.0, dot(worldNormal, light)); outColor = vec4(clamp(color.rgb * (0.5 + brightness / 2), 0, 1), 1); - gl_Position = normalize(cam.viewProjection * worldPos); + gl_Position = cam.viewProjection * worldPos; fragTextureCoordinates = textureCoordinates.xy; } \ No newline at end of file diff --git a/openVulkanoCpp/Shader/basicTexture.frag b/openVulkanoCpp/Shader/basicTexture.frag index 6c4aac1..acf99a1 100644 --- a/openVulkanoCpp/Shader/basicTexture.frag +++ b/openVulkanoCpp/Shader/basicTexture.frag @@ -7,5 +7,5 @@ layout(set = 2, binding = 0) uniform sampler2D texSampler; void main() { - outColor = texture(texSampler, texCoord); + outColor = texture(texSampler, texCoord) * color; } \ No newline at end of file