Align UsdPreviewSurface opacity with upcoming specification#2796
Open
jstone-lucasfilm wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
Open
Align UsdPreviewSurface opacity with upcoming specification#2796jstone-lucasfilm wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
UsdPreviewSurface opacity with upcoming specification#2796jstone-lucasfilm wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
Conversation
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changelist updates the opacity behavior in the MaterialX graph definition of
UsdPreviewSurface, aligning it with upcoming revisions to theUsdPreviewSurfacespecification.Our Pixar colleagues have shared the following language from the next release of the
UsdPreviewSurfacespecification, 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.