Closed julee closed 4 years ago
The shadow rendering setup in the Bullet-Physics samples has some example code of how to deal with that problem:
However, this shouldn't be needed in normal rendering situations, because SPIRVCross (used in the oryol-shdc tool) adds a fix to vertex shaders to "normalize" the clip space between the different 3D API conventions so that rendering can happen with the same projection matrices, no matter what 3D backend is used.
https://github.com/KhronosGroup/SPIRV-Cross/blob/master/README.md#clip-space-conventions
Metal depth goes from 0.0 at the near plane to +1.0 at the far plane, but opengl goes from -1.0 to 1.0.
I found the glm library of the currrent version ref by oryol , method glm::frustum matrix will make z value goes from -1.0 to 1.0.
So If we use oryol metal backend, and use glm library of this version, pass projection matrix from glm::frustum to shader, will cause z value goes from -1.0 to 1.0?
I can't find any code that oryol will consider this issue, or just I missed something?