Skip to content

Align UsdPreviewSurface opacity with upcoming specification#2796

Open
jstone-lucasfilm wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
jstone-lucasfilm:dev_usd_opacity
Open

Align UsdPreviewSurface opacity with upcoming specification#2796
jstone-lucasfilm wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
jstone-lucasfilm:dev_usd_opacity

Conversation

@jstone-lucasfilm
Copy link
Member

This changelist updates the opacity behavior in the MaterialX graph definition of UsdPreviewSurface, aligning it with upcoming revisions to the UsdPreviewSurface specification.

Our Pixar colleagues have shared the following language from the next release of the UsdPreviewSurface specification, providing additional clarity on the edge case behavior of opacity:

  • opacity: When opacity is 1.0 then the prim is fully opaque, if it is smaller than 1.0 then the prim is translucent, when it is 0 the prim is fully transparent. Fully transparent objects will still receive a lighting response when the opacityMode is transparent. When the opacityMode is set to presence the lighting response will be scaled by the opacity.
  • opacityMode: This input dictates how materials with zero opacity are interpreted and takes one of two inputs: transparent or presence. When the value is transparent materials with zero opacity still receive a lighting response as, for example, perfectly clear glass still has a specular response. However, when set to presence these materials will not receive any lighting and thus they always serve as cutouts. When using presence and semi-opaque materials the entire lighting response, including specular, will be scaled by opacity to allow for a smooth transition between materials with zero and non-zero opacity.
  • opacityThreshold: The opacityThreshold input is useful for creating geometric cut-outs based on the opacity input. A value of 0.0 indicates that no masking is applied to the opacity input, while a value greater than 0.0 indicates that rendering of the surface is limited to the areas where the opacity is greater or equal to that value. A classic use of opacityThreshold is to create a leaf from an opacity input texture, in that case the threshold determines the parts of the opacity texture that will be fully transparent and not receive lighting. Note that when opacityThreshold is greater than zero, the opacity values less than the opacityThreshold will not be rendered, and the opacity values greater than or equal to the opacityThreshold will be fully visible. Thus, the opacityThreshold serves as a switch for how the opacity input is interpreted; this “translucent or masked” behavior is common in engines and renderers, and makes the UsdPreviewSurface easier to interchange. Recreating a translucent material that also provides a zero opacity-based mask, can be achieved by setting opacityThreshold to zero and opacityMode to presence.

This changelist updates the opacity behavior in the MaterialX graph definition of `UsdPreviewSurface`, aligning it with upcoming revisions to the `UsdPreviewSurface` specification.

Our Pixar colleagues have shared the following language from the next release of the `UsdPreviewSurface` specification, providing additional clarity on the edge case behavior of opacity:

- `opacity`: When opacity is 1.0 then the prim is fully opaque, if it is smaller than 1.0 then the prim is translucent, when it is 0 the prim is fully transparent. Fully transparent objects will still receive a lighting response when the opacityMode is transparent. When the opacityMode is set to presence the lighting response will be scaled by the opacity.
- `opacityMode`: This input dictates how materials with zero opacity are interpreted and takes one of two inputs: transparent or presence. When the value is transparent materials with zero opacity still receive a lighting response as, for example, perfectly clear glass still has a specular response. However, when set to presence these materials will not receive any lighting and thus they always serve as cutouts. When using presence and semi-opaque materials the entire lighting response, including specular, will be scaled by opacity to allow for a smooth transition between materials with zero and non-zero opacity.
- `opacityThreshold`: The opacityThreshold input is useful for creating geometric cut-outs based on the opacity input. A value of 0.0 indicates that no masking is applied to the opacity input, while a value greater than 0.0 indicates that rendering of the surface is limited to the areas where the opacity is greater or equal to that value. A classic use of opacityThreshold is to create a leaf from an opacity input texture, in that case the threshold determines the parts of the opacity texture that will be fully transparent and not receive lighting. Note that when opacityThreshold is greater than zero, the opacity values less than the opacityThreshold will not be rendered, and the opacity values greater than or equal to the opacityThreshold will be fully visible. Thus, the opacityThreshold serves as a switch for how the opacity input is interpreted; this “translucent or masked” behavior is common in engines and renderers, and makes the UsdPreviewSurface easier to interchange. Recreating a translucent material that also provides a zero opacity-based mask, can be achieved by setting opacityThreshold to zero and opacityMode to presence.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant