> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-gunsmith/configuration/display-camera.md).

# Display Camera

Tune the CAS Gunsmith display camera — distance, height, field of view, zoom, framing spans and part focus points.

When the bench opens, the weapon is displayed as its real in-game model and a dedicated camera looks at it. The bench always opens on the whole weapon; the camera only closes in on a part once the player picks a category or a part marker. While the bench is open the player's character is hidden, so the camera can pull back past it. The settings for this are in `Config.Bench`.

| Setting              | Default       | Description                                                                                                                                                                     |
| -------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `distance`           | `1.35`        | Distance of the weapon in front of the player. Only used when the shop has no `bench`.                                                                                          |
| `height`             | `0.42`        | Height of the weapon relative to the player. Only used when the shop has no `bench`.                                                                                            |
| `scale`              | `1.0`         | Scale of the displayed weapon.                                                                                                                                                  |
| `fov`                | `38.0`        | Vertical field of view of the camera (degrees).                                                                                                                                 |
| `fill`               | `0.78`        | How much of the scene width the weapon fills (0 to 1).                                                                                                                          |
| `focusZoom`          | `0.52`        | Zoom ratio used when focusing on a part. The camera pans toward the part but stops once the end of the weapon reaches the edge of the view, so the frame never goes half empty. |
| `minZoom`, `maxZoom` | `0.45`, `1.8` | Zoom limits.                                                                                                                                                                    |
| `dragSpeed`          | `0.35`        | Mouse turn sensitivity (degrees per pixel).                                                                                                                                     |
| `spinSpeed`          | `18.0`        | Turntable speed (degrees per second).                                                                                                                                           |
| `yawOffset`          | `0.0`         | Set to `180.0` if the weapon faces the wrong way.                                                                                                                               |
| `muzzleSign`         | `1`           | Set to `-1` if focus points go to the stock instead of the muzzle.                                                                                                              |
| `look`               |               | Studio look: colour grade, depth of field, lights, camera drift. See below.                                                                                                     |
| `vignette`           |               | Black edges around the weapon view. See below.                                                                                                                                  |

## Studio look

While the bench is open, the weapon is shown like a product shot. Everything here happens only on the player's own screen and is undone when the bench closes.

```lua
look = {
  timecycle = 'INT_WeaponCustomize', timecycleStrength = 1.0,
  dof = true, dofSharp = 0.1, dofFade = 0.6,
  hideHud = true, reveal = true, sway = 1.0,
  lights = {
    key  = { x = -0.35, y = -0.55, z = 0.45,  r = 255, g = 218, b = 178, range = 2.4, intensity = 3.2 },
    fill = { x = 0.55,  y = -0.45, z = -0.05, r = 190, g = 205, b = 255, range = 2.0, intensity = 0.9 },
    rim  = { x = 0.1,   y = 0.5,   z = 0.55,  r = 255, g = 236, b = 210, range = 1.3, intensity = 2.0 },
  },
},
```

| Field               | Default                 | Description                                                                                                                                                                                                                                                                                              |
| ------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `timecycle`         | `'INT_WeaponCustomize'` | Colour grade and exposure. `INT_WeaponCustomize` is Rockstar's own grade for the gunsmith screen. `'AssetViewerInterior'` gives a neutral studio light. `''` turns it off. The player's previous grade comes back when the bench closes.                                                                 |
| `timecycleStrength` | `1.0`                   | Strength of the grade (0 to 1).                                                                                                                                                                                                                                                                          |
| `dof`               | `true`                  | Depth of field. The weapon stays sharp, the room in front of and behind it goes soft. The sharp zone follows the weapon as it turns and zooms.                                                                                                                                                           |
| `dofSharp`          | `0.1`                   | Metres kept sharp in front of and behind the weapon.                                                                                                                                                                                                                                                     |
| `dofFade`           | `0.6`                   | Metres over which the background goes from sharp to fully soft. Lower values blur a wall close behind the weapon more.                                                                                                                                                                                   |
| `hideHud`           | `true`                  | Hides the game HUD and minimap.                                                                                                                                                                                                                                                                          |
| `reveal`            | `true`                  | A newly shown weapon starts turned and swings square to the camera.                                                                                                                                                                                                                                      |
| `sway`              | `1.0`                   | Slow handheld drift of the camera. `0` holds it still.                                                                                                                                                                                                                                                   |
| `lights`            |                         | Three-point lighting. `key` is the main warm light, `fill` softens the shadows, `rim` sits behind the weapon and draws its edges. `x` is to the right, `y` is away from the camera (negative is the camera side), `z` is up, in metres from the weapon's centre. Delete a line to switch that light off. |

