Skip to content

Nodes · Blacksmith

BS_Lens

Blacksmithv1coreNeeds full input

Overview

The whole lens in one node, applied to CG in the light's own order: the glass (distortion; lateral, spectral and axial chromatic aberration; field curvature, astigmatism, coma and edge softness), the vignette, a diffusion filter in the matte box (Pro-Mist, Glimmerglass, Black Magic, Classic Soft presets: halos and a lifted black near bright sources without adding light), the Glare system (an energy-aware bloom, veiling, the starburst from the iris's blades, the anamorphic streak, film halation, a lit dirt plate), the Flare (a ghost train mirrored through the optical centre, the chromatic ring, the hotspot - every pixel of it light from a source pixel, never a sprite), light wrap over a bg, and the defocus through a real lens's pupil (the Kit's blades and their curvature, the cat's-eye, the Petzval swirl, onion rings, a signed spherical aberration, the anamorphic oval; one disc for the frame, or per pixel from the Kit page's focal length, T-stop, format and focus distance with a depth wire). Pick a kit on the Kit page: it writes every kit-driven knob with a lens family's character (authored from the lens's published look, never a measurement); edit any of them and the kit reads Custom; Load kit... / Save kit... read and write your own as JSON. Everything works from the image alone; the depth, drive, kernel, dirt and bg wires refine the stages that use them. Scene-linear in and out.

Inputs

InputWhat it takes
inthe image this node works on
depth—
drive—
kernel—
dirt—
bga clean background to reveal (optional — without one the node estimates it and says so)
masklimits the effect to this matte — the engine's universal mask slot, applied for every node that declares it

Outputs

OutputType
outImage

Parameters

