Vulkan
Vulkan copied to clipboard
ndc coord -1 to 1 in cascaded shadowmap
glm::vec3 frustumCorners[8] = {
glm::vec3(-1.0f, 1.0f, -1.0f),
glm::vec3( 1.0f, 1.0f, -1.0f),
glm::vec3( 1.0f, -1.0f, -1.0f),
glm::vec3(-1.0f, -1.0f, -1.0f),
glm::vec3(-1.0f, 1.0f, 1.0f),
glm::vec3( 1.0f, 1.0f, 1.0f),
glm::vec3( 1.0f, -1.0f, 1.0f),
glm::vec3(-1.0f, -1.0f, 1.0f),
};
I observe you were using ndc z coord range of [-1, 1], while the vulkan ndc is really from [0,1]. using [-1,1] translates to a frustum centered at the camera and from the back of the camera. How is this issue solved by the rest of your code?
Thanks.
The base class defines GLM_FORCE_DEPTH_ZERO_TO_ONE.
isn't this exactly why ndc coord range should be [0,1] ? since forward conversion is world coord to ndc [0,1] then backward conversion should be ndc[0,1] to world coord?