For magnetic fields, the problem is there are no simple (non-trivial) solutions for the magnetic fields of interesting things like a bar magnet.
Even the magnetic field of a circular loop of current involves elliptic integrals.
(see e.g. https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/200100...).
https://twitter.com/jamportz/status/1079777103892135936 https://tinyurl.com/y859v78t
For magnetic fields, the problem is there are no simple (non-trivial) solutions for the magnetic fields of interesting things like a bar magnet. Even the magnetic field of a circular loop of current involves elliptic integrals. (see e.g. https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/200100...).
What you could do is numerically solve the https://en.wikipedia.org/wiki/Biot%E2%80%93Savart_law (given your currents) inside the GLSL shader.. Though this will probably be very slow..