ParameterTypeDefaultWhat it does
kitChoiceModern spherical cineThe lens. Picking one writes every kit-driven knob below; edit any of them and the kit reads Custom. Clean digital is every stage off. Clean digitalModern spherical cineVintage sphericalClassic anamorphic 2xModern anamorphicModern spherical + Pro-Mist 1/4Modern spherical + Pro-Mist 1/2Custom
formatChoiceSuper 35 16:9The sensor: sets the physical scale of everything measured in millimetres (the vignette's field angle, later the defocus). Custom reads sensor_w_mm / sensor_h_mm. Full Frame 3:2Full Frame 16:9Super 35 16:9Super 35 4-perfAPS-CMicro Four ThirdsMedium FormatAlexa 65Custom
sensor_w_mmFloat24.89Sensor width in mm, with format = Custom.
sensor_h_mmFloat14.0Sensor height in mm, with format = Custom.
focal_mmFloat50.0Focal length in mm: the field angle at the corner, so the natural (cos^4) vignette and, later, the defocus scale.
t_stopFloat2.8The iris. Mechanical vignetting clears as the lens stops down (stop_response); later the defocus size and the starburst.
focus_mFloat3.0Focus distance in metres: breathing, and the defocus with a depth wire (later).
squeezeFloat1.0Anamorphic squeeze (2, 1.33...). 1 = spherical. The distortion acts in the de-squeezed frame; later the oval bokeh and the streak axis.
exposureChoicecompensatedcompensated: the scatter takes from the core, the sum of light is unchanged; relative: scatter adds (the classic glow); absolute: compensated plus the lens's own transmission loss. (The Glare stage reads it; the Vignette page applies whenever enabled.) compensatedrelativeabsolute
centreFloat2[0.5, 0.5]The optical centre, as a fraction of the frame: every radial stage measures from here.
min_tFloat1.4The lens's widest stop: the iris is fully open here and the mechanical vignette strongest.
bladesInt11The iris's blades: the starburst's streak count (even blades: one streak per blade; odd: two), the ghosts' shape, later the bokeh's. 0 = a round iris, no streaks.
kit_fileTextThe lens kit file loaded or saved last (Load kit… / Save kit… on this page).
kit_notesTextThe loaded kit's name, source and notes, shown on this page.
distortion_onBoolfalseApply the kit's distortion.
distortionFloat1.0Scales the distortion coefficients (k1, k2, p1, p2); negative flips barrel and pincushion.
k1Float0.0Radial r^2 term: barrel below zero (edges shrink), pincushion above.
k2Float0.0Radial r^4 term - the corners' own bend.
p1Float0.0Tangential (decentring) term, Brown-Conrady p1: elements not quite coaxial.
p2Float0.0Tangential term p2.
breathingFloat1.0A scale about the centre with the focus pull: 1 = none; 1.02 = the frame grows 2% (a lens that breathes wider as it focuses close).
directionChoicedistortdistort applies the lens to CG so it matches a plate; undistort straightens a plate. distortundistort
edgeChoicefillWhat the distortion leaves at the frame's edge. fill: the frame zooms by the least that leaves no empty edge (a look); black: empty where the lens reached outside the input (a plate measured with overscan); repeat: the edge pixel stretched. fillblackrepeat
aberration_onBoolfalseApply the glass's aberrations.
ca_lateralFloat0.0Lateral chromatic aberration: red and blue scale oppositely about the centre, growing with the radius; the value is the red-to-blue separation in pixels at the corner.
ca_samplesInt33 = red, green and blue offsets; more = spectral: the fringe filled in with this many wavelengths along the glass's dispersion curve (5-9 for a strong CA; the cost grows with it).
ca_axialFloat0.0Longitudinal chromatic aberration: red and blue defocused by this many pixels everywhere, green sharp - the colour bokeh of a fast lens at the focus plane. (With a depth wire it will follow focus.)
field_curvatureFloat0.0Sharp centre, soft corners: a disc blur growing with the radius squared, this many pixels at the corner. Negative: a soft centre and sharp corners.
astigmatismFloat0.0The corner's blur stretched along the tangent (negative: along the radius), by this much at the corner (1 = twice as long).
comaFloat0.0The corner's blur drawn out along the radius into a comet, this many pixels long at the corner (negative: inward).
edge_softnessFloat0.0A plain resolution falloff toward the corners (the MTF dropping): a Gaussian of this sigma, in pixels, at the corner.
vignette_onBoolfalseApply the vignette.
opticalFloat1.0The natural cos^4 falloff of a lens, from the corner's field angle (focal length and format): 1 = cos^4, 0 = none, 2 = twice the exponent.
mechanicalFloat0.0Mechanical vignetting - the barrel and hood clipping the corners: how dark the corners go, 0-1, at the widest stop.
mech_radiusFloat0.95Where the mechanical falloff is centred, as a fraction of the half-diagonal (1 = the very corner).
mech_softnessFloat0.35The width of the mechanical falloff, as a fraction of the half-diagonal.
mech_roundnessFloat0.50 = the falloff follows the frame's shape, 1 = a circle about the centre.
stop_responseFloat1.0How fast mechanical vignetting clears as the lens stops down from min_t: 1 = two stops clear most of it, 0 = it never clears.
tintColor[1.0, 1.0, 1.0, 1.0]The colour of the darkened edge (a coating's warmth or coolness), applied in proportion to the falloff.
defocus_onBoolfalseDefocus through the lens's pupil: uniform in 2D, per pixel with a depth wire (the Kit page's focal length, T-stop, format and focus distance set the disc).
defocusFloat0.0Without a depth wire: the disc's radius in pixels at the frame's resolution (0 = none). With depth wired the thin lens sets the disc per pixel and this is ignored.
defocus_maxFloat64.0The largest disc, in pixels: the cost grows with its square; a depth wire's far background is capped here.
qualityChoicepreviewThe resolution the discs are gathered at: draft a quarter, preview half, final full. Sharp pixels (a disc under a pixel) stay full-resolution whatever the quality. draftpreviewfinal
blade_curvatureFloat0.3The iris's blades: 0 straight (a hard polygon), 1 curved to a circle.
rotation_per_stopFloat0.0The iris turns this many degrees per stop closed from the widest (the polygon rotates as the lens stops down; streak_rotation on the Glare page is the iris's own angle).
disc_softnessFloat0.0The disc's edge: 0 hard (a clean iris image), 1 soft (the disc fades to its rim).
spherical_aberrationFloat0.0The disc's density: + a bright rim (the soap-bubble bokeh of an over-corrected lens), - creamy (brighter in the middle). Flips across focus in a real lens; here one sign for the frame.
onion_ringsFloat0.0Moulded-asphere rings in the disc: their contrast (0 none).
ring_countInt6How many onion rings across the disc's radius.
swirlFloat0.0Petzval swirl: the discs stretch along the tangent and turn with it toward the corners, growing with the radius squared (1 = twice as long at the corner).
impressionFloat0.0A rim-only reshape (the ARRI Impression filters): + brightens the disc's outer ring, - darkens it.
lobesInt0The bare lens's lobed pupil toward the corners: this many lobes about the radial direction (0 none).
lobe_powerFloat0.5How deeply the lobes cut the disc at the corner (0 none, 1 to the centre).
cateyeFloat0.0Optical vignetting of the pupil: toward the corners the disc clips to a cat's-eye (the intersection of two circles, the second shifted toward the frame's centre by this fraction of the disc at the corner).
depth_unitsChoicemetresWhat the depth wire carries: distance in metres, centimetres or millimetres, or 1/z (inverse metres). metrescentimetresmillimetres1/z
focus_regionFloat0.0A band around the focus distance that stays sharp, in the wire's units (0 = the plane alone).
focus_falloffChoicesmoothHow the blur grows out of the focus region: linear or smooth. linearsmooth
front_multFloat1.0The disc in front of the focus plane, scaled (0 = the front stays sharp).
back_multFloat1.0The disc behind the focus plane, scaled (0 = the background stays sharp).
diffusion_onBoolfalseA diffusion filter in front of the lens: halos around bright sources, a lifted black near them, softened fine detail - without adding light.
diffusionChoicenoneThe filter. Picking one writes the knobs below from its published behaviour; edit any of them and it reads Custom. none turns the page off. noneBlack Pro-Mist 1/8Black Pro-Mist 1/4Black Pro-Mist 1/2Black Pro-Mist 1White Pro-Mist 1/4Glimmerglass 1Hollywood Black Magic 1/4Classic Soft 1Custom
diffusion_amountFloat0.06The fraction of the highlights' energy the filter scatters into halos (a 1/4 Pro-Mist about 0.06, a full one 0.2).
halo_radiusFloat0.1How far the halo reaches, as a fraction of the half-diagonal - wider and softer than the lens's own bloom.
contrast_liftFloat0.006The fraction of the highlights' energy spread flat over the frame: the black lift a filter gives near bright sources (a White Pro-Mist lifts more than a Black).
diffusion_kneeFloat0.5How bright a source must be to halo, in linear light: a Pro-Mist starts well below white (0.5); 1 = white and above.
highlight_onlyBoolfalseOnly sources above white halo (the knee raised to 1), as a Glimmerglass sparkles off the brightest points alone.
diffusion_softnessFloat0.0A softening of fine detail everywhere: a Gaussian of this sigma in pixels (the Classic Soft's lenslets; 0 = none).
diffusion_tintColor[1.0, 1.0, 1.0, 1.0]The halo's colour (a warm net, a straw filter).
glare_onBoolfalseThe scatter around highlights: bloom, veiling, starburst, the anamorphic streak, halation, dirt.
kneeFloat1.0Where a highlight starts to scatter, in linear light: a soft knee one unit wide (a value just over it scatters a little, one far over it scatters its excess). 0 = everything scatters a little, the physical case.
rolloffFloat0.0Compress the highlights above this before they scatter, so a core of 1000 does not own the frame (Optical Glow's Highlight Rolloff). 0 = off.
glare_sourceChoiceimageWhat the scatter comes from: the image's own highlights; the drive wire (an emissive pass, a matte of the sun); the image's alpha. imagedrivealpha
glare_saturationFloat1.0The scatter's colour: 0 grey, 1 the highlight's own, above it more.
bloomFloat0.0The multi-scale bloom: the fraction of the highlights' energy that scatters (0.05-0.3 reads as glass; 1 is a fog).
bloom_sizeInt6How far the bloom reaches: pyramid levels, each roughly doubling the radius (6 = a few hundred pixels at HD).
bloom_decayFloat0.6The weight of each wider level: 0.5 a tight core, 0.6 a lens, 0.85 a wide wash. The scale-free tail that reads as optical.
bloom_chromaFloat0.0Red scatters wider than blue, as glass does: 0 none, 1 strongly.
bloom_tintColor[1.0, 1.0, 1.0, 1.0]The bloom's colour (a coating's warmth).
veilingFloat0.0Veiling glare: a fraction of the highlights' energy spread flat across the frame - the contrast loss of an uncoated or dirty lens (0.005-0.02).
starburstFloat0.0The diffraction streaks from the iris's blades: how much of the highlights' energy goes into them.
streaksInt0How many streaks: 0 = from the blades (even blades: as many; odd: twice as many).
streak_lengthFloat0.25How far a streak reaches, as a fraction of the half-diagonal.
streak_falloffFloat0.35How fast a streak fades along its length: 0.2 a short bright spike, 1 a long even ray (the energy falls to 1/e every length x falloff).
streak_rotationFloat0.0The iris's orientation, in degrees: the starburst, the ghosts' polygons and the defocus discs all turn with it.
spectralFloat0.5Red streaks longer than blue - the diffraction pattern scales with wavelength: 0 white streaks, 1 the full rainbow.
streak_hFloat0.0The anamorphic streak: the long horizontal flare across the cylindrical front element.
streak_h_lengthFloat0.8The anamorphic streak's reach, as a fraction of the frame's width.
streak_h_thicknessFloat3.0The anamorphic streak's vertical softness, in pixels.
streak_h_tintColor[0.4, 0.6, 1.0, 1.0]The anamorphic streak's colour - the coating's blue.
streak_h_hazeFloat0.0The streak's haze: a wide, soft, dim band along the streak's line, as anamorphic glass throws around its sharp streak. 0 = none.
streak_h_haze_thicknessFloat0.15How tall the haze band is, as a fraction of the frame's height (0.05-0.4).
streak_h_haze_tintColor[0.35, 0.5, 1.0, 1.0]The haze's colour.
halationFloat0.0Film halation: the red return from the backing around a bright edge, on its dark side. Separate physics from the bloom; the two co-occur.
halation_kneeFloat1.0How bright a source must be to halate.
halation_radiusFloat0.05How far the halo reaches, as a fraction of the half-diagonal (16 mm shows more than 35; 65 barely).
halation_hueFloat0.20 = red (the deepest layer alone), 1 = orange (the green layer joins near a bright source).
halation_backingFloat0.5The anti-halation backing: 1 shortens and weakens the halo as a modern stock does, 0 is bare base (no remjet).
dirt_amountFloat1.0With a dirt wire: how much the front filter's smudge is lit by the scatter.
dirt_tintColor[1.0, 1.0, 1.0, 1.0]The lit dirt's colour.
flare_onBoolfalseThe reflection chain: the ghost train, the chromatic ring, the hotspot. Every pixel of it is light from a source pixel - never a sprite.
flareFloat0.0How much of the highlights' energy the ghost train carries (a modern coated lens 0.02-0.06, an uncoated vintage one 0.15).
flare_kneeFloat2.0How bright a source must be to ghost, in linear light: the sun, a practical, a specular - not a white shirt. Separate from the glare's knee.
ghostsInt6How many reflections in the train (0-16).
ghost_spacingFloat0.18The ghosts' positions along the line through the optical centre: ghost k sits at k x spacing times the source's offset, on the far side of the centre (1 = as far out as the source).
ghost_scaleFloat0.08The first ghost's radius, as a fraction of the half-diagonal: the size of the iris's image.
ghost_scale_stepFloat0.85Each ghost's radius relative to the one before: below 1 the train shrinks down the line, above 1 it grows.
ghost_tintColor[0.6, 0.8, 1.0, 1.0]The coating's colour: the first ghost's tint.
ghost_hue_stepFloat40.0Each ghost's hue turned this many degrees from the one before - the coating's colours cycling down the train.
ghost_chromaFloat0.2Dispersion: red, green and blue ghosts at three slightly different distances (0 white-edged ghosts, 1 rainbow fringes).
ghost_softnessFloat0.3The ghost's own defocus: 0 a hard-edged iris polygon, 1 a soft blob.
ringFloat0.0The chromatic ring: the source's light mirrored through the centre, through the aperture's rim - red outside, blue inside.
ring_radiusFloat0.45The ring's radius, as a fraction of the half-diagonal.
ring_widthFloat0.04The ring's width, as a fraction of the half-diagonal.
ring_hueFloat0.5How far red and blue split across the ring: 0 a white ring, 1 a full rainbow.
hotspotFloat0.0The bright core on the source itself: a tight glow the bloom's long tail does not give.
hotspot_sizeFloat0.02The hotspot's radius, as a fraction of the half-diagonal.
edge_reactionFloat0.0Ghosts brighten as the source nears the frame's edge (a hoodless lens): 1 doubles them at the corner.
ghost_trainTextThe ghost train as a list, one row per ghost: its shape, distance, size, colour, brightness, softness and dispersion. Empty = the train the knobs above make (Generate fills it from them).
occlusionFloat1.0With a drive wire: its alpha occludes the source - a sun behind a building does not ghost. 1 = fully, 0 = ignore the alpha.
wrap_onBoolfalseLight wrap with the bg wire: the background's light spilling onto the foreground's edge, so the lens is the last node over a plate. Needs bg wired.
wrap_intensityFloat1.0How much of the background's light wraps.
wrap_diffuseFloat15.0How far inside the edge the wrap reaches, in pixels (LightWrap's diffuse).
wrap_fg_blurFloat0.0Blur the foreground's alpha before the edge is found, in pixels: a softer, wider wrap.
wrap_bg_blurFloat0.0Blur the background before its light is taken, in pixels: the background's average colour rather than its detail.
wrap_highlight_mergeBooltrueJoin the wrap by hypot (a bright edge does not blow out) instead of adding it.
wrap_onlyBoolfalseOutput the wrap alone over its own alpha, for a separate comp layer.
effect_onlyBoolfalseOnly the light the lens ADDS (glare, halation, ghosts, wrap), over the input's alpha, for a separate comp layer. The geometric and photometric stages add no light: with only those on, this is black.
mixFloat1.0Blend between the input (0) and the lens (1).
clamp_negativesBooltrueNegatives and NaNs are black before any stage runs - a scatter of a negative is a hole in the glow.
soloChoicenoneView one stage alone, the others off. nonedistortionaberrationvignettedefocusdiffusionglareflarewrap
showChoicefinalfinal; the vignette's multiply map as a grey image; the highlights the glare scatters from; the glare alone; the flare alone; the wrap alone; the diffusion's halo alone; the defocus discs' size as a grey map (white = defocus_max). finalvignette maphighlightsglare onlyflare onlywrap onlydiffusion onlydefocus matte
disabledBoolfalseBypass: the node passes its first input through untouched (D in the graph). The knobs keep their values for when it comes back.
labelTextA note shown under the node in the graph — what this node is FOR. Never affects the render or the cache.
hide_inputBoolfalseDraw the node without its input wire — a tidy graph for a node whose source is obvious (a Dot, a viewer tap).