From cb1f468b320ee756a51db29887cd46969d004887 Mon Sep 17 00:00:00 2001 From: Axel Gneiting Date: Sat, 30 Jul 2016 14:56:43 -0500 Subject: [PATCH] Add alpha test support Use specialization constants for different world pipeline modes (alpha_test/fullbright) --- Quake/Makefile | 1 - Quake/Makefile.w32 | 1 - Quake/Makefile.w64 | 1 - Quake/gl_rmisc.c | 48 ++++- Quake/glquake.h | 11 +- Quake/r_world.c | 56 +++--- Shaders/Compiled/world_frag.c | 189 ++++++++++++------- Shaders/Compiled/world_fullbright_frag.c | 128 ------------- Shaders/compile.bat | 2 - Shaders/shaders.h | 2 - Shaders/world.frag | 13 ++ Shaders/world_fullbright.frag | 19 -- Windows/VisualStudio/vkquake.vcxproj | 2 - Windows/VisualStudio/vkquake.vcxproj.filters | 6 - 14 files changed, 219 insertions(+), 260 deletions(-) delete mode 100644 Shaders/Compiled/world_fullbright_frag.c delete mode 100644 Shaders/world_fullbright.frag diff --git a/Quake/Makefile b/Quake/Makefile index 3d40edf68..a62a0778c 100644 --- a/Quake/Makefile +++ b/Quake/Makefile @@ -234,7 +234,6 @@ SHADER_OBJS = \ ../Shaders/Compiled/sky_layer_frag.c \ ../Shaders/Compiled/sky_layer_vert.c \ ../Shaders/Compiled/world_frag.c \ - ../Shaders/Compiled/world_fullbright_frag.c \ ../Shaders/Compiled/world_vert.c GLOBJS = \ diff --git a/Quake/Makefile.w32 b/Quake/Makefile.w32 index 934f76c40..750c30135 100644 --- a/Quake/Makefile.w32 +++ b/Quake/Makefile.w32 @@ -224,7 +224,6 @@ SHADER_OBJS = \ ../Shaders/Compiled/sky_layer_frag.c \ ../Shaders/Compiled/sky_layer_vert.c \ ../Shaders/Compiled/world_frag.c \ - ../Shaders/Compiled/world_fullbright_frag.c \ ../Shaders/Compiled/world_vert.c GLOBJS = \ diff --git a/Quake/Makefile.w64 b/Quake/Makefile.w64 index 6c75dae8c..2654aeec7 100644 --- a/Quake/Makefile.w64 +++ b/Quake/Makefile.w64 @@ -222,7 +222,6 @@ SHADER_OBJS = \ ../Shaders/Compiled/sky_layer_frag.c \ ../Shaders/Compiled/sky_layer_vert.c \ ../Shaders/Compiled/world_frag.c \ - ../Shaders/Compiled/world_fullbright_frag.c \ ../Shaders/Compiled/world_vert.c GLOBJS = \ diff --git a/Quake/gl_rmisc.c b/Quake/gl_rmisc.c index 4dc478636..627a6c9a2 100644 --- a/Quake/gl_rmisc.c +++ b/Quake/gl_rmisc.c @@ -972,7 +972,6 @@ void R_CreatePipelines() VkShaderModule basic_notex_frag_module = R_CreateShaderModule(basic_notex_frag_spv, basic_notex_frag_spv_size); VkShaderModule world_vert_module = R_CreateShaderModule(world_vert_spv, world_vert_spv_size); VkShaderModule world_frag_module = R_CreateShaderModule(world_frag_spv, world_frag_spv_size); - VkShaderModule world_fullbright_frag_module = R_CreateShaderModule(world_fullbright_frag_spv, world_fullbright_frag_spv_size); VkShaderModule alias_vert_module = R_CreateShaderModule(alias_vert_spv, alias_vert_spv_size); VkShaderModule alias_frag_module = R_CreateShaderModule(alias_frag_spv, alias_frag_spv_size); VkShaderModule sky_layer_vert_module = R_CreateShaderModule(sky_layer_vert_spv, sky_layer_vert_spv_size); @@ -1265,23 +1264,59 @@ void R_CreatePipelines() vertex_input_state_create_info.vertexBindingDescriptionCount = 1; vertex_input_state_create_info.pVertexBindingDescriptions = &world_vertex_binding_description; + VkSpecializationMapEntry specialization_entries[2]; + specialization_entries[0].constantID = 0; + specialization_entries[0].offset = 0; + specialization_entries[0].size = 4; + specialization_entries[1].constantID = 1; + specialization_entries[1].offset = 4; + specialization_entries[1].size = 4; + + uint32_t specialization_data[2]; + specialization_data[0] = 0; + specialization_data[1] = 0; + + VkSpecializationInfo specialization_info; + specialization_info.mapEntryCount = 2; + specialization_info.pMapEntries = specialization_entries; + specialization_info.dataSize = 8; + specialization_info.pData = specialization_data; + + pipeline_create_info.layout = vulkan_globals.world_pipeline_layout; + shader_stages[0].module = world_vert_module; shader_stages[1].module = world_frag_module; + shader_stages[1].pSpecializationInfo = &specialization_info; blend_attachment_state.blendEnable = VK_FALSE; - - pipeline_create_info.layout = vulkan_globals.world_pipeline_layout; - err = vkCreateGraphicsPipelines(vulkan_globals.device, VK_NULL_HANDLE, 1, &pipeline_create_info, NULL, &vulkan_globals.world_pipeline); + err = vkCreateGraphicsPipelines(vulkan_globals.device, VK_NULL_HANDLE, 1, &pipeline_create_info, NULL, &vulkan_globals.world_pipelines[world_pipeline_base]); + if (err != VK_SUCCESS) + Sys_Error("vkCreateGraphicsPipelines failed"); + + specialization_data[0] = 1; + specialization_data[1] = 0; + + err = vkCreateGraphicsPipelines(vulkan_globals.device, VK_NULL_HANDLE, 1, &pipeline_create_info, NULL, &vulkan_globals.world_pipelines[world_pipeline_fullbright]); if (err != VK_SUCCESS) Sys_Error("vkCreateGraphicsPipelines failed"); - shader_stages[1].module = world_fullbright_frag_module; + specialization_data[0] = 0; + specialization_data[1] = 1; - err = vkCreateGraphicsPipelines(vulkan_globals.device, VK_NULL_HANDLE, 1, &pipeline_create_info, NULL, &vulkan_globals.world_fullbright_pipeline); + err = vkCreateGraphicsPipelines(vulkan_globals.device, VK_NULL_HANDLE, 1, &pipeline_create_info, NULL, &vulkan_globals.world_pipelines[world_pipeline_alpha_test]); if (err != VK_SUCCESS) Sys_Error("vkCreateGraphicsPipelines failed"); + specialization_data[0] = 1; + specialization_data[1] = 1; + + err = vkCreateGraphicsPipelines(vulkan_globals.device, VK_NULL_HANDLE, 1, &pipeline_create_info, NULL, &vulkan_globals.world_pipelines[world_pipeline_fullbright_alpha_test]); + if (err != VK_SUCCESS) + Sys_Error("vkCreateGraphicsPipelines failed"); + + shader_stages[1].pSpecializationInfo = NULL; + //================ // Alias pipeline //================ @@ -1336,7 +1371,6 @@ void R_CreatePipelines() vkDestroyShaderModule(vulkan_globals.device, sky_layer_vert_module, NULL); vkDestroyShaderModule(vulkan_globals.device, alias_frag_module, NULL); vkDestroyShaderModule(vulkan_globals.device, alias_vert_module, NULL); - vkDestroyShaderModule(vulkan_globals.device, world_fullbright_frag_module, NULL); vkDestroyShaderModule(vulkan_globals.device, world_frag_module, NULL); vkDestroyShaderModule(vulkan_globals.device, world_vert_module, NULL); vkDestroyShaderModule(vulkan_globals.device, basic_notex_frag_module, NULL); diff --git a/Quake/glquake.h b/Quake/glquake.h index 304ae14d6..1b4d443a6 100644 --- a/Quake/glquake.h +++ b/Quake/glquake.h @@ -100,6 +100,14 @@ typedef struct particle_s ptype_t type; } particle_t; +typedef enum { + world_pipeline_base, + world_pipeline_fullbright, + world_pipeline_alpha_test, + world_pipeline_fullbright_alpha_test, + world_pipeline_count +} world_pipeline_type; + typedef struct { VkDevice device; @@ -122,8 +130,7 @@ typedef struct VkPipeline basic_blend_pipeline; VkPipeline basic_notex_blend_pipeline; VkPipelineLayout basic_pipeline_layout; - VkPipeline world_pipeline; - VkPipeline world_fullbright_pipeline; + VkPipeline world_pipelines[world_pipeline_count]; VkPipelineLayout world_pipeline_layout; VkPipeline water_pipeline; VkPipeline warp_pipeline; diff --git a/Quake/r_world.c b/Quake/r_world.c index 0a132c446..c0640ae4b 100644 --- a/Quake/r_world.c +++ b/Quake/r_world.c @@ -448,10 +448,18 @@ R_FlushBatch Draw the current batch if non-empty and clears it, ready for more R_BatchSurface calls. ================ */ -static void R_FlushBatch () +static void R_FlushBatch (VkPipeline * current_pipeline, qboolean fullbright_enabled, qboolean alpha_test) { if (num_vbo_indices > 0) { + int pipeline_index = (fullbright_enabled ? 1 : 0) + (alpha_test ? 2 : 0); + VkPipeline new_pipeline = vulkan_globals.world_pipelines[pipeline_index]; + if (new_pipeline != *current_pipeline) + { + vkCmdBindPipeline(vulkan_globals.command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, new_pipeline); + *current_pipeline = new_pipeline; + } + VkBuffer buffer; VkDeviceSize buffer_offset; byte * indices = R_IndexAllocate(num_vbo_indices * sizeof(uint32_t), &buffer, &buffer_offset); @@ -472,14 +480,14 @@ Add the surface to the current batch, or just draw it immediately if we're not using VBOs. ================ */ -static void R_BatchSurface (msurface_t *s) +static void R_BatchSurface (msurface_t *s, VkPipeline * current_pipeline, qboolean fullbright_enabled, qboolean alpha_test) { int num_surf_indices; num_surf_indices = R_NumTriangleIndicesForSurf (s); if (num_vbo_indices + num_surf_indices > MAX_BATCH_SIZE) - R_FlushBatch(); + R_FlushBatch(current_pipeline, fullbright_enabled, alpha_test); R_TriangleIndicesForSurf (s, &vbo_indices[num_vbo_indices]); num_vbo_indices += num_surf_indices; @@ -706,36 +714,33 @@ void R_DrawTextureChains_Multitexture (qmodel_t *model, entity_t *ent, texchain_ msurface_t *s; texture_t *t; qboolean bound; + qboolean fullbright_enabled = false; + qboolean alpha_test = false; int lastlightmap; gltexture_t *fullbright = NULL; - + VkPipeline current_pipeline = VK_NULL_HANDLE; + VkDeviceSize offset = 0; vkCmdBindVertexBuffers(vulkan_globals.command_buffer, 0, 1, &bmodel_vertex_buffer, &offset); - vkCmdBindPipeline(vulkan_globals.command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vulkan_globals.world_pipeline); - VkPipeline current_pipeline = vulkan_globals.world_pipeline; - for (i=0 ; inumtextures ; i++) + vkCmdBindDescriptorSets(vulkan_globals.command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vulkan_globals.world_pipeline_layout, 2, 1, &nulltexture->descriptor_set, 0, NULL); + + for (i = 0; inumtextures; ++i) { t = model->textures[i]; if (!t || !t->texturechains[chain] || t->texturechains[chain]->flags & (SURF_DRAWTILED | SURF_NOTEXTURE)) continue; - // Enable/disable TMU 2 (fullbrights) + if (gl_fullbrights.value && (fullbright = R_TextureAnimation(t, ent != NULL ? ent->frame : 0)->fullbright)) { - if (current_pipeline != vulkan_globals.world_fullbright_pipeline) - { - vkCmdBindPipeline(vulkan_globals.command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vulkan_globals.world_fullbright_pipeline); - current_pipeline = vulkan_globals.world_fullbright_pipeline; - } - + fullbright_enabled = true; vkCmdBindDescriptorSets(vulkan_globals.command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vulkan_globals.world_pipeline_layout, 2, 1, &fullbright->descriptor_set, 0, NULL); } - else if (current_pipeline != vulkan_globals.world_pipeline) + else { - vkCmdBindPipeline(vulkan_globals.command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vulkan_globals.world_pipeline); - current_pipeline = vulkan_globals.world_pipeline; + fullbright_enabled = false; } R_ClearBatch (); @@ -743,6 +748,7 @@ void R_DrawTextureChains_Multitexture (qmodel_t *model, entity_t *ent, texchain_ bound = false; lastlightmap = 0; // avoid compiler warning for (s = t->texturechains[chain]; s; s = s->texturechain) + { if (!s->culled) { if (!bound) //only bind once we are sure we need this texture @@ -751,29 +757,27 @@ void R_DrawTextureChains_Multitexture (qmodel_t *model, entity_t *ent, texchain_ gltexture_t * gl_texture = texture->gltexture; vkCmdBindDescriptorSets(vulkan_globals.command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vulkan_globals.world_pipeline_layout, 0, 1, &gl_texture->descriptor_set, 0, NULL); - //if (t->texturechains[chain]->flags & SURF_DRAWFENCE) - // glEnable (GL_ALPHA_TEST); // Flip alpha test back on - + alpha_test = (t->texturechains[chain]->flags & SURF_DRAWFENCE) != 0; bound = true; lastlightmap = s->lightmaptexturenum; } if (s->lightmaptexturenum != lastlightmap) - R_FlushBatch (); + { + R_FlushBatch (¤t_pipeline, fullbright_enabled, alpha_test); + } gltexture_t * lightmap_texture = lightmap_textures[s->lightmaptexturenum]; vkCmdBindDescriptorSets(vulkan_globals.command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vulkan_globals.world_pipeline_layout, 1, 1, &lightmap_texture->descriptor_set, 0, NULL); lastlightmap = s->lightmaptexturenum; - R_BatchSurface (s); + R_BatchSurface (s, ¤t_pipeline, fullbright_enabled, alpha_test); rs_brushpasses++; } + } - R_FlushBatch (); - - //if (bound && t->texturechains[chain]->flags & SURF_DRAWFENCE) - // glDisable (GL_ALPHA_TEST); // Flip alpha test back off + R_FlushBatch (¤t_pipeline, fullbright_enabled, alpha_test); } } diff --git a/Shaders/Compiled/world_frag.c b/Shaders/Compiled/world_frag.c index d35245219..e828acb06 100644 --- a/Shaders/Compiled/world_frag.c +++ b/Shaders/Compiled/world_frag.c @@ -1,6 +1,6 @@ unsigned char world_frag_spv[] = { 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, -0x08, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x08, 0x00, 0x3D, 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, @@ -31,74 +31,137 @@ unsigned char world_frag_spv[] = { 0x67, 0x68, 0x74, 0x6D, 0x61, 0x70, 0x5F, 0x74, 0x65, 0x78, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x6F, 0x75, 0x74, 0x5F, 0x66, 0x72, 0x61, 0x67, -0x5F, 0x63, 0x6F, 0x6C, 0x6F, 0x72, 0x00, 0x00, 0x47, 0x00, -0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0D, 0x00, -0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x47, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1E, 0x00, +0x5F, 0x63, 0x6F, 0x6C, 0x6F, 0x72, 0x00, 0x00, 0x05, 0x00, +0x05, 0x00, 0x26, 0x00, 0x00, 0x00, 0x66, 0x75, 0x6C, 0x6C, +0x62, 0x72, 0x69, 0x67, 0x68, 0x74, 0x00, 0x00, 0x05, 0x00, +0x06, 0x00, 0x27, 0x00, 0x00, 0x00, 0x66, 0x75, 0x6C, 0x6C, +0x62, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5F, 0x74, 0x65, 0x78, +0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, +0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, +0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x10, 0x00, +0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x47, 0x00, 0x04, 0x00, 0x16, 0x00, 0x00, 0x00, 0x22, 0x00, +0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, +0x16, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x1E, 0x00, 0x00, 0x00, +0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, +0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x27, 0x00, +0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, +0x47, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, -0x16, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x16, 0x00, 0x00, 0x00, -0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, -0x04, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, -0x00, 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, 0x04, 0x00, -0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, -0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x19, 0x00, -0x09, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x03, 0x00, 0x0B, 0x00, -0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, -0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, -0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, -0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, -0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0F, 0x00, -0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x17, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, 0x06, 0x00, -0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, -0x0C, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, -0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x00, -0x04, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, -0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x1D, 0x00, -0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, +0x2F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 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, 0x04, 0x00, 0x00, 0x00, +0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, +0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, +0x0A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x1B, 0x00, 0x03, 0x00, 0x0B, 0x00, 0x00, 0x00, +0x0A, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0C, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, +0x3B, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0D, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, +0x0F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, +0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, +0x04, 0x00, 0x11, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, +0x02, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0C, 0x00, +0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1B, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x00, 0x04, 0x00, +0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, +0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x1D, 0x00, 0x00, 0x00, +0x1E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x14, 0x00, +0x02, 0x00, 0x22, 0x00, 0x00, 0x00, 0x31, 0x00, 0x03, 0x00, +0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3B, 0x00, +0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x03, 0x00, 0x22, 0x00, +0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, +0x32, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, +0x33, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, +0x04, 0x00, 0x34, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, +0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, +0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0xFA, 0x7E, 0x2A, 0x3F, 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, 0x08, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, -0x3D, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0E, 0x00, -0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, -0x07, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x10, 0x00, +0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x26, 0x00, +0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, +0x0B, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0D, 0x00, +0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, +0x12, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x4F, 0x00, +0x07, 0x00, 0x11, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, +0x12, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, +0x07, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0E, 0x00, +0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, +0x09, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x3D, 0x00, +0x04, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, +0x16, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, +0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, +0x4F, 0x00, 0x07, 0x00, 0x11, 0x00, 0x00, 0x00, 0x19, 0x00, +0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, +0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x57, 0x00, +0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, +0x17, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x8E, 0x00, +0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, +0x1A, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x3E, 0x00, +0x03, 0x00, 0x15, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, +0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1F, 0x00, +0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, +0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x15, 0x00, +0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, +0x21, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x20, 0x00, +0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x1E, 0x00, 0x00, 0x00, +0x21, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00, 0x25, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00, +0x23, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x25, 0x00, +0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x24, 0x00, 0x00, 0x00, +0x3D, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x28, 0x00, +0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, +0x07, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, 0x11, 0x00, 0x00, 0x00, -0x13, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x12, 0x00, +0x2A, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x00, -0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, -0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x14, 0x00, -0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x00, 0x00, -0x17, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x3D, 0x00, -0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, 0x11, 0x00, -0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, -0x18, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, -0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, -0x1A, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x19, 0x00, -0x00, 0x00, 0x8E, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, -0x1C, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x1B, 0x00, -0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x15, 0x00, 0x00, 0x00, -0x1C, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, -0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, -0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, -0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, -0x07, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x1F, 0x00, -0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, -0x1E, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0xFD, 0x00, -0x01, 0x00, 0x38, 0x00, 0x01, 0x00, }; -int world_frag_spv_size = 1016; +0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2B, 0x00, +0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, +0x3E, 0x00, 0x03, 0x00, 0x26, 0x00, 0x00, 0x00, 0x2B, 0x00, +0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, +0x2C, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3D, 0x00, +0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, +0x1E, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, +0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, +0x2C, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x1E, 0x00, +0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00, +0x25, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x25, 0x00, +0x00, 0x00, 0xF7, 0x00, 0x03, 0x00, 0x31, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00, 0x2F, 0x00, +0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, +0xF8, 0x00, 0x02, 0x00, 0x30, 0x00, 0x00, 0x00, 0x41, 0x00, +0x05, 0x00, 0x34, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, +0x1E, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x3D, 0x00, +0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, +0x35, 0x00, 0x00, 0x00, 0xB8, 0x00, 0x05, 0x00, 0x22, 0x00, +0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, +0x37, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00, 0x31, 0x00, +0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x31, 0x00, 0x00, 0x00, +0xF5, 0x00, 0x07, 0x00, 0x22, 0x00, 0x00, 0x00, 0x39, 0x00, +0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, +0x38, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xF7, 0x00, +0x03, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xFA, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x3A, 0x00, +0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, +0x3A, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x01, 0x00, 0xF8, 0x00, +0x02, 0x00, 0x3B, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, +0x38, 0x00, 0x01, 0x00, }; +int world_frag_spv_size = 1644; diff --git a/Shaders/Compiled/world_fullbright_frag.c b/Shaders/Compiled/world_fullbright_frag.c deleted file mode 100644 index 396bc3e06..000000000 --- a/Shaders/Compiled/world_fullbright_frag.c +++ /dev/null @@ -1,128 +0,0 @@ -unsigned char world_fullbright_frag_spv[] = { -0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, -0x08, 0x00, 0x2A, 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, 0x07, 0x00, 0x04, 0x00, -0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, -0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x24, 0x00, -0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, -0x07, 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, 0x04, 0x00, 0x09, 0x00, 0x47, 0x4C, 0x5F, 0x41, -0x52, 0x42, 0x5F, 0x73, 0x68, 0x61, 0x64, 0x69, 0x6E, 0x67, -0x5F, 0x6C, 0x61, 0x6E, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5F, -0x34, 0x32, 0x30, 0x70, 0x61, 0x63, 0x6B, 0x00, 0x05, 0x00, -0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, -0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x09, 0x00, -0x00, 0x00, 0x64, 0x69, 0x66, 0x66, 0x75, 0x73, 0x65, 0x00, -0x05, 0x00, 0x05, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x64, 0x69, -0x66, 0x66, 0x75, 0x73, 0x65, 0x5F, 0x74, 0x65, 0x78, 0x00, -0x05, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x69, 0x6E, -0x5F, 0x74, 0x65, 0x78, 0x63, 0x6F, 0x6F, 0x72, 0x64, 0x73, -0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x15, 0x00, -0x00, 0x00, 0x6C, 0x69, 0x67, 0x68, 0x74, 0x00, 0x00, 0x00, -0x05, 0x00, 0x06, 0x00, 0x16, 0x00, 0x00, 0x00, 0x6C, 0x69, -0x67, 0x68, 0x74, 0x6D, 0x61, 0x70, 0x5F, 0x74, 0x65, 0x78, -0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x1D, 0x00, -0x00, 0x00, 0x66, 0x75, 0x6C, 0x6C, 0x62, 0x72, 0x69, 0x67, -0x68, 0x74, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x1E, 0x00, -0x00, 0x00, 0x66, 0x75, 0x6C, 0x6C, 0x62, 0x72, 0x69, 0x67, -0x68, 0x74, 0x5F, 0x74, 0x65, 0x78, 0x00, 0x00, 0x05, 0x00, -0x06, 0x00, 0x24, 0x00, 0x00, 0x00, 0x6F, 0x75, 0x74, 0x5F, -0x66, 0x72, 0x61, 0x67, 0x5F, 0x63, 0x6F, 0x6C, 0x6F, 0x72, -0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, -0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, -0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x10, 0x00, -0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x47, 0x00, 0x04, 0x00, 0x16, 0x00, 0x00, 0x00, 0x22, 0x00, -0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, -0x16, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x1E, 0x00, 0x00, 0x00, -0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, -0x04, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x24, 0x00, -0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 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, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, -0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, -0x07, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x0A, 0x00, -0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x1B, 0x00, 0x03, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0A, 0x00, -0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x3B, 0x00, -0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0F, 0x00, -0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, -0x3B, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x10, 0x00, -0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, -0x11, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, -0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, -0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x40, 0x3B, 0x00, 0x04, 0x00, 0x0C, 0x00, -0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x20, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x03, 0x00, -0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, -0x23, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x03, 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, -0x08, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x07, 0x00, -0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, -0x1D, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3D, 0x00, -0x04, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, -0x0D, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, -0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, -0x4F, 0x00, 0x07, 0x00, 0x11, 0x00, 0x00, 0x00, 0x13, 0x00, -0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x57, 0x00, -0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, -0x0E, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x3E, 0x00, -0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, -0x3D, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x17, 0x00, -0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, -0x07, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x10, 0x00, -0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, 0x11, 0x00, 0x00, 0x00, -0x19, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x18, 0x00, -0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, -0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1A, 0x00, -0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, -0x8E, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1C, 0x00, -0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, -0x3E, 0x00, 0x03, 0x00, 0x15, 0x00, 0x00, 0x00, 0x1C, 0x00, -0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x00, 0x00, -0x1F, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x3D, 0x00, -0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, 0x11, 0x00, -0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, -0x22, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x21, 0x00, -0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x1D, 0x00, 0x00, 0x00, -0x22, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, -0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, -0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x26, 0x00, -0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, -0x07, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x25, 0x00, -0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, -0x07, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x1D, 0x00, -0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, -0x29, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x28, 0x00, -0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x24, 0x00, 0x00, 0x00, -0x29, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, -0x01, 0x00, }; -int world_fullbright_frag_spv_size = 1252; diff --git a/Shaders/compile.bat b/Shaders/compile.bat index e29e91bfc..c0203b9d8 100644 --- a/Shaders/compile.bat +++ b/Shaders/compile.bat @@ -17,7 +17,6 @@ cl.exe /nologo bintoc.c %VULKAN_SDK%\bin\glslangValidator.exe -V basic_notex.frag -o Compiled/basic_notex.fspv %VULKAN_SDK%\bin\glslangValidator.exe -V world.vert -o Compiled/world.vspv %VULKAN_SDK%\bin\glslangValidator.exe -V world.frag -o Compiled/world.fspv -%VULKAN_SDK%\bin\glslangValidator.exe -V world_fullbright.frag -o Compiled/world_fullbright.fspv %VULKAN_SDK%\bin\glslangValidator.exe -V alias.vert -o Compiled/alias.vspv %VULKAN_SDK%\bin\glslangValidator.exe -V alias.frag -o Compiled/alias.fspv %VULKAN_SDK%\bin\glslangValidator.exe -V sky_layer.vert -o Compiled/sky_layer.vspv @@ -29,7 +28,6 @@ bintoc.exe Compiled/basic_notex.fspv basic_notex_frag_spv > Compiled/basic_notex bintoc.exe Compiled/basic_alphatest.fspv basic_alphatest_frag_spv > Compiled/basic_alphatest_frag.c bintoc.exe Compiled/world.vspv world_vert_spv > Compiled/world_vert.c bintoc.exe Compiled/world.fspv world_frag_spv > Compiled/world_frag.c -bintoc.exe Compiled/world_fullbright.fspv world_fullbright_frag_spv > Compiled/world_fullbright_frag.c bintoc.exe Compiled/alias.vspv alias_vert_spv > Compiled/alias_vert.c bintoc.exe Compiled/alias.fspv alias_frag_spv > Compiled/alias_frag.c bintoc.exe Compiled/sky_layer.vspv sky_layer_vert_spv > Compiled/sky_layer_vert.c diff --git a/Shaders/shaders.h b/Shaders/shaders.h index e3b8c674d..d83ea0481 100644 --- a/Shaders/shaders.h +++ b/Shaders/shaders.h @@ -33,8 +33,6 @@ extern unsigned char world_vert_spv[]; extern int world_vert_spv_size; extern unsigned char world_frag_spv[]; extern int world_frag_spv_size; -extern unsigned char world_fullbright_frag_spv[]; -extern int world_fullbright_frag_spv_size; extern unsigned char alias_vert_spv[]; extern int alias_vert_spv_size; extern unsigned char alias_frag_spv[]; diff --git a/Shaders/world.frag b/Shaders/world.frag index 75d17392a..d71120f9f 100644 --- a/Shaders/world.frag +++ b/Shaders/world.frag @@ -4,14 +4,27 @@ layout(set = 0, binding = 0) uniform sampler2D diffuse_tex; layout(set = 1, binding = 0) uniform sampler2D lightmap_tex; +layout(set = 2, binding = 0) uniform sampler2D fullbright_tex; layout (location = 0) in vec4 in_texcoords; layout (location = 0) out vec4 out_frag_color; +layout (constant_id = 0) const bool use_fullbright = false; +layout (constant_id = 1) const bool use_alpha_test = false; + void main() { vec4 diffuse = texture(diffuse_tex, in_texcoords.xy); vec4 light = texture(lightmap_tex, in_texcoords.zw) * 2.0f; out_frag_color = diffuse * light; + + if (use_fullbright) + { + vec4 fullbright = texture(fullbright_tex, in_texcoords.xy); + out_frag_color += fullbright; + } + + if (use_alpha_test && out_frag_color.a < 0.666f) + discard; } diff --git a/Shaders/world_fullbright.frag b/Shaders/world_fullbright.frag deleted file mode 100644 index cd97a6579..000000000 --- a/Shaders/world_fullbright.frag +++ /dev/null @@ -1,19 +0,0 @@ -#version 450 -#extension GL_ARB_separate_shader_objects : enable -#extension GL_ARB_shading_language_420pack : enable - -layout(set = 0, binding = 0) uniform sampler2D diffuse_tex; -layout(set = 1, binding = 0) uniform sampler2D lightmap_tex; -layout(set = 2, binding = 0) uniform sampler2D fullbright_tex; - -layout (location = 0) in vec4 in_texcoords; - -layout (location = 0) out vec4 out_frag_color; - -void main() -{ - vec4 diffuse = texture(diffuse_tex, in_texcoords.xy); - vec4 light = texture(lightmap_tex, in_texcoords.zw) * 2.0f; - vec4 fullbright = texture(fullbright_tex, in_texcoords.xy); - out_frag_color = diffuse * light + fullbright; -} diff --git a/Windows/VisualStudio/vkquake.vcxproj b/Windows/VisualStudio/vkquake.vcxproj index b22fdba47..59e271b90 100644 --- a/Windows/VisualStudio/vkquake.vcxproj +++ b/Windows/VisualStudio/vkquake.vcxproj @@ -295,7 +295,6 @@ copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)" - @@ -380,7 +379,6 @@ copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)" - diff --git a/Windows/VisualStudio/vkquake.vcxproj.filters b/Windows/VisualStudio/vkquake.vcxproj.filters index 85923fa03..42ad16d96 100644 --- a/Windows/VisualStudio/vkquake.vcxproj.filters +++ b/Windows/VisualStudio/vkquake.vcxproj.filters @@ -271,9 +271,6 @@ Shaders\Compiled - - Shaders\Compiled - Shaders\Compiled @@ -520,9 +517,6 @@ Shaders - - Shaders - Shaders