mathr.co.uk/blog/2020-06-18_op
New blog post about optimizing zoom animations (again).

TL;DR exponential map representation is much more efficient than interpolating key frames

When rendering the exponential map, it'll be convenient to split it into strips covering radius factor 2 (corresponding to nested annuli). This gives an aspect ratio of $2 \pi : \log 2$, which is pretty close to 9 (only 0.72% out).

Convenient because mipmap reduction typically works in factors of 2x2, so for example a strip of 2304x256 will be reduced in width to 2304, 1152, 576, 288, 144, 72, 36, 18, 9 while the height reduces to 256, 128, 64, 32, 16, 8, 4, 2, 1.

Formula for pixel coordinate transform works out as
$$(u,v) \mapsto R \exp\left( -\log(2) \frac{v}{V} + i 2 \pi \frac{u}{U} \right)$$
where $u \in [0,U)$ and $v \in [0,V)$, with $R$ being the radius of the circumcircle.

For the actual mipmap reduction of raw iteration data, I think the best way to proceed is to do it stochastically: pick a random pixel of the 2x2 group (which should already be jittered at the base level to avoid moire artifacts).

If there is enough supersampling at the base level at the circumcircle of the image, the smaller mipmap levels will also be sufficiently supersampled in the regions in which they are used.

The width of 2304 corresponds to 640x360 at 1 sample per pixel. 1920x1080 at 7 samples per pixel would require a width of $$\sqrt{7} \pi \sqrt{1920^2+1080^2} \approx 9 \times 2048$$ so each strip would be 36Mpixel.

Show thread
Follow

Never mind about the mipmaps, they're probably not necessary as I intent to sample from the textures stochastically anyway for antialiasing/supersampling.

But will see how much VRAM is needed for a full set of annulus strip textures - perhaps I'll have to mipmap anyway just for space reasons... 4 channels of 4 bytes each at 9(2^n)^2 pixels quickly gets big, mipmaps for each of L rings multiplies by a factor of 4/3 L; but only needing to store the smaller mipmaps of the inner annuli reduces that factor to (4/3)^2

Sign in to participate in the conversation
post.lurk.org

Welcome to post.lurk.org, an instance for discussions around cultural freedom, experimental, new media art, net and computational culture, and things like that.