Hello everyone,
sometimes we don’t want to render everything in the scene for some reason.
Not rendering certain parts is sometimes referred to as conditional rendering.
But I am wondering: What is the best way to do this?
Taking a look at Sascha Willems great example collection, I see the example “conditional renderer” is using device extension VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME
.
However, it is not beyond impossible that this extension is not present in a system we want to support.
So what other way to do this?
Another option would be to record command buffers without calling the corresponding vkCmdDrawIndexed
, so the object which we want to be invisible will not be rendered. A good example would be Sascha Willem’s “gltfscenerendering”.
This solution would work on all systems as it does not require any extensions.
The downside of this is that recording command buffers can be a very resource intensive operation which can take up to several 100 ms(!).
So what do you think about this?
Is there a best practise I’ve been missing so far?
Thank you,
Johannes.