ACEScg AP1 Linear Color Science, Gamut Compression & Metal Tetrahedral 3D LUTs
Grading 4K60 footage on Liquid Retina XDR displays without clipped neon highlights or washed-out Rec.709 web exports requires scene-linear math from decode to final Output Transform. Below is the CIE 1931 matrix algebra, gamut compression, and 4-tap tetrahedral LUT kernel running in Apple Silicon Unified Memory.
1. Input Device Transforms (IDT) & Bradford White-Point Adaptation to D60
Camera log encodings (S-Log3, LogC4, Apple Log) map high-dynamic-range sensor stops into 10-bit integer code values. Inverting the piece-wise log curve recovers scene-referred linear reflectance, after which a 3x3 primary conversion combined with Bradford cone-response chromatic adaptation (mapping D65 [0.3127, 0.3290] to ACES D60 [0.32168, 0.33767]) places every clip into a unified RGBA16Float working space:
RGB_ACEScg = M_(XYZ_D60 -> AP1) * M_Bradford(D65 -> D60) * M_(CamPrimaries -> XYZ_D65) * f_inv_log(CV_10bit)
// Optical defocus, motion blur, and Porter-Duff over compositing:
C_out = C_fg + (1.0 - alpha_fg) * C_bg // Exact photon superposition in linear AP12. Branch-Free 6-Subsimplex Tetrahedral 3D LUT Kernel in Metal
Given normalized shaper coordinates (r, g, b) in [0, N-1]^3 (typically N = 33 or 65) with integer lattice base (i, j, k) and fractional remainders (dr, dg, db), ordering dr, dg, db selects one of 6 Kuhn tetrahedra sharing the neutral diagonal (0,0,0) → (1,1,1)—eliminating trilinear color banding on skin tones and gradients:
// Example subsimplex dr >= dg >= db (4 lattice fetches instead of 8):
C_interp = (1 - dr) * LUT[i, j, k ]
+ (dr - dg) * LUT[i+1, j, k ]
+ (dg - db) * LUT[i+1, j+1, k ]
+ db * LUT[i+1, j+1, k+1]
// Along neutral gray (dr == dg == db), middle terms vanish -> exact 1D diagonal interpolation3. Reference Gamut Compression & H.273 NCLC Tagging
Narrow-band LED concert lights often produce negative channel excursions inside AP1. Applying ACES 1.3 achromatic-axis hyperbolic distance compression brings out-of-gamut saturated highlights smoothly inside the unit gamut boundary before applying the Display P3 (NCLC 9-1-1 / 9-16-9) or Rec.709 (NCLC 1-1-1) Output Device Transform—preventing QuickTime gamma-shift surprises.
4. Interactive Creative & Publishing Stack TCO Calculator
Compare recurring multi-tool SaaS spend against Destiny’s unified macOS + Browser studio subscription.
Cite reproducible Apple M4 Pro Unified Memory benchmark receipts in engineering repositories.
ACEScg Color Science & Metal 3D LUTs — FAQ
Direct answers on scene-linear compositing, 4-tap tetrahedral LUT accuracy, AP1 vs AP0 primaries, and QuickTime NCLC color tagging.
- Why does alpha-blending or Gaussian blurring in gamma-encoded sRGB produce dark fringes?
- Physical photon flux adds linearly, whereas sRGB applies an approximate x^(1/2.2) opto-electronic transfer curve. Averaging gamma-encoded red (1, 0, 0) and green (0, 1, 0) at 50% yields (0.5, 0.5, 0), which decodes to only 0.5^2.2 = 21.8% physical luminance instead of 50%—creating muddy dark halos until converted to scene-linear ACEScg AP1.
- Why use tetrahedral interpolation instead of hardware trilinear texture sampling on 33x33x33 3D LUTs?
- Trilinear interpolation blends all 8 corners of a LUT lattice cube, introducing diagonal cross-coupling creases along the neutral gray axis (R = G = B). Subdividing each cube into 6 Kuhn tetrahedra along the main diagonal evaluates exactly 4 vertices per pixel, preserving neutral-axis linearity with fewer memory fetches in Metal compute kernels.
- Why render in ACEScg (AP1 primaries) rather than archival ACES2065-1 (AP0 primaries)?
- ACES2065-1 AP0 encloses the entire CIE 1931 spectral horseshoe using imaginary primaries outside visible locus, which can cause negative RGB lobes under component-wise multiplication. ACEScg AP1 pulls primaries close to the spectral locus (exceeding Rec.2020 and Display P3) so shader math behaves predictably in 16-bit half-float (RGBA16Float).
- Does Destiny Cinema Studio export standard color-tagged ProRes and H.264/HEVC deliverables?
- Yes. Native Apple Silicon VideoToolbox encoding tags output bitstreams with exact ITU-T H.273 color primaries, transfer characteristics, and matrix coefficients (Rec.709, Display P3, or Rec.2020 PQ/HLG) so QuickTime, Safari, YouTube, and broadcast monitors match frame-for-frame.