Skip to content

Commit 3326483

Browse files
committed
Address Nick notes
1 parent 9f1d4d2 commit 3326483

File tree

9 files changed

+44
-116
lines changed

9 files changed

+44
-116
lines changed

pxr/usd/usdLightField/gaussiansAPI.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,16 @@ class UsdLightFieldGaussiansAPI : public UsdAPISchemaBase
167167
/// Gaussians may be available in a range of shapes, therefore this list of allowedTokens is not strictly
168168
/// comprehensive. A renderer may support a subset or superset of the allowed tokens.
169169
///
170-
/// An elipsoid is what many people will colloquially refer to as a splat.
170+
/// An ellipsoid is what many people will colloquially refer to as a splat.
171171
///
172172
///
173173
/// | ||
174174
/// | -- | -- |
175-
/// | Declaration | `uniform token gaussianShape = "elipsoid"` |
175+
/// | Declaration | `uniform token gaussianShape = "ellipsoid"` |
176176
/// | C++ Type | TfToken |
177177
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
178178
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
179-
/// | \ref UsdLightFieldTokens "Allowed Values" | elipsoid, triangle, plane |
179+
/// | \ref UsdLightFieldTokens "Allowed Values" | ellipsoid, triangle, plane |
180180
USDLIGHTFIELD_API
181181
UsdAttribute GetGaussianShapeAttr() const;
182182

@@ -199,10 +199,10 @@ class UsdLightFieldGaussiansAPI : public UsdAPISchemaBase
199199
/// This attribute is a hint for the metric used to sort the gaussians with respect to the camera.
200200
///
201201
/// 'zDepth' sorts the gaussians using the z component of the position of the gaussians once
202-
/// transformed in to camera space.
202+
/// transformed in to the cameras projection space.
203203
///
204204
/// 'cameraDistance' sorts the gaussians using the euclidean distance between the gaussians
205-
/// and the camera.
205+
/// and the camera in world space.
206206
///
207207
/// | ||
208208
/// | -- | -- |