The depth of field depends on the game's own graphics settings. If the background does not go soft, check that depth of field is not turned off in the player's graphics settings.

### Tuning in game

With `Config.Debug = true`, the `gsfx` command changes the look live while the bench is open. Type it in the F8 console:

| Command                           | Effect                                                                         |
| --------------------------------- | ------------------------------------------------------------------------------ |
| `gsfx tc INT_WeaponCustomize 0.8` | Switches the colour grade and its strength. `gsfx tc off` removes it.          |
| `gsfx dof on 0.1 0.4`             | Depth of field on, with `dofSharp` and `dofFade`. `gsfx dof off` turns it off. |
| `gsfx light rim 6 1.8`            | Sets a light's intensity and range.                                            |
| `gsfx sway 0`                     | Sets the camera drift.                                                         |
| `gsfx vars`                       | Lists the settings inside the current colour grade.                            |

Each command prints the current values. Changes last until the resource restarts; copy them into `config.lua` to keep them.

## Vignette

While the bench is open, the screen fades to black from every edge toward the weapon view. The centre of the view, where the weapon sits, stays clear. The effect follows the view, so it also fits the Inspect mode.

```lua
vignette = { enabled = true, opacity = 0.9, clearWidth = 0.8, clearHeight = 0.7 },
```

| Field         | Default | Description                                                                                                  |
| ------------- | ------- | ------------------------------------------------------------------------------------------------------------ |
| `enabled`     | `true`  | Set to `false` to turn the effect off.                                                                       |
| `opacity`     | `0.9`   | Darkness outside the weapon view, from `0` (none) to `1` (solid black). The view's own edge gets half of it. |
| `clearWidth`  | `0.8`   | Share of the view's width that stays fully clear (0 to 1).                                                   |
| `clearHeight` | `0.7`   | Share of the view's height that stays fully clear (0 to 1).                                                  |

The weapon fills `fill` of the view's width. If the vignette darkens the muzzle or the stock, raise `clearWidth` toward that value. Higher values open the view up, lower values bring the black closer to the weapon. These settings need no build.

## Framing sizes

In the game, the barrel and the stock are separate parts, so the camera frames the weapon by its own sizes. These are in the `span` table, in metres:

```lua
span = {
  revolver = { back = 0.09, front = 0.26, below = 0.12, above = 0.05 },
  rifle    = { back = 0.40, front = 0.80, below = 0.12, above = 0.07 },
  ...
}
```

| Field            | Description                                                      |
| ---------------- | ---------------------------------------------------------------- |
| `back`           | Distance from the weapon centre to the end of the grip or stock. |
| `front`          | Distance from the weapon centre to the muzzle.                   |
| `below`, `above` | Overhang below and above.                                        |

Keys are weapon classes. To give a single model its own sizes, add a line with that model's key, for example `sawedoff`. Adjust these values if the weapon overflows the frame or looks too small.

## Focus points

`Config.Anchors` sets where part markers and focus points sit on the weapon. Values are ratios inside the weapon's bounding box:

* `t`: from the stock (0) to the muzzle (1).
* `v`: from the bottom (0) to the top (1).

Handguns use the `handgun` table, long guns use the `longarm` table. If a marker does not land next to its part, change the value in small steps.
