Camera profiles#
A camera profile describes the physical camera a Nyx sensor emulates: its lens (focal length, aperture, distortion, chromatic aberration, vignetting), its sensor (size, exposure, noise) and its colour management (tone mapper, optional LUT). Profiles are CameraProfileAsset objects stored as JSON files and referenced by a camera through camera_profile.
Default behaviour#
When camera_profile is left at None, the plugin writes a default profile for every Nyx camera into the scene’s __nyx_cache__/<id>/ folder at scene.build(). That profile is derived from the camera’s fov and uses Reinhard tone mapping, which reproduces the behaviour of earlier releases.
Using a profile file#
Point camera_profile at a JSON profile. The field of view then comes from the profile’s optics, so fov is ignored (a warning is printed if both are set):
import os
import gs_nyx
from gs_nyx_plugin.nyx_camera_options import NyxCameraOptions
# A profile shipped with the wheel: Sony A7R V body, 24 mm lens, ACES tone mapping.
SONY_A7R5 = os.path.join(
os.path.dirname(gs_nyx.__file__), "assets", "camera_profiles", "sony_a7_r5_24mm.json"
)
cam = scene.add_sensor(NyxCameraOptions(
res = (1920, 1080),
pos = (-1.0, 1.0, 1.2),
lookat = (0.0, 0.0, 0.1),
camera_profile = SONY_A7R5,
))
Relative paths are resolved against the working directory of the Genesis process; prefer absolute paths.
Building a profile in Python#
CameraProfileAsset exposes every field; export_camera_profile_file() and import_camera_profile_file() round-trip it to JSON. This is the simplest way to change one knob, such as the tone mapper, while keeping the default optics:
import math
import gs_nyx.nyx_py_sdk as nps
profile = nps.CameraProfileAsset()
profile.set_fov_y(math.radians(40.0)) # vertical field of view
profile.colorManagement.toneMapper = nps.EToneMapper.Off # linear output
profile.lens.vignette.strength = 0.0
nps.export_camera_profile_file("my_profile.json", profile)
cam = scene.add_sensor(NyxCameraOptions(..., camera_profile="my_profile.json"))
Fields#
Group |
Field |
Meaning |
|---|---|---|
|
|
Focal length of the lens, in millimetres. Together with |
|
|
Radial distortion polynomial coefficients. |
|
|
Lateral chromatic aberration of the red and blue channels. |
|
|
Achromatic barrel occlusion (radial polynomial) and its colour tint. |
|
|
Aperture in f-stops. |
|
|
Physical sensor height in millimetres and its vertical resolution. |
|
|
Shot sensitivity (ISO, |
|
|
Lowest native sensitivity anchoring the noise model, and an artistic scale on its amplitude. |
|
|
Tone mapping operator ( |
Tone mappers#
Output |
|
|---|---|
|
No tone mapping; linear HDR values. Use it for Gaussian splats authored against their own tone curve (see Gaussian splats). |
|
Reinhard operator. The plugin’s default. |
|
Frostbite neutral operator. |
|
ACES 1.3 operator. |
|
Look-up table from |
JSON layout#
The shipped sony_a7_r5_24mm.json shows the file format:
{
"version": 1,
"description": "Sony A7 R5 24mm",
"lens": {
"focal_length": 24.0,
"chromatic_aberration": { "lateral_r_scale": 0.004, "lateral_b_scale": -0.004 },
"distortion": { "k1": -0.187357, "k2": 0.055437, "k3": -0.010774 },
"vignette": { "strength": 1.0, "k1": -0.174, "k2": 0.189, "tint": [1.3, 1.0, 0.9] }
},
"sensor": { "height": 23.8, "resolution_y": 6336 },
"color_management": { "tone_mapper": "aces_1_3" }
}
Keys that are omitted keep their defaults. To discover the exact spelling of a field, build the profile in Python and export it rather than writing the JSON by hand.
Lifecycle and constraints#
Warning
Profiles are read at scene.build(). Editing the JSON or the camera_profile field afterwards has no effect until the scene is rebuilt.
Note
camera_profile replaces the tone_mapper option of earlier plugin releases. Tone mapping is now a property of the profile, not of NyxCameraOptions.
See also#
Gaussian splats: why Gaussian splats usually want tone mapping off.
Supported features: which camera properties the plugin honours.