Fixed pipeline default color blend state

Remember to switch winding back to CCW after rendering in world space
This commit is contained in:
Brandon Mak 2022-09-20 09:27:13 +08:00
parent 8ad0eee032
commit 77330511ee
1 changed files with 17 additions and 4 deletions

View File

@ -64,7 +64,7 @@ namespace SHADE
vk::CullModeFlags cull_mode{ vk::CullModeFlagBits::eBack };
//! CW or CCW
vk::FrontFace frontFacingOrientation{ vk::FrontFace::eCounterClockwise };
vk::FrontFace frontFacingOrientation{ vk::FrontFace::eClockwise };
bool depthBias{ VK_FALSE };
};
@ -122,7 +122,7 @@ namespace SHADE
bool depthWrite{ VK_TRUE };
// Note: Using Reversed depth-buffer for increased precision, so Greater depth values are kept
vk::CompareOp depthCompare{ vk::CompareOp::eGreater };
vk::CompareOp depthCompare{ vk::CompareOp::eLess };
bool depthBounds{ VK_FALSE };
@ -135,11 +135,24 @@ namespace SHADE
struct SHColorBlendState
{
VkBool32 logic_op_enable{ VK_TRUE };
VkBool32 logic_op_enable{ VK_FALSE };
vk::LogicOp logic_op{ VK_LOGIC_OP_COPY };
std::vector<vk::PipelineColorBlendAttachmentState> attachments;
std::vector<vk::PipelineColorBlendAttachmentState> attachments =
{
vk::PipelineColorBlendAttachmentState
{
.blendEnable = true,
.srcColorBlendFactor = vk::BlendFactor::eSrcAlpha,
.dstColorBlendFactor = vk::BlendFactor::eOneMinusSrcAlpha,
.colorBlendOp = vk::BlendOp::eAdd,
.srcAlphaBlendFactor = vk::BlendFactor::eOne,
.dstAlphaBlendFactor = vk::BlendFactor::eZero,
.alphaBlendOp = vk::BlendOp::eAdd,
.colorWriteMask = vk::ColorComponentFlagBits::eR | vk::ColorComponentFlagBits::eG | vk::ColorComponentFlagBits::eB | vk::ColorComponentFlagBits::eA,
}
};
};
// TODO: Specialization constants