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.

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#

Camera brightness is a combination of exposure time and 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.

USD declaration

Description

float exposure = 0

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

float exposure:fStop = 1

F-number. Smaller values brighten the image.

float exposure:iso = 100

ISO rating. Higher values brighten the image.

float exposure:responsivity = 1

Scale for the camera system’s response to light.

float exposure:time = 1

Exposure duration in seconds. Longer values brighten the image.

Creating A Camera#

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

(
    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
}
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)

Further Reading#