Repository navigation
The lens
Keystone.Lens does to a camera's finished picture what a lens, a shutter and a film do: depth of field
(what is nearer or further than the focus is drawn as discs, as a real lens draws it, the nearer things
spreading over what lies behind them), the smear of whatever moved while the shutter was open, grain,
darker corners, colours parting towards the corners, and the bend of a wide lens. A mod fills in a Look
(focal length, sensor height, f-number, focus distance, how wide the blur may get, the part of a frame
the shutter is open for, and how much of each of the rest) and hands it over every frame. Cinema Camera
is the mod that uses it.
It is one shader of Keystone's own (tools/shaderpack/lens.glsl), run twice on the picture the game has
just finished: once at half size for what is out of focus, once for everything else. It needs no other mod.
-
Mac and Linux (OpenGL): the shader ships with Keystone as
PluginData/lens.bundle. Made and tried on a Mac; not tried on Linux. -
Windows (Direct3D 11): that shader cannot be used there; the same shader, turned into HLSL and
compiled with Windows' own compiler without the Unity editor (
tools/unityshaders/windows.py), ships asPluginData/lens-windows.bundle, and Keystone uses it wherever the game is not on OpenGL. Tried on Windows 11 (KSP 1.12.5, Direct3D 11, 2026-10-09) through Cinema Camera: the log saidhas a lens of its own (built for Direct3D11, from lens-windows.bundle), the picture stayed the right way up, the colours parted towards the corners, and with the focus at half a metre the whole scene went smoothly out of focus while the game's interface stayed sharp. Not tried there: the smear of what moves, grain, the bend of a wide lens. Its OpenGL lens was used with-force-glcore, and withlens-windows.bundletaken out TUFX's (2026-10-10). Wherelens-windows.bundleis missing (an older Keystone),Lens.Bestis TUFX's post-processing where the TUFX mod is installed, by way ofKeystoneTUFX.dllin this folder (the game loads it only where TUFX is; where TUFX is not, the game's log has a line saying it was left out, which is as it should be), and nothing otherwise. A mod should say so to the player whenLens.Bestis null:Lens.WhyNothas the words.
The game's log says which it is: [Keystone] has a lens of its own, or no lens of its own: and why.
It is small on purpose and will grow with what the mods turn out to share (key bindings and saving things with a save game are the likely next ones).