USD Camera Attributes#

Overview#

The UsdGeomCamera schema defines the standard camera model used by ovrtx.

Use these attributes to control projection, focus, clipping, and exposure on the camera targeted by a RenderProduct.

Camera schemas#

Camera capabilities are configured by these schemas:

Schema

Controls

UsdGeomCamera

Standard projection, focus, clipping and exposure, described below.

OmniSensorAPI

Sensor Scheduling configures capture rates.

Lens-distortion APIs

Lens Calibration lists projection models and their attributes.

OmniRtxRollingShutterAPI

Rolling Shutter configures per-line capture timing.

OmniSensorGenericCameraCoreAPI

Camera-core attributes configure sensor response and image processing.

OmniSensorGenericDepthSensorSingleViewAPI

Depth-camera attributes configure stereo-depth simulation.

Units#

OpenUSD expresses focalLength, aperture, and aperture offsets in tenths of a scene unit so that camera projection remains stable when an entire stage is scaled. On a centimeter stage, a value of 25 represents 25 mm. On a meter stage, the same 25 mm focal length is authored as 0.25. Distances such as focusDistance and clippingRange use ordinary scene units.

Lens#

USD declaration

Description

float focalLength = 50

In tenths of a scene unit. Longer values narrow perspective field of view.

float focusDistance = 0

In scene units. Sets the distance of perfect focus.

float fStop = 0

F-number controlling depth-of-field blur. Zero disables depth of field.

token projection = "perspective"

Selects perspective or orthographic projection.

Aperture#

USD declaration

Description

float horizontalAperture = 20.955

Filmback width in tenths of a scene unit.

float horizontalApertureOffset = 0

Horizontal projection-center offset in tenths of a scene unit.

float verticalAperture = 15.2908

Filmback height in tenths of a scene unit.

float verticalApertureOffset = 0

Vertical projection-center offset in tenths of a scene unit.

Clipping#

USD declaration

Description

float4[] clippingPlanes

Plane equations adding arbitrary clipping planes.

float2 clippingRange = (1, 1000000)

Near and far distances in scene units.

Exposure#

Image brightness combines the exposure time with the other properties of the camera system. OpenUSD separates physical exposure from depth of field and motion blur: author exposure:fStop for image brightness and fStop for depth of field. Likewise, exposure:time controls brightness independently of shutter:open and shutter:close, which describe the motion-blur interval.

Rolling-shutter timing is configured separately; see Rolling Shutter.

USD declaration (ovrtx default)

Description

float exposure = 0

Base-2 compensation in stops. One doubles image-plane intensity; negative one halves it.

float exposure:fStop = 5

F-number. Smaller values brighten the image.

float exposure:iso = 100

ISO rating. Higher values brighten the image.

float exposure:responsivity = 1.10267091

Scale for the camera system’s response to light.

float exposure:time = 0.02

Exposure duration in seconds. Longer values brighten the image.

The table lists the defaults ovrtx uses for unauthored attributes. These differ from the OpenUSD schema defaults for exposure:fStop, exposure:responsivity and exposure:time, which are all 1 in USD. Each attribute defaults independently: authoring one leaves the others at their ovrtx defaults.

Author every exposure attribute explicitly whenever image brightness must be reproducible, for example when renders are compared across scenes or feed a trained model. A camera that leaves them unauthored renders with the defaults above while a plain USD tool reading the same prim reports the OpenUSD fallbacks.

Creating A Camera#

The following examples author the same perspective camera on a stage whose scene unit is one meter.

#usda 1.0
(
    metersPerUnit = 1
)

def Camera "Camera"
{
    float4[] clippingPlanes = [(0, 1, 0, 0)]
    float2 clippingRange = (0.1, 1000)
    float exposure = 0
    float exposure:fStop = 2.8
    float exposure:iso = 100
    float exposure:responsivity = 1
    float exposure:time = 0.008333333
    float focalLength = 0.5
    float focusDistance = 5
    float fStop = 2.8
    float horizontalAperture = 0.36
    float horizontalApertureOffset = 0
    token projection = "perspective"
    float verticalAperture = 0.24
    float verticalApertureOffset = 0
}
from pxr import Gf, UsdGeom

UsdGeom.SetStageMetersPerUnit(stage, 1.0)
camera = UsdGeom.Camera.Define(stage, "/Camera")
camera.CreateProjectionAttr(UsdGeom.Tokens.perspective)
camera.CreateFocalLengthAttr(0.5)
camera.CreateFocusDistanceAttr(5.0)
camera.CreateFStopAttr(2.8)
camera.CreateHorizontalApertureAttr(0.36)
camera.CreateHorizontalApertureOffsetAttr(0.0)
camera.CreateVerticalApertureAttr(0.24)
camera.CreateVerticalApertureOffsetAttr(0.0)
camera.CreateClippingPlanesAttr([Gf.Vec4f(0.0, 1.0, 0.0, 0.0)])
camera.CreateClippingRangeAttr(Gf.Vec2f(0.1, 1000.0))
camera.CreateExposureAttr(0.0)
camera.CreateExposureFStopAttr(2.8)
camera.CreateExposureIsoAttr(100.0)
camera.CreateExposureResponsivityAttr(1.0)
camera.CreateExposureTimeAttr(1.0 / 120.0)