Closed Sand3r- closed 2 years ago
Hi - actually none of these states are strictly required, as the user can draw the output geometry in any conceivable manner (with or without depth test, blending, etc.). It's for this reason that I'd prefer to keep the README agnostic to any renderer-specific details.
Nonetheless I think this tip does have a place somewhere, so I've added a comment to the example code.
On the contrary.
With VK_CULL_MODE_BACK: Arrow only visible when it's end vertex isn't on screen. Clearly not intended. With VK_CULL_MODE_NONE: Everything working just fine.
With .depthTestEnable = VK_TRUE
in VkPipelineDepthStencilStateCreateInfo
:
Gizmo not being visible inside of the objects that enclose them.
With .depthTestEnable = VK_FALSE
, obviously:
With .blendEnable = VK_FALSE
in VkPipelineColorBlendAttachmentState
:
Gizmos not appearing as intended + having some weird artifacts on its move-within-a-plane-quads. Also the ability to have semi-transparent objects is disabled.
With .blendEnable = VK_TRUE
:
Working as intended.
I agree that these states are used in most common cases, but as noted above this is really just a detail of the user's rendering implementation, which is why I think it belongs in the example code.
Disabling backface culling isn't strictly required if the renderer doesn't do line expansion in the same way that the examples do, plus users may want to enable it for triangle primitives.
Depth testing might be used to draw a different effect for Im3d primitives which intersect the depth buffer (i.e. draw twice and reverse the depth test).
Blending is optional, it generally looks nicer enabled but again there are multiple ways to achieve this.
Yeah okay, that makes sense. In that case adding the comments was prolly the way to go. Thank you for the explanation.
I've added some info about pipeline setup that I wish I knew before I started integrating im3d into my project.