You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using perspective with an off-axis projection, mat4.frustum is used instead of mat4.perspective. In v3.4.1 there's a mat4.perspectiveZO method for WebGPU, but no mat4.frustum. So web apps using an off-axis projection are missing a way to use the right matrix for WebGPU in glMatrix.
The text was updated successfully, but these errors were encountered:
Figured out a workaround from the code referenced in #369:
constmatWebGLtoWebGPU=mat4.fromValues(1,0,0,0,0,1,0,0,0,0,0.5,0,0,0,0.5,1,);// Calculate WebGL matrix (Z range [-1, 1])mat4.frustum(outMat,/* ... */);// Convert to WebGPU matrix (Z range [0, 1])if(isWebGPU)mat4.mul(outMat,matWebGLtoWebGPU,outMat);
Hopefully an easy add for a glMatrix frustumZO method?
When using perspective with an off-axis projection,
mat4.frustum
is used instead ofmat4.perspective
. In v3.4.1 there's amat4.perspectiveZO
method for WebGPU, but nomat4.frustum
. So web apps using an off-axis projection are missing a way to use the right matrix for WebGPU in glMatrix.The text was updated successfully, but these errors were encountered: