Skip to content

Commit

Permalink
After review, rename exposureCompensation -> exposure.
Browse files Browse the repository at this point in the history
The term "compensation" was found to be misleading, since
we are not metering the scene and compensating for that.
Furthermore, the bare term "exposure" aligns with the
precedent within Katana, the similar "exposure" attributes
on RenderMan lights, and even the "exposure" attribute
used by Arnold in Maya.

(Internal change: 2102095)
  • Loading branch information
blevin authored and pixar-oss committed Oct 5, 2020
1 parent 66f59e9 commit ce84b95
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 41 deletions.
2 changes: 1 addition & 1 deletion pxr/imaging/hd/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ PXR_NAMESPACE_OPEN_SCOPE
\
(shutterOpen) \
(shutterClose) \
(exposureCompensation)
(exposure)


TF_DECLARE_PUBLIC_TOKENS(HdCameraTokens, HD_API, HD_CAMERA_TOKENS);
Expand Down
10 changes: 5 additions & 5 deletions pxr/usd/usdGeom/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,15 @@ UsdGeomCamera::CreateShutterCloseAttr(VtValue const &defaultValue, bool writeSpa
}

UsdAttribute
UsdGeomCamera::GetExposureCompensationAttr() const
UsdGeomCamera::GetExposureAttr() const
{
return GetPrim().GetAttribute(UsdGeomTokens->exposureCompensation);
return GetPrim().GetAttribute(UsdGeomTokens->exposure);
}

