Skip to content
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

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

JGamache-autodesk
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@seando-adsk seando-adsk left a 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.

@JGamache-autodesk JGamache-autodesk added the ready-for-merge Development process is finished, PR is ready for merge label Jan 4, 2023
@seando-adsk
Copy link
Collaborator

@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;
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

@vlasovi vlasovi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@JGamache-autodesk
Copy link
Collaborator Author

@seando-adsk Ready for merge.

@seando-adsk seando-adsk merged commit c52fc26 into dev Jan 11, 2023
@seando-adsk seando-adsk deleted the gamaj/MAYA-124105/fix_material_transparency branch January 11, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
materials ready-for-merge Development process is finished, PR is ready for merge vp2renderdelegate Related to VP2RenderDelegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants