diff --git a/ref_vk/TODO.md b/ref_vk/TODO.md index 51924ec9..c7a72511 100644 --- a/ref_vk/TODO.md +++ b/ref_vk/TODO.md @@ -3,13 +3,13 @@ - [x] move uniform_data_t to global render state ~inside render_draw_t, remove any mentions of uniform/slots from api; alt: global render state?~ - [x] rename RenderDraw to SubmitDraw - [x] ~add debug label to render_draw_t?;~ alt: VK_RenderDebugNameBegin/End +- [x] fix sprite blending # Next - [ ] refactor vk_render interface: - [ ] make 2nd commad buffer for resource upload - [ ] start building command buffers in beginframe - [ ] perform 3d rendering on corresponding refapi calls, not endframe -- [ ] fix sprite blending # Planned - [ ] RTX: make projection matrix independent render global/current/static state diff --git a/ref_vk/vk_render.c b/ref_vk/vk_render.c index 2f174e47..8d3451a2 100644 --- a/ref_vk/vk_render.c +++ b/ref_vk/vk_render.c @@ -124,12 +124,14 @@ static qboolean createPipelines( void ) ci.stages[1].pSpecializationInfo = NULL; ci.blendEnable = VK_FALSE; ci.depthWriteEnable = VK_TRUE; + ci.depthTestEnable = VK_TRUE; name = "brush kRenderNormal"; break; case kRenderTransColor: ci.stages[1].pSpecializationInfo = NULL; ci.depthWriteEnable = VK_TRUE; + ci.depthTestEnable = VK_TRUE; ci.blendEnable = VK_TRUE; ci.colorBlendOp = VK_BLEND_OP_ADD; // TODO check ci.srcAlphaBlendFactor = ci.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA; @@ -140,6 +142,7 @@ static qboolean createPipelines( void ) case kRenderTransAdd: ci.stages[1].pSpecializationInfo = NULL; ci.depthWriteEnable = VK_FALSE; + ci.depthTestEnable = VK_TRUE; ci.blendEnable = VK_TRUE; ci.colorBlendOp = VK_BLEND_OP_ADD; // TODO check @@ -152,14 +155,25 @@ static qboolean createPipelines( void ) case kRenderTransAlpha: ci.stages[1].pSpecializationInfo = &alpha_test_spec; ci.depthWriteEnable = VK_TRUE; + ci.depthTestEnable = VK_TRUE; ci.blendEnable = VK_FALSE; name = "brush kRenderTransAlpha(test)"; break; case kRenderGlow: + ci.stages[1].pSpecializationInfo = NULL; + ci.depthWriteEnable = VK_FALSE; + ci.depthTestEnable = VK_FALSE; + ci.blendEnable = VK_TRUE; + ci.colorBlendOp = VK_BLEND_OP_ADD; // TODO check + ci.srcAlphaBlendFactor = ci.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA; + ci.dstAlphaBlendFactor = ci.dstColorBlendFactor = VK_BLEND_FACTOR_ONE; + break; + case kRenderTransTexture: ci.stages[1].pSpecializationInfo = NULL; ci.depthWriteEnable = VK_FALSE; + ci.depthTestEnable = VK_TRUE; ci.blendEnable = VK_TRUE; ci.colorBlendOp = VK_BLEND_OP_ADD; // TODO check ci.srcAlphaBlendFactor = ci.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;