A deep dive into implicit matrix representations (m-reps) for raytracing parametric surfaces directly from Bézier patches, without triangulation. The author walks through the math of converting Bézier curves and surfaces into matrix form M(x,y,z) whose rank drops on the surface, then uses generalized eigenvalue problems to find ray-surface intersections. The post covers building the matrix via null space computation, projecting 3D intersections back to UV parameter space, and handling numerical instability at patch boundaries. Implementations in Python, Julia, and C++ are compared, with the C++ version rendering a 400x400 Utah Teapot in 25 seconds — far slower than triangle-based raytracing but mathematically elegant.

15m read timeFrom mattkeeter.com
Post cover image
Table of contents
AboutThe implicit matrix representationBuilding the matrix representationBuilding the matrix, part 2Calculating pre-imagesRay intersectionsGoing from curves to surfacesPutting it all togetherPerformanceClosing thoughts

Sort: