#Why would you want to set depthWriteEnable to false?

4 messages · Page 1 of 1 (latest)

marble horizon
#

This might be a stupid question but maybe someone can answer this for me.
The documentation for VkPipelineDepthStencilStateCreateInfo describes that depthTestEnable enables the depth test.
It also states that depthWriteEnable enables writing to the depth texture, but only if depth testing is enabled.
Both can be controlled dynamically in command buffers with the same extension.
So what is the purpose of depthWriteEnable? What's a use case where depthTestEnable is true and depthWriteEnable is false?

clear geyser
#

e.g. particle systems

marble horizon
#

Ah, so any time where you would want to render something using a depth buffer that was already written to beforehand without modifying it, right?

#

Thanks