Skip to content

Back to the project page

Honeycomb-Surfels (Hexels)

Why Hexels? The theory, animated

A Hexel is a flat patch with a soft hexagonal edge and a linear color. The animations below show what a Hexel is, why its color is linear, why it is a hexagon, and how errors combine in a pixel. The analysis follows Appendix G of the paper for a fixed viewing direction: it describes what Hexels can represent, not what training is guaranteed to reach.

In the paper: Section 3 and Appendix G (Why Hexagons and Spatial Color?).

What is a Hexel?

A hexagon with a marked center and two scaled axis arrows stretches, turns and returns to its shape. A color gradient then fills it from the center, turns once around the center while its strength pulses, and drains away.

Placing and coloring one Hexel

A Hexel maps its local coordinates \((u,v)\) into 3D and colors them linearly:

\[ \begin{gathered} P(u,v)=\mathbf{p}+s_u\mathbf{t}_u\,u+s_v\mathbf{t}_v\,v,\\ \mathbf{c}^{\mathrm{sp}}(u,v)=\mathbf{c}_0+u\,\mathbf{g}_u+v\,\mathbf{g}_v. \end{gathered} \]

The scales \(s_u,s_v\) stretch the patch and the tangents \(\mathbf{t}_u,\mathbf{t}_v\) orient it about its center \(\mathbf{p}\). The color is \(\mathbf{c}_0\) at the center and changes by \(\mathbf{g}_u\) and \(\mathbf{g}_v\) per unit step along the two axes (swatches). A V1 Hexel has 20 parameters, nine of them for color.

In the paper: Section 3, Eqs. (1) and (4), and the center panel of Figure 2. The parameter count is in Appendix A.

As a sharpness slider moves between 2 and 32, a heat map of one Hexel's support weight turns from a blurry bump into a crisp hexagon and back, while its profile always crosses one half at the hexagon's edges.

Sharpness without moving the edge

The support weight \(K\) sets how strongly a Hexel covers each point. It is a sigmoid \(\sigma\) of a hexagonal distance \(d\) that is negative inside, zero on the boundary and positive outside:

\[ \begin{array}{l} d(u,v)=\max\bigl\{|v|,\,\bigl|\tfrac{\sqrt3}{2}u+\tfrac12v\bigr|,\\ \qquad\bigl|\tfrac{\sqrt3}{2}u-\tfrac12v\bigr|\bigr\}-1,\\ K(u,v)=\sigma\bigl(-\beta\,d(u,v)\bigr). \end{array} \]

The sharpness \(\beta\) turns \(K\) from a soft bump (\(\beta=2\)) into a nearly solid hexagon (\(\beta=32\)), but the boundary never moves: there \(d=0\), so \(K=\sigma(0)=\tfrac12\) for every \(\beta\) (open circles).

In the paper: Section 3, Eqs. (2) and (3), and the right panel of Figure 2.

Flat hexagonal patches appear one by one on a gently curved sheet until 23 cover its middle, shading from cyan on the left to peach on the right, with mauve and pink along the near edge. The view then turns and the patches shrink away.

Flat Hexels on a curved surface

Flat Hexels with linear color can together represent a smoothly colored curved surface. Each Hexel lies in the surface's tangent plane at its center \(\mathbf{p}\) and copies the value and slopes of the texture \(\mathbf{f}\) there:

\[ \begin{gathered} \mathbf{c}_0=\mathbf{f}(\mathbf{p}),\\ \mathbf{g}_u=s_u\,\partial_1\mathbf{f}(\mathbf{p}),\quad \mathbf{g}_v=s_v\,\partial_2\mathbf{f}(\mathbf{p}), \end{gathered} \]

with \(\partial_1,\partial_2\) the slopes along the two tangents. In this example every corner color stays within 0.023 of the texture (on a 0 to 1 scale), so neighboring Hexels nearly agree where they meet.

In the paper: the left panel of Figure 2, and Section 3, Eqs. (1) and (4). The Taylor coefficients are Eq. (30) in Appendix G.

Why a linear color field

A flat line and the tangent line approximate a smooth curve around one point over a window that grows and shrinks. The tangent line stays within the tolerance on a window about 3.8 times wider, as an error plot with dashed bounds shows.

Constant versus linear color

