Skip to content

Commit

Permalink
Merge pull request #3443 from beersandrew/validation-usdShade-NormalM…
Browse files Browse the repository at this point in the history
…apTexture

usdValidation: usdShade: NormalMapTextureValidator

(Internal change: 2351238)
(Internal change: 2351293)
  • Loading branch information
pixar-oss committed Dec 12, 2024
2 parents 6c48bd4 + 7b075ac commit b9eece2
Show file tree
Hide file tree
Showing 7 changed files with 619 additions and 140 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
Doc: All properties named 'material:binding' or in that namespace should be relationships.
Keywords: UsdShadeValidators
isSuite: False
[usdShadeValidators:NormalMapTextureValidator]:
Doc: UsdUVTexture nodes that feed the _inputs:normals_ of a UsdPreviewSurface must ensure that the data is encoded and scaled properly. Specifically, since normals are expected to be in the range [(-1,-1,-1), (1,1,1)], the Texture node must transform 8-bit textures from their [0..1] range by setting its _inputs:scale_ to (2, 2, 2, 1) and _inputs:bias_ to (-1, -1, -1, 0). Normal map data is commonly expected to be linearly encoded. However, many image-writing tools automatically set the profile of three-channel, 8-bit images to SRGB. To prevent an unwanted transformation, the UsdUVTexture's _inputs:sourceColorSpace_ must be set to raw.
Keywords: UsdShadeValidators
SchemaTypes: UsdShadeShader
isSuite: False
[usdShadeValidators:ShaderSdrCompliance]:
Doc: Shader prim's input types must be conforming to their appropriate sdf types in the respective sdr shader.
Keywords: UsdShadeValidators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
Doc: All properties named 'material:binding' or in that namespace should be relationships.
Keywords: UsdShadeValidators
isSuite: False
[usdShadeValidators:NormalMapTextureValidator]:
Doc: UsdUVTexture nodes that feed the _inputs:normals_ of a UsdPreviewSurface must ensure that the data is encoded and scaled properly. Specifically, since normals are expected to be in the range [(-1,-1,-1), (1,1,1)], the Texture node must transform 8-bit textures from their [0..1] range by setting its _inputs:scale_ to (2, 2, 2, 1) and _inputs:bias_ to (-1, -1, -1, 0). Normal map data is commonly expected to be linearly encoded. However, many image-writing tools automatically set the profile of three-channel, 8-bit images to SRGB. To prevent an unwanted transformation, the UsdUVTexture's _inputs:sourceColorSpace_ must be set to raw.
Keywords: UsdShadeValidators
SchemaTypes: UsdShadeShader
isSuite: False
[usdShadeValidators:ShaderSdrCompliance]:
Doc: Shader prim's input types must be conforming to their appropriate sdf types in the respective sdr shader.
Keywords: UsdShadeValidators
Expand Down
8 changes: 7 additions & 1 deletion pxr/usdValidation/usdShadeValidators/plugInfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@
},
"MaterialBindingRelationships": {
"doc": "All properties named 'material:binding' or in that namespace should be relationships."
},
},
"NormalMapTextureValidator" : {
"doc": "UsdUVTexture nodes that feed the _inputs:normals_ of a UsdPreviewSurface must ensure that the data is encoded and scaled properly. Specifically, since normals are expected to be in the range [(-1,-1,-1), (1,1,1)], the Texture node must transform 8-bit textures from their [0..1] range by setting its _inputs:scale_ to (2, 2, 2, 1) and _inputs:bias_ to (-1, -1, -1, 0). Normal map data is commonly expected to be linearly encoded. However, many image-writing tools automatically set the profile of three-channel, 8-bit images to SRGB. To prevent an unwanted transformation, the UsdUVTexture's _inputs:sourceColorSpace_ must be set to raw.",
"schemaTypes": [
"UsdShadeShader"
]
},
"ShaderSdrCompliance": {
"doc": "Shader prim's input types must be conforming to their appropriate sdf types in the respective sdr shader.",
"schemaTypes": [
Expand Down
Loading

0 comments on commit b9eece2

Please sign in to comment.