A Randomized Illumination Grid for Material Exploration

Justin Hong

March 25, 2025

Abstract

AI generation has made complex 3D geometry cheap to produce, but evaluating how a form reads under different lighting conditions remains a slow, intuition-dependent process. This paper describes a tool that addresses this gap: an infinite, pannable grid in which each cell renders the same geometry class under an independent, seeded-random lighting and material configuration. The tool is grounded in psychophysical evidence that surface quality judgments are relational rather than absolute, and that simultaneous presentation of a dense configuration sample accelerates the formation of perceptual vocabulary. The background of this page is a live instance.

Specimen Geometry

A useful specimen geometry must be complex enough to express lighting variation while carrying no semantic associations that would bias material judgments. A torus knot $T(p,q)$ satisfies both criteria.

$T(p,q)$ is a closed curve on $\mathbb{T}^2$, defined for coprime integers $p, q$ (i.e. $\gcd(p,q) = 1$) by the winding numbers: $p$ longitudinal revolutions through the hole, $q$ meridional revolutions around the tube. The embedding $\boldsymbol{\gamma} : [0, 2\pi) \to \mathbb{R}^3$ is:

$$\boldsymbol{\gamma}(t) = \begin{pmatrix} \bigl(\cos qt + 2\bigr)\cos pt \\ \bigl(\cos qt + 2\bigr)\sin pt \\ -\sin qt \end{pmatrix}$$
(1)

The rendered surface is the tubular neighborhood of $\boldsymbol{\gamma}$ at fixed radius $r$. Two constraints determine the valid domain. First, $T(1,q)$ is the unknot for all $q$, so $p \geq 2$ is required for non-trivial topology. Second, $T(p,q) \cong T(q,p)$, so the canonical form enforces $q > p$ to avoid duplicates:

$$p \geq 2, \quad q > p$$
(2)

Upper bounds on $p$ and $q$ are set as named implementation constants and control tessellation adequacy: at 256 tube segments, higher winding numbers produce crossings too dense to resolve visually at cell size. Geometries are built on demand and cached by $(p,q)$ key; no fixed pool is used.

Parameter Space

Each cell is determined by a configuration vector $\mathbf{v} \in [0,1]^n$ drawn via a seeded PRNG. The seed is $H(\text{col}, \text{row})$ where $H$ is a Thomas Wang integer hash composed with Mulberry32, giving a uniform, deterministic map over $\mathbb{Z}^2$. Every component is a raw $U[0,1]$ sample scaled linearly to its physical range at render time by a single named constant (e.g. $\texttt{LIGHT\_INT\_MAX} = 5$). No sub-range clipping or conditional draws are used.

Geometry. Two draws mapped to integers satisfying $p \geq 2$, $q > p$, within tessellation bounds. Geometry is built on demand and cached by $(p,q)$ key.

Material. Fourteen draws covering hue, saturation, and lightness of the object color and emissive channel; roughness; metalness; clearcoat; clearcoat roughness; emissive intensity. All map directly to $[0,1]$ material parameters or to their full physical ranges.

Illumination. One draw partitions $[0,1)$ into three equal bins selecting light type; one draw maps to source count $n \in \{1,2,3,4\}$. Seven draws per source (hue, saturation, lightness, intensity, $x$, $y$, $z$) are always made for all four slots; unused slots are zeroed at apply time. Hemisphere sources receive six additional draws for sky and ground color.

Motion. Five draws: $\omega_y$ magnitude and sign, $\omega_x$, oscillation amplitude $A$, and phase $\phi$. Motion is structurally important: the moving terminator line makes light direction legible without additional annotation.2

The Grid as Instrument

Judgments of surface brightness are not absolute: Gilchrist et al.'s anchoring theory shows that perceived lightness is determined by a surface's luminance ratio relative to the highest-luminance region in its immediate framework, not by its physical luminance value.3 Evaluating a single lighting configuration in isolation removes that anchor and makes the judgment unreliable. The grid restores it by providing many simultaneous anchors.

Fleming, Dror, and Adelson found that observers infer surface reflectance properties by implicitly matching a scene's illumination against a prior built from natural illumination statistics.4 When only one configuration is visible, that prior dominates and suppresses variation; when many are visible simultaneously, variation across cells disrupts the prior and forces more direct comparison. The grid exploits this: adjacent cells share geometry but vary illumination and material jointly, making the contribution of each factor easier to isolate.

Pellacini et al. showed that identical PBR parameters produce substantially different perceived material qualities under different lighting conditions.1 The same metalness value reads as polished metal under a focused directional source and as painted plastic under broad hemisphere fill. Color order systems such as Munsell and NCS address an analogous problem in the color domain by organizing a perceptual space into a navigable sample grid.5 The format here applies the same logic to the joint space of illumination and reflectance.

Implementation

A single shared WebGL renderer uses scissor-based multi-viewport rendering to avoid exceeding the browser context limit. Visible cells $(c, r)$ satisfying $\text{pan}_x \le c \cdot w \le \text{pan}_x + v_w$ (and analogously for rows) are rendered each frame. The address space is infinite via $\mathbb{Z}^2$ cell coordinates feeding $H$ directly; no cells are cached or stored. Built with Three.js r128.


References

  1. Pellacini, F., Ferwerda, J. A., & Greenberg, D. P. (2000). Toward a psychophysically-based light reflection model for image synthesis. Proceedings of SIGGRAPH 2000, 55–64.
  2. Ramachandran, V. S. (1988). Perception of shape from shading. Nature, 331(6152), 163–166.
  3. Gilchrist, A., Kossyfidis, C., Bonato, F., Agostini, T., Cataliotti, J., Li, X., Spehar, B., Annan, V., & Economou, E. (1999). An anchoring theory of lightness perception. Psychological Review, 106(4), 795–834.
  4. Fleming, R. W., Dror, R. O., & Adelson, E. H. (2003). Real-world illumination and the perception of surface reflectance properties. Journal of Vision, 3(5), 347–368.
  5. Hard, A., & Sivik, L. (1981). NCS — Natural Color System: A Swedish standard for color notation. Color Research & Application, 6(3), 129–138.