UsdAttribute
UsdGeomCamera::CreateExposureCompensationAttr(VtValue const &defaultValue, bool writeSparsely) const
UsdGeomCamera::CreateExposureAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(UsdGeomTokens->exposureCompensation,
return UsdSchemaBase::_CreateAttr(UsdGeomTokens->exposure,
SdfValueTypeNames->Float,
/* custom = */ false,
SdfVariabilityVarying,
Expand Down Expand Up @@ -370,7 +370,7 @@ UsdGeomCamera::GetSchemaAttributeNames(bool includeInherited)
UsdGeomTokens->stereoRole,
UsdGeomTokens->shutterOpen,
UsdGeomTokens->shutterClose,
UsdGeomTokens->exposureCompensation,
UsdGeomTokens->exposure,
};
static TfTokenVector allNames =
_ConcatenateAttributeNames(
Expand Down
17 changes: 9 additions & 8 deletions pxr/usd/usdGeom/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -490,27 +490,28 @@ class UsdGeomCamera : public UsdGeomXformable

public:
// --------------------------------------------------------------------- //
// EXPOSURECOMPENSATION
// EXPOSURE
// --------------------------------------------------------------------- //
/// Exposure compensation, as a log base-2 value. The default
/// of 0.0 has no effect. A value of 1.0 will double the image-plane
/// intensities in a rendered image; a value of -1.0 will halve them.
/// Exposure adjustment, as a log base-2 value. The default
/// of 0.0 has no effect. A value of 1.0 will double the
/// image-plane intensities in a rendered image; a value of
/// -1.0 will halve them.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float exposureCompensation = 0` |
/// | Declaration | `float exposure = 0` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDGEOM_API
UsdAttribute GetExposureCompensationAttr() const;
UsdAttribute GetExposureAttr() const;

/// See GetExposureCompensationAttr(), and also
/// See GetExposureAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDGEOM_API
UsdAttribute CreateExposureCompensationAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
UsdAttribute CreateExposureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;

public:
// ===================================================================== //
Expand Down
9 changes: 5 additions & 4 deletions pxr/usd/usdGeom/generatedSchema.usda
Original file line number Diff line number Diff line change
Expand Up @@ -3411,10 +3411,11 @@ class Camera "Camera" (
doc = """Near and far clipping distances in centimeters (or, more
general, world units)."""
)
float exposureCompensation = 0 (
doc = """Exposure compensation, as a log base-2 value. The default
of 0.0 has no effect. A value of 1.0 will double the image-plane
intensities in a rendered image; a value of -1.0 will halve them."""
float exposure = 0 (
doc = """Exposure adjustment, as a log base-2 value. The default
of 0.0 has no effect. A value of 1.0 will double the
image-plane intensities in a rendered image; a value of
-1.0 will halve them."""
)
float focalLength = 50 (
doc = """Perspective focal length in millimeters (or, more general,
Expand Down
13 changes: 7 additions & 6 deletions pxr/usd/usdGeom/schema.usda
Original file line number Diff line number Diff line change
Expand Up @@ -1958,12 +1958,13 @@ class Camera "Camera" (
should be authored, otherwise there is no exposure and a
renderer should produce a black image."""
)

# exposure compensation
float exposureCompensation = 0.0 (
doc = """Exposure compensation, as a log base-2 value. The default
of 0.0 has no effect. A value of 1.0 will double the image-plane
intensities in a rendered image; a value of -1.0 will halve them."""

# exposure adjustment
float exposure = 0.0 (
doc = """Exposure adjustment, as a log base-2 value. The default
of 0.0 has no effect. A value of 1.0 will double the
image-plane intensities in a rendered image; a value of
-1.0 will halve them."""
)
}

Expand Down
4 changes: 2 additions & 2 deletions pxr/usd/usdGeom/tokens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ UsdGeomTokensType::UsdGeomTokensType() :
edgeOnly("edgeOnly", TfToken::Immortal),
elementSize("elementSize", TfToken::Immortal),
elementType("elementType", TfToken::Immortal),
exposureCompensation("exposureCompensation", TfToken::Immortal),
exposure("exposure", TfToken::Immortal),
extent("extent", TfToken::Immortal),
extentsHint("extentsHint", TfToken::Immortal),
face("face", TfToken::Immortal),
Expand Down Expand Up @@ -216,7 +216,7 @@ UsdGeomTokensType::UsdGeomTokensType() :
edgeOnly,
elementSize,
elementType,
exposureCompensation,
exposure,
extent,
extentsHint,
face,
Expand Down
4 changes: 2 additions & 2 deletions pxr/usd/usdGeom/tokens.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ struct UsdGeomTokensType {
///
/// UsdGeomSubset
const TfToken elementType;
/// \brief "exposureCompensation"
/// \brief "exposure"
///
/// UsdGeomCamera
const TfToken exposureCompensation;
const TfToken exposure;
/// \brief "extent"
///
/// UsdGeomCone, UsdGeomCapsule, UsdGeomCylinder, UsdGeomSphere, UsdGeomCube, UsdGeomBoundable
Expand Down
12 changes: 6 additions & 6 deletions pxr/usd/usdGeom/wrapCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ _CreateShutterCloseAttr(UsdGeomCamera &self,
}

static UsdAttribute
_CreateExposureCompensationAttr(UsdGeomCamera &self,
_CreateExposureAttr(UsdGeomCamera &self,
object defaultVal, bool writeSparsely) {
return self.CreateExposureCompensationAttr(
return self.CreateExposureAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Float), writeSparsely);
}

Expand Down Expand Up @@ -280,10 +280,10 @@ void wrapUsdGeomCamera()
(arg("defaultValue")=object(),
arg("writeSparsely")=false))

.def("GetExposureCompensationAttr",
&This::GetExposureCompensationAttr)
.def("CreateExposureCompensationAttr",
&_CreateExposureCompensationAttr,
.def("GetExposureAttr",
&This::GetExposureAttr)
.def("CreateExposureAttr",
&_CreateExposureAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))

Expand Down
2 changes: 1 addition & 1 deletion pxr/usd/usdGeom/wrapTokens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void wrapUsdGeomTokens()
_AddToken(cls, "edgeOnly", UsdGeomTokens->edgeOnly);
_AddToken(cls, "elementSize", UsdGeomTokens->elementSize);
_AddToken(cls, "elementType", UsdGeomTokens->elementType);
_AddToken(cls, "exposureCompensation", UsdGeomTokens->exposureCompensation);
_AddToken(cls, "exposure", UsdGeomTokens->exposure);
_AddToken(cls, "extent", UsdGeomTokens->extent);
_AddToken(cls, "extentsHint", UsdGeomTokens->extentsHint);
_AddToken(cls, "face", UsdGeomTokens->face);
Expand Down
10 changes: 5 additions & 5 deletions pxr/usdImaging/usdImaging/cameraAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ UsdImagingCameraAdapter::TrackVariability(UsdPrim const& prim,
}
if ((*timeVaryingBits & HdCamera::DirtyParams) == 0) {
_IsVarying(prim,
UsdGeomTokens->exposureCompensation,
UsdGeomTokens->exposure,
HdCamera::DirtyParams,
HdCameraTokens->exposureCompensation,
HdCameraTokens->exposure,
timeVaryingBits,
false);
}
Expand Down Expand Up @@ -284,9 +284,9 @@ UsdImagingCameraAdapter::Get(UsdPrim const& prim,
cam.GetShutterCloseAttr().Get(&vShutterClose, time); // conversion n/a
return vShutterClose;

} else if (key == HdCameraTokens->exposureCompensation) {
} else if (key == HdCameraTokens->exposure) {
VtValue v;
cam.GetExposureCompensationAttr().Get(&v, time); // conversion n/a
cam.GetExposureAttr().Get(&v, time); // conversion n/a
return v;
}

Expand Down Expand Up @@ -320,7 +320,7 @@ UsdImagingCameraAdapter::ProcessPropertyChange(UsdPrim const& prim,
propertyName == UsdGeomTokens->focusDistance ||
propertyName == UsdGeomTokens->shutterOpen ||
propertyName == UsdGeomTokens->shutterClose ||
propertyName == UsdGeomTokens->exposureCompensation)
propertyName == UsdGeomTokens->exposure)
return HdCamera::DirtyParams;

// XXX: There's no catch-all dirty bit for weird camera params.
Expand Down
2 changes: 1 addition & 1 deletion third_party/renderman-23/plugin/hdPrman/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ HdPrmanCamera::Sync(HdSceneDelegate *sceneDelegate,
HdCameraTokens->focusDistance,
HdCameraTokens->shutterOpen,
HdCameraTokens->shutterClose,
HdCameraTokens->exposureCompensation
HdCameraTokens->exposure
};

for (TfToken const& param : params) {
Expand Down

0 comments on commit ce84b95

Please sign in to comment.