fix sprite blending
Disable depth test and set dst blend factor to 1 for kRenderGlow mode. Sprites are occluded in software. (does this break any other code depending on Glow mode? who knows)
This commit is contained in:
parent
8dc0d4256d
commit
a5e279f580
|
@ -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] 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] rename RenderDraw to SubmitDraw
|
||||||
- [x] ~add debug label to render_draw_t?;~ alt: VK_RenderDebugNameBegin/End
|
- [x] ~add debug label to render_draw_t?;~ alt: VK_RenderDebugNameBegin/End
|
||||||
|
- [x] fix sprite blending
|
||||||
|
|
||||||
# Next
|
# Next
|
||||||
- [ ] refactor vk_render interface:
|
- [ ] refactor vk_render interface:
|
||||||
- [ ] make 2nd commad buffer for resource upload
|
- [ ] make 2nd commad buffer for resource upload
|
||||||
- [ ] start building command buffers in beginframe
|
- [ ] start building command buffers in beginframe
|
||||||
- [ ] perform 3d rendering on corresponding refapi calls, not endframe
|
- [ ] perform 3d rendering on corresponding refapi calls, not endframe
|
||||||
- [ ] fix sprite blending
|
|
||||||
|
|
||||||
# Planned
|
# Planned
|
||||||
- [ ] RTX: make projection matrix independent render global/current/static state
|
- [ ] RTX: make projection matrix independent render global/current/static state
|
||||||
|
|
|
@ -124,12 +124,14 @@ static qboolean createPipelines( void )
|
||||||
ci.stages[1].pSpecializationInfo = NULL;
|
ci.stages[1].pSpecializationInfo = NULL;
|
||||||
ci.blendEnable = VK_FALSE;
|
ci.blendEnable = VK_FALSE;
|
||||||
ci.depthWriteEnable = VK_TRUE;
|
ci.depthWriteEnable = VK_TRUE;
|
||||||
|
ci.depthTestEnable = VK_TRUE;
|
||||||
name = "brush kRenderNormal";
|
name = "brush kRenderNormal";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kRenderTransColor:
|
case kRenderTransColor:
|
||||||
ci.stages[1].pSpecializationInfo = NULL;
|
ci.stages[1].pSpecializationInfo = NULL;
|
||||||
ci.depthWriteEnable = VK_TRUE;
|
ci.depthWriteEnable = VK_TRUE;
|
||||||
|
ci.depthTestEnable = VK_TRUE;
|
||||||
ci.blendEnable = VK_TRUE;
|
ci.blendEnable = VK_TRUE;
|
||||||
ci.colorBlendOp = VK_BLEND_OP_ADD; // TODO check
|
ci.colorBlendOp = VK_BLEND_OP_ADD; // TODO check
|
||||||
ci.srcAlphaBlendFactor = ci.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;
|
ci.srcAlphaBlendFactor = ci.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;
|
||||||
|
@ -140,6 +142,7 @@ static qboolean createPipelines( void )
|
||||||
case kRenderTransAdd:
|
case kRenderTransAdd:
|
||||||
ci.stages[1].pSpecializationInfo = NULL;
|
ci.stages[1].pSpecializationInfo = NULL;
|
||||||
ci.depthWriteEnable = VK_FALSE;
|
ci.depthWriteEnable = VK_FALSE;
|
||||||
|
ci.depthTestEnable = VK_TRUE;
|
||||||
ci.blendEnable = VK_TRUE;
|
ci.blendEnable = VK_TRUE;
|
||||||
ci.colorBlendOp = VK_BLEND_OP_ADD; // TODO check
|
ci.colorBlendOp = VK_BLEND_OP_ADD; // TODO check
|
||||||
|
|
||||||
|
@ -152,14 +155,25 @@ static qboolean createPipelines( void )
|
||||||
case kRenderTransAlpha:
|
case kRenderTransAlpha:
|
||||||
ci.stages[1].pSpecializationInfo = &alpha_test_spec;
|
ci.stages[1].pSpecializationInfo = &alpha_test_spec;
|
||||||
ci.depthWriteEnable = VK_TRUE;
|
ci.depthWriteEnable = VK_TRUE;
|
||||||
|
ci.depthTestEnable = VK_TRUE;
|
||||||
ci.blendEnable = VK_FALSE;
|
ci.blendEnable = VK_FALSE;
|
||||||
name = "brush kRenderTransAlpha(test)";
|
name = "brush kRenderTransAlpha(test)";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kRenderGlow:
|
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:
|
case kRenderTransTexture:
|
||||||
ci.stages[1].pSpecializationInfo = NULL;
|
ci.stages[1].pSpecializationInfo = NULL;
|
||||||
ci.depthWriteEnable = VK_FALSE;
|
ci.depthWriteEnable = VK_FALSE;
|
||||||
|
ci.depthTestEnable = VK_TRUE;
|
||||||
ci.blendEnable = VK_TRUE;
|
ci.blendEnable = VK_TRUE;
|
||||||
ci.colorBlendOp = VK_BLEND_OP_ADD; // TODO check
|
ci.colorBlendOp = VK_BLEND_OP_ADD; // TODO check
|
||||||
ci.srcAlphaBlendFactor = ci.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;
|
ci.srcAlphaBlendFactor = ci.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;
|
||||||
|
|
Loading…
Reference in New Issue