Moiré Simulation

Real-time analytical LED-wall moiré simulation (StageTwinMoire + XRStageMoire bridge). Computes moiré per pixel from the camera optics, sensor sampling, and LED grid, displaying it only on the camera monitor—never in the VR headset view.

How the model works

  • Analytical per-pixel model: Evaluates thin-lens defocus, diffraction, sensor pixel aperture, optional 4-dot OLPF, 3×3 downscale (12K → 4K), and 60 half-plane LED grid harmonics (HarmonicsK = 5) into aliased beat frequencies.
  • Physical behavior: Focusing near the LED wall and stopping down the aperture strengthens the pattern; defocusing blurs it out.
  • Foreground masking: A pixel receives moiré only when its custom stencil equals 200 and the wall is the visible surface (scene depth matches custom depth within max(1 cm, 0.2%)). Actors and props in front of the wall keep their normal look.

Stage setup

Requires r.CustomDepth=3 in Config/DefaultEngine.ini (see Requirements).

  • AXRStageMoireWall (subclass of AXRStageLEDPanel): Use for the curved main LED wall.
  • Its UXRStageMoireWallComponent enables Custom Depth Stencil 200 and keeps bSyncFromSurface on by default, automatically copying Shape, PitchMm, CylinderRadiusMm, ArcLengthCm, and HeightCm from UXRStageLEDSurfaceComponent. Edit wall hardware dimensions once on the LED surface (or click SyncNow); turn bSyncFromSurface off to enter values manually.
  • AXRStageMoireCamera (subclass of AXRStageCineCamera): Adds Moire (UMoireCameraComponent) and MonitorCapture (USceneCaptureComponent2D).
  • On load, empty slots under Moire → Defaults auto-fill from /StageTwinMoire (RT_MoireMonitor, MPC_Moire, M_PP_Moire) and WallActor binds to the first AXRStageMoireWall in the level. Anything you assign yourself is kept.
  • When no lens is mounted on the camera, the monitor automatically pauses and clears to black while LED wall frustum tracking continues (see Accessories).
  • AXRStageMoireMonitor: Standalone 25 × 47.5 cm screen plane showing RT_MoireMonitor (ScreenMaterial defaults to /StageTwinMoire/M_MonitorScreen). Place it on a desk/stand or attach it to the camera in the Outliner.

Display modes & punch-in zoom

Configured on AXRStageMoireCamera → Moire component (Blueprint-callable via SetMode, SetZoom, SetPunchInCenter):

Mode View Notes
0 Off Plain camera scene (pass-through).
1 Pattern (default) Scene multiplied by the moiré factor F. Use for normal rehearsal.
2 Heatmap Visible moiré risk overlay: green < 0.5%, yellow 0.5–2%, red ≥ 2% (40% blend). Costs more GPU time.
3 Debug F Raw moiré factor (for numerical validation).
4 Debug V / P / dir Visibility, period (P / 64), and direction (dir / 180). Costs more GPU time.
5 Debug summary Total / screen-door / visible moiré channels. Costs more GPU time.
  • Zoom:
  • 0 = Overview: whole 4K frame with a display prefilter matching what a camera monitor can actually resolve.
  • 1, 2, 4… = Punch-in: 1 maps 1 monitor pixel to 1 output pixel; higher values magnify further. Centered on PunchInCenter (output 4K pixels from optical center, +Y up).
  • ExposureEV: Manual exposure compensation for the monitor capture (prevents auto-exposure from pumping; does not change moiré strength). If you change LED wall brightness, adjust ExposureEV by log2(old / new).
  • Note: Do not manually edit MonitorCapture FOV or post-process settings—the driver overwrites them every tick.

Parameters reference

Optical & visibility model (Moire|Model)

Property Default Meaning
WavelengthUm 0.55 Reference wavelength (µm) for the diffraction cut-off.
SensorPx 12288 × 6480 Native sensor resolution (keep matched to the 27.03 × 14.25 mm filmback).
HarmonicsK 5 LED grid harmonics per axis (60 half-plane harmonics at 5).
VisP0 6 Period (output px) where a beat is half as visible (assumed).
VisN 4 Steepness of the visibility curve (assumed).
bOlpf false Optional 4-dot optical low-pass filter (assumed off).
ThresholdYellow 0.005 Heatmap yellow threshold, 0.5% (assumed).
ThresholdRed 0.02 Heatmap red threshold, 2% (assumed).

LED wall (Moire on MoireWall)

Property Default Meaning
Shape Cylinder (on stage) Plane or Cylinder. Synced from UXRStageLEDSurfaceComponent when bSyncFromSurface is on.
PitchMm 2.6 LED pixel pitch (mm)—primary driver of moiré frequency.
Fill (0.30, 0.30) Square emitter size as a fraction of pitch (assumed).
CylinderRadiusMm 8500 Curved wall radius (mm); axis is wall Up, center lies in front of the wall.
ArcLengthCm, HeightCm 800, 350 Curved wall arc width and height (cm).
StencilValue 200 Must match the constant in M_PP_Moire.

Wall frame convention: Right = across LEDs, Up = LED rows, -Forward = toward the stage.

Camera inputs (automatic)

The driver reads Current Focal Length, Current Aperture, Manual Focus Distance, and Filmback (27.03 × 14.25 mm) directly from the camera's CineCameraComponent.

Performance & validation

  • Update rate (Moire|Performance): MonitorUpdateEveryNFrames (default 3; 1 = every frame, 0 = frozen). Multiple moiré cameras automatically stagger across different frames.
  • Validation & benchmarking (Moire|Validation):
  • ExportPath: set a .npy file path to export the monitor render target as float32 [H, W, 4] after ExportDelayFrames (default 8), then clears automatically.
  • BenchmarkCaptures: set a count (e.g., 100) to time Mode 0 pass-through against Mode 1 overview and punch-in; results appear in BenchmarkReport and the Output Log.

Quick test recipes

  • Strong moiré: 35 mm lens, f/4, wall and focus at 6 m, Mode = 1 (or Mode = 2 for heatmap), Zoom = 0.
  • Quiet spots: dolly the camera back and forth with the wall in focus at f/8 (on 35 mm, near-zero moiré around ~6.9 m and ~13.8 m).
  • 1:1 pixel check: set Zoom = 1 or 4 and pan PunchInCenter to inspect a specific region.

Validation and current limits

  • Numerical verification: Validated against the reference Python brute-force and analytic simulators (correlation ≥ 0.99998 across cases A–F and curved cylinder geometry).
  • Not validated against real footage: Emitter fill (0.30), VisP0 / VisN, heatmap thresholds, OLPF off, and 3×3 bin downscale are assumed values and have not yet been calibrated against real LED-wall camera footage.
  • Single curved main wall only: The shader models one wall; ceiling and side panels get no moiré, and flat walls log a warning (frame-axis mismatch with the engine plane).
  • Unmodeled effects: Color moiré, LED refresh banding, 8K/12K recording modes, lens aberrations, and in-camera sharpening are not modeled.
  • Known artifacts & pending checks: A faint depth-mask halo can appear at foreground silhouettes; full VR headset verification (confirming zero moiré leakage into the VR view across all modes under forward shading + TAA) is still pending.