3 ms·
> Instead of one row after the next, pixels in memory follow a spiral-like curve. This is called a z-order curve[1, 2]. It makes texture mapping and mipmapping
by delta_p_delta_x 3y ago
> Instead of one row after the next, pixels in memory follow a spiral-like curve.
This is called a z-order curve[1, 2]. It makes texture mapping and mipmapping significantly more cache-friendly than the usual x-y ordering, because these operations are often performed in tiles of 2^n size.
I'd say it's more a fractal pattern than spiral-like, to be precise.
[1]: https://demonstrations.wolfram.com/ComparingXYCurvesAndZOrderCurvesForTextureCoding/ https://demonstrations.wolfram.com/ComparingXYCurvesAndZOrde...
[2]: https://en.wikipedia.org/wiki/Z-order_curve?wprov=sfla1 https://en.wikipedia.org/wiki/Z-order_curve?wprov=sfla1
- xeonmc 3y agoInteresting. Wouldn't it be more strictly 2^(n*(2^m)) size where m is the number of dimensions?
- delta_p_delta_x 3y agoI meant 2^n along one side, strictly in two dimensions (which is generally the most common texture layout). In other words, square tiles.