Lens flares ray-traced through 11 real lens designs every frame: ghosts, starburst, glare and haze that follow the light, the f-number and the lens. 22 presets, one Volume, Unity 6 URP.URP 17.3 with Render Graph on Unity 6000.3.21f1. Built-in and HDRP are not supported. Needs compute shaders, HDR and the camera depth texture (Tools > Real Optics > Set Up Scene switches them on). WebGL, GLES and VR are not supported in 1.0.Real Optics computes the lens flare from a real optical design instead of stacking sprites. Every frame the light of the sun and of the lamps you choose is ray-traced through the glass surfaces of the selected lens, so each ghost moves, changes shape and changes colour the way it does in a real camera. For the Universal Render Pipeline (URP 17.3, Render Graph) in Unity 6000.3.GHOSTS FROM 11 REAL LENS DESIGNS- Each ghost is an image of the iris after two reflections inside the lens: it slides along the line through the light and the frame centre, keeps the shape of the iris, and is clipped by the lens rims at steep angles into cat-eyes, cones and crescents.- Its colour comes from the anti-reflection coating at the real angle of every ray (uncoated, single-layer, multi-layer, nano), with rainbow edges from the dispersion of the glass.- Stopping down shrinks and sharpens the ghosts and lengthens the diffraction star; changing the lens changes the whole constellation.- 50 mm, 58 mm, 85 mm, wide 28 mm and 20 mm, telephoto 135 mm, fisheye 16 mm, a 28-85 mm zoom with 27 surfaces, an uncoated triplet and a smartphone lens. The designs come from expired patents, listed in the documentation; the names are generic.EVERYTHING ELSE A LENS DOES- A spectral starburst computed from the iris (blades, curvature, dust and scratches) and a burnt source core.- Lens glare, soft rays and veiling glare over the whole frame, in HDR before tonemapping; they replace Bloom, and a lens hood cuts sources outside the view.- Barrel ring, lens dirt, smudge streaks, film halation, CCD smear and the reflections of the camera body's infrared-cut filter (Film, Mirrorless, Cinema, Phone).- Anamorphic squeeze up to 2x with oval ghosts and a horizontal streak with beads.- Imperfect glass: decentred elements, coating drift, dust, surface ripple.- Atmospheric haze from clean air to thick fog: an aureole round the sun, light shafts through gaps, a halo round every lamp.LAMPS, PANELS AND TUBES- Add Real Optics Light to any lamp or fixture with one command: the light and its glowing mesh are found automatically, and ghosts, starburst and glare follow the outline of a bulb, panel, disc or tube.- The brightest lamps the camera actually sees are chosen every frame by measured visibility, with hysteresis and fades, so a flickering lamp or a passing object does not make flares pop.- Every other bright pixel can get ghosts from the same lens through a screen-space layer.STAYS IN THE SCENE- The source's outline is tested against the depth buffer: roofs, leaves and passing objects fade the flare smoothly.- The flare is composited as light in HDR, so your tonemapping treats it like the rest of the image.SIMPLE TO USE- Tools > Real Optics > Set Up Scene: one click and one Undo step adds the renderer feature, switches on HDR, the depth texture and post-processing, and creates a volume with a ready look.- 22 presets: lenses, atmosphere, cameras, space and sci-fi, artistic. Apply one, then turn the Character knob from Clinical to Dreamy, and Save as Preset keeps your own look.- The inspector shows the short list that covers most looks; Show all settings opens the whole lens model.- Everything is a URP Volume override: it blends between volumes, so a cave can use a different lens than the valley, and scripts change it like any override.- Creative controls when physics is not the point: tint, hue shift, sun temperature, lens character for new ghost constellations, and clearly labelled non-physical effects such as prism, bokeh and glitch.QUALITY LEVELS- Low and Medium for games, High for stills and cinematics, Cinematic for offline renders. Cost at 2560x1440 on an RTX 3080 Ti, sun only: about +2 ms at Low, +2-3 ms at Medium, +6-8 ms at High, +30 ms at Cinematic; four traced lamps at night: about +5, +7, +28 and +115 ms.AI Ready. Built to be driven by AI coding agents as well as by hand. Documentation/AGENTS.md gives Claude Code, Codex, Cursor or a Unity MCP bridge the exact entry points: the RealOpticsVolume override and its parameters, the 22 presets as plain Volume Profile assets, the RealOpticsLight component, the Tools > Real Optics menu commands and a verification procedure, so an agent can add, tune and check the flare without guessing.WHAT IS IN THE PACKAGE- The renderer feature, the Volume override, Real Optics Light, 11 lens designs, 22 presets, the editor tools, a demo scene, a manual, a changelog and third-party notices.- The demo scene is a simple one built from primitives: a low sun, dark blocks, a tower the sun passes behind and two lamps. Open it, run Set Up Scene once and press Play. The levels shown in the video and the screenshots are from the publisher's own game and are not part of this package.Requirements: compute shaders, HDR and the camera depth texture (Set Up Scene switches the last two on). WebGL, GLES and VR are not supported in 1.0.SupportQuestions, bug reports and ideas: cgteamorg@gmail.com. If Real Optics serves you well, a rating on this page helps other developers find it - optional, and nothing depends on it.Built and tested with Unity 6000.3.21f1 and the Universal Render Pipeline 17.3 with Render Graph, on Windows. Built-in RP and HDRP are not supported.Dependencies: none beyond URP. No third-party code or content.Contents: one URP renderer feature, one Volume override (Real Optics / Lens Flare), one component (Real Optics Light), editor tools under Tools > Real Optics.Shaders: RealOpticsFlare.shader and the compute tracer RealOpticsTrace.compute, loaded from Resources/RealOptics.11 lens designs (JSON), 22 presets (Volume Profiles), one demo scene of primitives with its profile, three small prefabs, five simple materials and a camera script. No textures or models are shipped; starburst and dust patterns are computed at run time. An optional custom iris or dirt texture can be assigned.Traced lights: up to 8 per frame. Quality levels: Low, Medium, High, Cinematic.Performance at 2560x1440 on an RTX 3080 Ti, Real Optics on minus off: sun only +2 ms (Low), +2-3 ms (Medium), +6-8 ms (High), +30 ms (Cinematic); four traced lamps about +5, +7, +28 and +115 ms.Scripting: volume.profile.TryGet(out RealOptics.RealOpticsVolume ro); ro.fNumber.Override(8f); RealOptics.URP.RealOpticsRuntime.SunOverride forces a light as the sun.Overlay cameras do not draw a second flare; their base camera carries it.Documentation: RealOptics-Manual.md, AGENTS.md (for AI coding agents), CHANGELOG.md, ThirdPartyNotices.md. Editor interface in English.AI was used as a development aid; no AI-generated image, texture, model or audio is shipped in this package, which ships no textures at all. The C# code, shaders and documentation were written with AI coding assistants under the publisher's direction and reviewed and tested by the publisher. The 11 lens designs are numerical prescriptions from the examples of expired patents, listed in Documentation/ThirdPartyNotices.md, not generated. The store screenshots and key images are renders of the package with captions added. For the promo videos, the background music was generated with Stable Audio 3 and the background of the vertical video's poster was made with an image generator, with the real flare of the package added on top; neither is part of the package.


