So I’ve thrown out all sanity and started implementing a Metal renderer for my iOS port. It’s actually going fairly well, I’ve implemented most of the basic renderer structures and have untextured vertices rendering. Performance also seems pretty good.
However I’m having a problem which is a bit beyond my limited grasp of matrix math to solve. OpenGL defines the viewport with (0,0) at bottom-left whereas Metal annoyingly defines it as top-left. Does anyone know the best way to deal with this in the frustum/projection matrix generation code? The code is in the metal-renderer branch on Github. (https://github.com/tokyovigilante/CesiumKit/tree/metal-renderer).