-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAYA-124105 Fix opacity computations for MaterialX and USD materials #2790
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not my area of expertise, but the code changes look okay and there is a unit test. All good.
@vlasovi Ivan can you please code review this when you have time. Thanks. |
@@ -145,7 +145,8 @@ class GlslGeneratorWrapperBase | |||
|
|||
// Maya images require a texture coordinates to be flipped in V. | |||
genOptions.fileTextureVerticalFlip = true; | |||
genOptions.hwTransparency = mx::isTransparentSurface(_element, generator.getTarget()); | |||
// Enabling hwTransparency to ensure a vec4 output with correct alpha value. | |||
genOptions.hwTransparency = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JGamache-autodesk What effect does this have? I just want to make sure we don't force opaque objects to be treated as transparent objects here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting it to false causes the fragment to return a color3 and then there is no alpha we can use if the shader is transparent.
Setting it to true forces it to always return a color4. The alpha channel will be set correctly and this will allow to turn transparency at the effect instance level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allows us to re-use the same MaterialX OpenGL shader for both transparent and opaque shading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
@seando-adsk Ready for merge. |
No description provided.