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 |
|---|---|
|
In tenths of a scene unit. Longer values narrow perspective field of view. |
|
In scene units. Sets the distance of perfect focus. |
|
F-number controlling depth-of-field blur. Zero disables depth of field. |
|
Selects |
Aperture#
USD declaration |
Description |
|---|---|
|
Filmback width in tenths of a scene unit. |
|
Horizontal projection-center offset in tenths of a scene unit. |
|
Filmback height in tenths of a scene unit. |
|
Vertical projection-center offset in tenths of a scene unit. |
Clipping#
USD declaration |
Description |
|---|---|
|
Plane equations adding arbitrary clipping planes. |
|
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 |
|---|---|
|
Base-2 compensation in stops. One doubles image-plane intensity; negative one halves it. |
|
F-number. Smaller values brighten the image. |
|
ISO rating. Higher values brighten the image. |
|
Scale for the camera system’s response to light. |
|
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)