A linear color stays accurate over a much wider window than a constant one. For one color channel \(f\) near a patch center \(p\), compare the constant \(f(p)\) with the tangent line \(\ell_p(x)=f(p)+f'(p)\,(x-p)\) on a window \(|x-p|\le r\):

\[ \begin{gathered} |f(x)-f(p)|\le L\,r,\\ |f(x)-\ell_p(x)|\le\tfrac12 M r^2, \end{gathered} \]

where \(L\) bounds the slope and \(M\) its rate of change. The constant's error grows linearly in \(r\) and the line's quadratically, so at tolerance \(\varepsilon=0.05\) the widest valid window (thick bar) has half-width 0.088 for the constant and 0.337 for the linear color, 3.8 times wider. This compares single color fields; blending several constant-color primitives can also vary the color.

In the paper: Appendix G, Proposition G.1 (Local error of an affine color field), Eq. (27) and the bound \(Mr^2/2\) stated with it. The constant-color bound \(Lr\) follows the proof.

Why a hexagon

An ellipse holds the largest stretched triangle, square and hexagon that fit inside it, with area bars of 1, 1.54 and 2. The hexagon turns, then becomes a Hexel whose two axes follow the ellipse as it stretches and tilts.

The largest patch in one error ellipse

If a matrix \(\mathbf{Q}\) bounds how fast the color's slope changes in each direction, a linear color that matches the target's value and slope at \(\mathbf{p}\) stays within \(\varepsilon\) of it on the ellipse

\[ E=\{\mathbf{p}+\mathbf{h}:\mathbf{h}^\top\mathbf{Q}\,\mathbf{h}\le2\varepsilon\}. \]

The largest hexagon inside \(E\) covers twice the area of the largest triangle and about 1.30 times that of the largest square, the only other regular shapes that tile the plane. With its axes along those of \(E\) and \(\lambda_1,\lambda_2\) bounding the slope's change along them, the Hexel scales

\[ s_u=\sqrt{\frac{3\varepsilon}{2\lambda_1}},\quad s_v=\sqrt{\frac{3\varepsilon}{2\lambda_2}} \]

put its six corners on \(E\). \(\mathbf{Q}\) describes the color, not the surface, and training does not estimate it.

In the paper: Appendix G, Proposition G.2 (Patch area within one error ellipse), Eqs. (32) to (34) and (38). Eq. (33) gives the largest areas, and the bound on \(\mathbf{Q}\) is Eq. (26) of Proposition G.1.

Equal area
Triangle, square and hexagon tilings with unit-area cells. The boundary of each center cell is traced at the same speed, and the hexagon closes first, with perimeter 3.722, against 4.000 for the square and 4.559 for the triangle.
Equal perimeter
Seven triangles, seven squares and seven hexagons, every cell with the same perimeter, grow into patches without gaps. Bars of the covered area relative to the triangles end at 1, 1.30 and 1.50, so the hexagons cover the most.

Least perimeter, most area

For the three regular tilings, a regular \(m\)-gon with perimeter \(P\) has area

\[ A_m=\frac{P^2}{4m\tan(\pi/m)}, \]

so the hexagon has the least perimeter at equal area and the most area at equal perimeter.

Equal area. Unit-area cells have perimeters 4.559 (triangle), 4.000 (square) and 3.722 (hexagon), so at the same tracing speed the hexagon closes first. The honeycomb theorem (Hales, 2001) extends this to every partition of the plane into equal-area cells: regular hexagons need the least boundary per cell.

Equal perimeter. Seven cells of equal perimeter cover 1, 1.30 and 1.50 times the triangles' area.

In the paper: the equal-area side in Section 3 (Hexagonal support), the equal-perimeter side in the Introduction, and the theorem again at the opening of Appendix G, all citing Hales (2001).

From primitives to pixels

A pixel's ray passes through three semi-transparent hexagons to a background panel while a stacked bar fills with their shares of the pixel color. Below, a bound bar stays longer than the pixel error bar, also as the alpha values change.

How Hexel errors reach the pixel

A pixel mixes the colors along its ray, so its error is at most the same mix of their errors. Hexel \(i\) contributes its opacity \(o_i\) times its support weight \(K_i\), capped at 0.99, \(\alpha_i=\min\{o_i\cdot K_i,\,0.99\}\), and the background \(b\) receives the remaining transmittance \(T\):

\[ \begin{gathered} w_i=\alpha_i\prod_{j\lt i}(1-\alpha_j),\\ T=\prod_i(1-\alpha_i). \end{gathered} \]

For the pixel \(I=\sum_iw_iC_i+T\,b\) and a target color \(f\),

\[ \begin{array}{l} \displaystyle \|I-f\|\le\sum_i w_i\,\|C_i-f\|\\ \displaystyle \qquad+\,T\,\|b-f\|. \end{array} \]

The bound holds for any norm and primitive shape. A small \(T\) still matters when \(b\) is far from \(f\), so every part, the background included, must approximate the pixel target.

In the paper: Appendix G, Proposition G.3 (Error under alpha compositing), Eq. (40). The renderer's compositing is Eq. (20) in Appendix B.

In short

A linear color stays within a color tolerance over a larger patch than a constant color does. Within that tolerance, the largest stretched hexagon covers twice the area of the largest stretched triangle and about 1.30 times that of the largest stretched square. Hexagons also tile the plane, with the least perimeter at equal cell area and the most area at equal perimeter. Where Hexels overlap, a pixel's error is at most the weighted sum of their errors and that of the background. So fewer, larger Hexels can represent locally planar regions with smoothly varying appearance.

In the paper: Appendix G, Propositions G.1 to G.3.

See the results

Back to the project page