greggman / wgpu-matrix

Fast WebGPU 3d math library
https://wgpu-matrix.org
MIT License
298 stars 13 forks source link

Should `mat4.perspective` allow `zFar === Infinity`? #9

Closed shrekshao closed 1 year ago

shrekshao commented 1 year ago

https://github.com/greggman/wgpu-matrix/blob/main/src/mat4-impl.ts#L676 Now if zFar === Infinity it ends with NaN

gl-matrix now handles infinity case explicitly: https://github.com/toji/gl-matrix/blob/master/src/mat4.js#L1601-L1608

greggman commented 1 year ago

added https://github.com/greggman/wgpu-matrix/commit/10c1fbc57d09059ebcae84798ed088ef2276d9bb