pxr/usd/usdLightField/generatedSchema.usda

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ class "GaussiansAPI" (
1616
"""
1717
)
1818
{
19-
uniform token gaussianShape = "elipsoid" (
20-
allowedTokens = ["elipsoid", "triangle", "plane"]
19+
uniform token gaussianShape = "ellipsoid" (
20+
allowedTokens = ["ellipsoid", "triangle", "plane"]
2121
doc = """The shape of the gaussian to render.
2222
Gaussians may be available in a range of shapes, therefore this list of allowedTokens is not strictly
2323
comprehensive. A renderer may support a subset or superset of the allowed tokens.
2424

25-
An elipsoid is what many people will colloquially refer to as a splat.
25+
An ellipsoid is what many people will colloquially refer to as a splat.
2626
"""
2727
)
2828
quath[] orientations (
@@ -63,31 +63,34 @@ class "GaussiansAPI" (
6363
This attribute is a hint for the metric used to sort the gaussians with respect to the camera.
6464

6565
'zDepth' sorts the gaussians using the z component of the position of the gaussians once
66-
transformed in to camera space.
66+
transformed in to the cameras projection space.
6767

6868
'cameraDistance' sorts the gaussians using the euclidean distance between the gaussians
69-
and the camera."""
69+
and the camera in world space."""
7070
)
7171
}
7272

7373
class "SphericalHarmonicsAPI" (
7474
doc = """AppliedAPI schema to extend UsdGeomPoints to describe Spherical Harmonic data.
7575
Spherical harmonics data must be interpreted in context of the point types it is applied to, for example
76-
with elipsoid gaussians using the GaussianAPI above.
76+
with ellipsoid gaussians using the GaussianAPI above.
7777

7878
The spherical harmonic coefficients can be provided as either half or float based data.
7979
If floats are present, then renderers should prefer the higher precision data if they are able.
8080

81-
The spherical harmonic data is provided as an array of half3 or float3 data. Each point must have the
82-
same number of spherical harmonic coefficients, and therefore the array size must be equal to the number
83-
of points multiplied by the number of spherical harmonic coefficients. This allows the number of coefficients
84-
present for each point can be inferred by the array size.
81+
The spherical harmonic data is provided as an array of half3 or float3 data. They are represented by 3 component values
82+
as they are constructed to be the eigenfunctions of the angular part of the Laplacian in three dimensions.
83+
84+
Each point must have the same number of spherical harmonic coefficients, and therefore the array size must be equal
85+
to the number of points multiplied by the number of spherical harmonic coefficients.
86+
This allows the number of coefficients present for each point can be inferred by the array size.
8587

8688
Spherical Harmoics contain all but the 0th degree spherical harmonic, which is already encoded in the UsdGeomPoints.displayColor attribute.
8789
Each point must have the same number of spherical harmonic coefficients, and therefore the array size must be
8890
equal to the number of points multiplied by the number of spherical harmonic coefficients (minus one due to the 0th degree being used for color).
8991
This allows the number of coefficients present for each point can be inferred by the array size.
9092

93+
Authors are responsible for authoring the correct color space metadata for their spherical harmonics data.
9194
"""
9295
)
9396
{
@@ -99,8 +102,5 @@ class "SphericalHarmonicsAPI" (
99102
doc = """Float buffer containing SH data.
100103
See the description of the API for more information on interpreting the data."""
101104
)
102-
uniform token sphericalHarmonicsColorSpace = "sRGB" (
103-
doc = "Defines the source color space of the spherical harmonic data."
104-
)
105105
}
106106

pxr/usd/usdLightField/schema.usda

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ class "GaussiansAPI" (
3434
token[] apiSchemaCanOnlyApplyTo = ["UsdGeomPoints"]
3535
}
3636
) {
37-
uniform token gaussianShape = "elipsoid" (
38-
allowedTokens = ["elipsoid", "triangle", "plane"]
37+
uniform token gaussianShape = "ellipsoid" (
38+
allowedTokens = ["ellipsoid", "triangle", "plane"]
3939
doc = """The shape of the gaussian to render.
4040
Gaussians may be available in a range of shapes, therefore this list of allowedTokens is not strictly
4141
comprehensive. A renderer may support a subset or superset of the allowed tokens.
4242

43-
An elipsoid is what many people will colloquially refer to as a splat.
43+
An ellipsoid is what many people will colloquially refer to as a splat.
4444
"""
4545
)
4646

@@ -53,10 +53,10 @@ class "GaussiansAPI" (
5353
This attribute is a hint for the metric used to sort the gaussians with respect to the camera.
5454

5555
'zDepth' sorts the gaussians using the z component of the position of the gaussians once
56-
transformed in to camera space.
56+
transformed in to the cameras projection space.
5757

5858
'cameraDistance' sorts the gaussians using the euclidean distance between the gaussians
59-
and the camera."""
59+
and the camera in world space."""
6060
)
6161

6262
uniform token projectionModeHint = "perspective" (
@@ -98,21 +98,24 @@ class "GaussiansAPI" (
9898
class "SphericalHarmonicsAPI" (
9999
doc = """AppliedAPI schema to extend UsdGeomPoints to describe Spherical Harmonic data.
100100
Spherical harmonics data must be interpreted in context of the point types it is applied to, for example
101-
with elipsoid gaussians using the GaussianAPI above.
101+
with ellipsoid gaussians using the GaussianAPI above.
102102

103103
The spherical harmonic coefficients can be provided as either half or float based data.
104104
If floats are present, then renderers should prefer the higher precision data if they are able.
105105

106-
The spherical harmonic data is provided as an array of half3 or float3 data. Each point must have the
107-
same number of spherical harmonic coefficients, and therefore the array size must be equal to the number
108-
of points multiplied by the number of spherical harmonic coefficients. This allows the number of coefficients
109-
present for each point can be inferred by the array size.
106+
The spherical harmonic data is provided as an array of half3 or float3 data. They are represented by 3 component values
107+
as they are constructed to be the eigenfunctions of the angular part of the Laplacian in three dimensions.
108+
109+
Each point must have the same number of spherical harmonic coefficients, and therefore the array size must be equal
110+
to the number of points multiplied by the number of spherical harmonic coefficients.
111+
This allows the number of coefficients present for each point can be inferred by the array size.
110112

111113
Spherical Harmoics contain all but the 0th degree spherical harmonic, which is already encoded in the UsdGeomPoints.displayColor attribute.
112114
Each point must have the same number of spherical harmonic coefficients, and therefore the array size must be
113115
equal to the number of points multiplied by the number of spherical harmonic coefficients (minus one due to the 0th degree being used for color).
114116
This allows the number of coefficients present for each point can be inferred by the array size.
115117

118+
Authors are responsible for authoring the correct color space metadata for their spherical harmonics data.
116119
"""
117120
inherits = </APISchemaBase>
118121

@@ -122,10 +125,6 @@ class "SphericalHarmonicsAPI" (
122125
}
123126
) {
124127

125-
uniform token sphericalHarmonicsColorSpace = "sRGB" (
126-
doc = """Defines the source color space of the spherical harmonic data."""
127-
)
128-
129128
half3[] primvars:sphericalHarmonics (
130129
doc = """Half buffer containing spherical harmonics data.
131130
See the description of the API for more information on interpreting the data."""

pxr/usd/usdLightField/sphericalHarmonicsAPI.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,6 @@ UsdLightFieldSphericalHarmonicsAPI::_GetTfType() const
8585
return _GetStaticTfType();
8686
}
8787

88-
UsdAttribute
89-
UsdLightFieldSphericalHarmonicsAPI::GetSphericalHarmonicsColorSpaceAttr() const
90-
{
91-
return GetPrim().GetAttribute(UsdLightFieldTokens->sphericalHarmonicsColorSpace);
92-
}
93-
94-
UsdAttribute
95-
UsdLightFieldSphericalHarmonicsAPI::CreateSphericalHarmonicsColorSpaceAttr(VtValue const &defaultValue, bool writeSparsely) const
96-
{
97-
return UsdSchemaBase::_CreateAttr(UsdLightFieldTokens->sphericalHarmonicsColorSpace,
98-
SdfValueTypeNames->Token,
99-
/* custom = */ false,
100-
SdfVariabilityUniform,
101-
defaultValue,
102-
writeSparsely);
103-
}
104-
10588
UsdAttribute
10689
UsdLightFieldSphericalHarmonicsAPI::GetPrimvarsSphericalHarmonicsAttr() const
10790
{
@@ -153,7 +136,6 @@ const TfTokenVector&
153136
UsdLightFieldSphericalHarmonicsAPI::GetSchemaAttributeNames(bool includeInherited)
154137
{
155138
static TfTokenVector localNames = {
156-
UsdLightFieldTokens->sphericalHarmonicsColorSpace,
157139
UsdLightFieldTokens->primvarsSphericalHarmonics,
158140
UsdLightFieldTokens->primvarsSphericalHarmonicsf,
159141
};

pxr/usd/usdLightField/sphericalHarmonicsAPI.h

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,26 @@ class SdfAssetPath;
3737
///
3838
/// AppliedAPI schema to extend UsdGeomPoints to describe Spherical Harmonic data.
3939
/// Spherical harmonics data must be interpreted in context of the point types it is applied to, for example
40-
/// with elipsoid gaussians using the GaussianAPI above.
40+
/// with ellipsoid gaussians using the GaussianAPI above.
4141
///
4242
/// The spherical harmonic coefficients can be provided as either half or float based data.
4343
/// If floats are present, then renderers should prefer the higher precision data if they are able.
4444
///
45-
/// The spherical harmonic data is provided as an array of half3 or float3 data. Each point must have the
46-
/// same number of spherical harmonic coefficients, and therefore the array size must be equal to the number
47-
/// of points multiplied by the number of spherical harmonic coefficients. This allows the number of coefficients
48-
/// present for each point can be inferred by the array size.
45+
/// The spherical harmonic data is provided as an array of half3 or float3 data. They are represented by 3 component values
46+
/// as they are constructed to be the eigenfunctions of the angular part of the Laplacian in three dimensions.
47+
///
48+
/// Each point must have the same number of spherical harmonic coefficients, and therefore the array size must be equal
49+
/// to the number of points multiplied by the number of spherical harmonic coefficients.
50+
/// This allows the number of coefficients present for each point can be inferred by the array size.
4951
///
5052
/// Spherical Harmoics contain all but the 0th degree spherical harmonic, which is already encoded in the UsdGeomPoints.displayColor attribute.
5153
/// Each point must have the same number of spherical harmonic coefficients, and therefore the array size must be
5254
/// equal to the number of points multiplied by the number of spherical harmonic coefficients (minus one due to the 0th degree being used for color).
5355
/// This allows the number of coefficients present for each point can be inferred by the array size.
5456
///
57+
/// Authors are responsible for authoring the correct color space metadata for their spherical harmonics data.
5558
///
5659
///
57-
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
58-
/// that are text/tokens, the actual token is published and defined in \ref UsdLightFieldTokens.
59-
/// So to set an attribute to the value "rightHanded", use UsdLightFieldTokens->rightHanded
60-
/// as the value.
61-
///
6260
class UsdLightFieldSphericalHarmonicsAPI : public UsdAPISchemaBase
6361
{
6462
public:
@@ -167,29 +165,6 @@ class UsdLightFieldSphericalHarmonicsAPI : public UsdAPISchemaBase
167165
USDLIGHTFIELD_API
168166
const TfType &_GetTfType() const override;
169167

170-
public:
171-
// --------------------------------------------------------------------- //
172-
// SPHERICALHARMONICSCOLORSPACE
173-
// --------------------------------------------------------------------- //
174-
/// Defines the source color space of the spherical harmonic data.
175-
///
176-
/// | ||
177-
/// | -- | -- |
178-
/// | Declaration | `uniform token sphericalHarmonicsColorSpace = "sRGB"` |
179-
/// | C++ Type | TfToken |
180-
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
181-
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
182-
USDLIGHTFIELD_API
183-
UsdAttribute GetSphericalHarmonicsColorSpaceAttr() const;
184-
185-
/// See GetSphericalHarmonicsColorSpaceAttr(), and also
186-
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
187-
/// If specified, author \p defaultValue as the attribute's default,
188-
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
189-
/// the default for \p writeSparsely is \c false.
190-
USDLIGHTFIELD_API
191-
UsdAttribute CreateSphericalHarmonicsColorSpaceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
192-
193168
public:
194169
// --------------------------------------------------------------------- //
195170
// PRIMVARSSPHERICALHARMONICS

pxr/usd/usdLightField/tokens.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ PXR_NAMESPACE_OPEN_SCOPE
1010

1111
UsdLightFieldTokensType::UsdLightFieldTokensType() :
1212
cameraDistance("cameraDistance", TfToken::Immortal),
13-
elipsoid("elipsoid", TfToken::Immortal),
13+
ellipsoid("ellipsoid", TfToken::Immortal),
1414
gaussianShape("gaussianShape", TfToken::Immortal),
1515
orientations("orientations", TfToken::Immortal),
1616
orientationsf("orientationsf", TfToken::Immortal),
@@ -22,16 +22,14 @@ UsdLightFieldTokensType::UsdLightFieldTokensType() :
2222
scales("scales", TfToken::Immortal),
2323
scalesf("scalesf", TfToken::Immortal),
2424
sortingModeHint("sortingModeHint", TfToken::Immortal),
25-
sphericalHarmonicsColorSpace("sphericalHarmonicsColorSpace", TfToken::Immortal),
26-
sRGB("sRGB", TfToken::Immortal),
2725
tangential("tangential", TfToken::Immortal),
2826
triangle("triangle", TfToken::Immortal),
2927
zDepth("zDepth", TfToken::Immortal),
3028
GaussiansAPI("GaussiansAPI", TfToken::Immortal),
3129
SphericalHarmonicsAPI("SphericalHarmonicsAPI", TfToken::Immortal),
3230
allTokens({
3331
cameraDistance,
34-
elipsoid,
32+
ellipsoid,
3533
gaussianShape,
3634
orientations,
3735
orientationsf,
@@ -43,8 +41,6 @@ UsdLightFieldTokensType::UsdLightFieldTokensType() :
4341
scales,
4442
scalesf,
4543
sortingModeHint,
46-
sphericalHarmonicsColorSpace,
47-
sRGB,
4844
tangential,
4945
triangle,
5046
zDepth,

pxr/usd/usdLightField/tokens.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ struct UsdLightFieldTokensType {
4949
///
5050
/// Possible value for UsdLightFieldGaussiansAPI::GetSortingModeHintAttr()
5151
const TfToken cameraDistance;
52-
/// \brief "elipsoid"
52+
/// \brief "ellipsoid"
5353
///
5454
/// Fallback value for UsdLightFieldGaussiansAPI::GetGaussianShapeAttr()
55-
const TfToken elipsoid;
55+
const TfToken ellipsoid;
5656
/// \brief "gaussianShape"
5757
///
5858
/// UsdLightFieldGaussiansAPI
@@ -97,14 +97,6 @@ struct UsdLightFieldTokensType {
9797
///
9898
/// UsdLightFieldGaussiansAPI
9999
const TfToken sortingModeHint;
100-
/// \brief "sphericalHarmonicsColorSpace"
101-
///
102-
/// UsdLightFieldSphericalHarmonicsAPI
103-
const TfToken sphericalHarmonicsColorSpace;
104-
/// \brief "sRGB"
105-
///
106-
/// Fallback value for UsdLightFieldSphericalHarmonicsAPI::GetSphericalHarmonicsColorSpaceAttr()
107-
const TfToken sRGB;
108100
/// \brief "tangential"
109101
///
110102
/// Possible value for UsdLightFieldGaussiansAPI::GetProjectionModeHintAttr()

pxr/usd/usdLightField/wrapSphericalHarmonicsAPI.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ namespace {
3333
WRAP_CUSTOM;
3434

3535

36-
static UsdAttribute
37-
_CreateSphericalHarmonicsColorSpaceAttr(UsdLightFieldSphericalHarmonicsAPI &self,
38-
object defaultVal, bool writeSparsely) {
39-
return self.CreateSphericalHarmonicsColorSpaceAttr(
40-
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Token), writeSparsely);
41-
}
42-
4336
static UsdAttribute
4437
_CreatePrimvarsSphericalHarmonicsAttr(UsdLightFieldSphericalHarmonicsAPI &self,
4538
object defaultVal, bool writeSparsely) {
@@ -117,13 +110,6 @@ void wrapUsdLightFieldSphericalHarmonicsAPI()
117110
.def(!self)
118111

119112

120-
.def("GetSphericalHarmonicsColorSpaceAttr",
121-
&This::GetSphericalHarmonicsColorSpaceAttr)
122-
.def("CreateSphericalHarmonicsColorSpaceAttr",
123-
&_CreateSphericalHarmonicsColorSpaceAttr,
124-
(arg("defaultValue")=object(),
125-
arg("writeSparsely")=false))
126-
127113
.def("GetPrimvarsSphericalHarmonicsAttr",
128114
&This::GetPrimvarsSphericalHarmonicsAttr)
129115
.def("CreatePrimvarsSphericalHarmonicsAttr",

pxr/usd/usdLightField/wrapTokens.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void wrapUsdLightFieldTokens()
1818
pxr_boost::python::class_<UsdLightFieldTokensType, pxr_boost::python::noncopyable>
1919
cls("Tokens", pxr_boost::python::no_init);
2020
_ADD_TOKEN(cls, cameraDistance);
21-
_ADD_TOKEN(cls, elipsoid);
21+
_ADD_TOKEN(cls, ellipsoid);
2222
_ADD_TOKEN(cls, gaussianShape);
2323
_ADD_TOKEN(cls, orientations);
2424
_ADD_TOKEN(cls, orientationsf);
@@ -30,8 +30,6 @@ void wrapUsdLightFieldTokens()
3030
_ADD_TOKEN(cls, scales);
3131
_ADD_TOKEN(cls, scalesf);
3232
_ADD_TOKEN(cls, sortingModeHint);
33-
_ADD_TOKEN(cls, sphericalHarmonicsColorSpace);
34-
_ADD_TOKEN(cls, sRGB);
3533
_ADD_TOKEN(cls, tangential);
3634
_ADD_TOKEN(cls, triangle);
3735
_ADD_TOKEN(cls, zDepth);

0 commit comments

Comments
 (0)