core / article
How Light Guns Work: CRT, IR and Camera Tracking
Technical guide to photodiodes, target flash, raster timing, positional controls, infrared geometry, camera borders and USB input.
About this guide
Technical guide to photodiodes, target flash, raster timing, positional controls, infrared geometry, camera borders and USB input.
1. Three different families, often given one name
1.1 Gun emits light, target senses it
Rayolite-era systems reverse the direction assumed by most video-game explanations. The trigger briefly lights a bulb in the gun; a lens projects that pulse along the sights; a photoelectric cell in a physical target closes the scoring/animation circuit.[1] The gun is an emitter and the target is the receiver. Mechanical scenery, belts, relays, counters and sound effects create the gallery response.
This family does not measure screen coordinates and is not display-dependent. Its optical link merely answers “was the photosensitive target illuminated while a valid shot window was open?” Anti-cheat circuits were historically important because a room lamp could otherwise operate a photocell.[2]
1.2 Traditional video lightgun: gun senses the display
Brown Box/Odyssey, Zapper, Super Scope, GunCon and many arcade guns place a photocell, phototransistor or photodiode behind a lens in the barrel. The display emits; the gun receives. However, “CRT lightgun” hides two materially different schemes:
- Brightness / target-flash detection. The software blanks the screen, then presents one white target or a sequence of white masks. A light/no-light result tells the game whether a target occupied the sight line. Nintendo’s patent deliberately checks a black interval before the white mock target and filters for a signal related to television sync, reducing false hits from steady ambient light.[3] This can identify an object without ever returning a full coordinate.
- Raster-time coordinate detection. The game shows a bright raster (often a white frame). The sensor produces a pulse when the scanning beam crosses the small region seen through the barrel. Hardware measures elapsed time from vertical frame start and/or counts horizontal scan lines; the phase within a line gives X and the line count gives Y. Nintendo’s Super Scope documentation and later PC-lightgun patents explicitly describe horizontal/vertical counters or sync-fed processing.[4][5]
Some products combine ideas: screen flash ensures a strong, known optical signal, while beam timing determines where in the raster it was seen. Therefore “all old guns only looked for a white box” and “all old guns returned X/Y from scanline timing” are both over-generalizations.
1.3 Pointer systems: gun observes references, not target pixels
Modern display-independent systems usually place a camera in the gun and make the gun observe geometry:
- two IR clusters or points near the display (Wii, AimTrak);
- four IR points around the display (GUN4IR, OpenFIRE);
- a visible quadrilateral border surrounding the image (Sinden).
Calibration estimates a mapping from camera observations to screen coordinates. With four corners or a border, software can solve a perspective transform (homography) and compensate for viewpoint/rotation more directly than a single bar. With fewer markers, firmware combines known marker spacing, tilt estimates and a user calibration model. These are absolute optical pointers wearing gun ergonomics. They work on LCD/OLED because tracking references, rather than CRT phosphor timing, define aim.[6][7][8][9][10]
External-camera systems are another pointer class: a camera near the display can track LEDs, colored shapes, retroreflective markers or the controller body. The geometry is inverted—camera outside, marker on gun—but it still estimates pose and intersects the gun’s pointing ray with a calibrated screen plane. Computer vision may add marker recognition, contour detection or pose estimation; it does not turn the display into a CRT-like optical target.
2. How CRT raster timing works
A conventional raster CRT forms a picture by steering an electron beam across phosphor from left to right, line by line, then returning for the next frame/field. Horizontal sync marks line rhythm; vertical sync marks field/frame rhythm. The viewer sees a complete image because phosphor and human vision integrate repeated excitation, but a fast photodetector sees a brief intensity event as the beam passes its field of view.
For a simplified timing gun:
- Trigger closes a switch.
- Game waits for a controlled video interval and may output black to reject ambient/previous-frame light.
- Game outputs a bright raster or target mask.
- Barrel optics restrict the detector’s angular field of view.
- Detector pulse is compared with video sync.
Yis inferred from elapsed lines after vertical sync;Xfrom elapsed time after the current horizontal sync. Calibration maps those raw counts to game coordinates.[11][12]
The detector and analog front end matter. A photodiode/phototransistor alone is not “position aware”; optics, gain, thresholding and filtering turn received light into a digital edge. The NES Zapper hardware, for example, reports trigger and light state rather than an X/Y packet, and its filtering favors CRT scan-frequency changes over slowly varying illumination.[13]
Screen-flash trade-offs
A flash provides high contrast and a known timing pattern, improving detection and rejecting ambient light. Costs include a visible flicker, one or more frames between trigger and verdict, photosensitivity/accessibility concerns, and complexity for several simultaneous targets. Nintendo’s patented black-then-white sequence is direct primary evidence for this approach.[14]
Sources
- US2007082A — Marksmanship practicing means
- Seeburg Shoot the Bear / Rayolite history
- US4813682A — Video target control and sensing circuit for photosensitive gun
- Super Nintendo Entertainment System Development Manual, Book II, Section 4
- US6171190B1 — Photosensitive input peripheral device in a personal computer-based video gaming platform
- US8313379B2 — Video game system with wireless modular handheld controller
- AimTrak Setup Guide
- About the GUN4IR Lightgun System
- OpenFIRE Light Gun — Open Source Light Gun Firmware & GUI
- Sinden Lightgun Details
- Super Nintendo Entertainment System Development Manual, Book II, Section 4
- US6171190B1 — Photosensitive input peripheral device in a personal computer-based video gaming platform
- Zapper hardware documentation
- US4813682A — Video target control and sensing circuit for photosensitive gun