Rendering Explicit and Implicit Complex Functions in 4D: A WebGPU-Based Approach
Abstract
Complex functions \(f :\mathbb {C} \rightarrow \mathbb {C}\) are inherently four-dimensional objects, and the substantial literature on their visualization is fragmented across incompatible APIs and proprietary environments that demand prior familiarity to use. We present a browser-accessible framework that unifies these techniques in a single interactive viewer built on WebGPU. Explicit functions are evaluated and embedded directly in \(\mathbb {R}^4\), with the Riemann sphere and an S2 × S2 product embedding available as alternative compactifications, alongside domain coloring, selectable render topologies, and continuous 4D rotation. Implicit relations g(z, w) = 0 are extracted as isosurfaces of a 4D scalar field by a marching-tesseract scheme, in both point-cloud and connected-mesh form; the latter obtains connectivity from a Freudenthal subdivision into simplices, avoiding the configuration table that a direct tesseract analogue of marching cubes would require, and generalizing to arbitrary dimension. A slice-sweep residency strategy bounds the working set of the point-cloud path to two O(N3) slices rather than the full O(N4) field. Both paths run entirely on the GPU without CPU read-back, sustaining interactive frame rates on discrete hardware and remaining usable on integrated GPUs.