-
Notifications
You must be signed in to change notification settings - Fork 202
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
pxrUsdPreviewSurface opacity support broken following PR #574 #607
Comments
@mattyjams Thanks for reporting the issue. The intention of the change to the render delegate version of UsdPreviewSurface.xml is to generate the opacity vertex stream requirement, which we can directly fill with the floating point Instead of your proposal, can we do it this way?
I think in this way we can ensure both sides can work as expected. Let me know what you think. By the way, the render delegate version has had another change to support multiple Maya lights, so the Pixar shading node override will also benefit from the merge of PR #574 . |
I forgot that the more important reason of the change is that we try to match the shader fragment parameter names with the My above proposal is not changed. |
Thanks for the notes here, @HdC-adsk. I just implemented your proposed solution in #626. Let me know what you think! |
Addressed by #626. Thanks again, @HdC-adsk! |
Describe the bug
Following the merge of #574, the
pxrUsdPreviewSurface
shading node now uses the fragment graph XML from the VP 2.0 render delegate instead of its own version. One important difference there is that the render delegate version uses anopacity
property instead of atransparency
property. There were no changes topxrUsdPreviewSurface
or its shading node override to account for this, so as a result theopacity
control onpxrUsdPreviewSurface
is no longer working.This was uncovered by running the
testPxrUsdPreviewSurfaceDraw
test internally at Pixar after merging the PR. This test is unfortunately not being run in the open source repo.I was able to fix the issue by reverting the
UsdPreviewSurface
fragment graph in vp2ShaderFragments to usetransparency
instead as it did before it was copied there frompxrUsdPreviewSurface
. That change can be seen in mattyjams@1a6628a.I'm not exactly sure how or if that fragment graph is used by the VP2.0 render delegate, but I would guess that we don't actually want to fix this that way. It would seem then that we need to modify the shading node override for
pxrUsdPreviewSurface
, and/or modify the shading node itself. I remember running into problems though when writing the node because of the inversion from opacity to transparency, and the fact that the attribute declared intransparencyParameter()
of the override seems to be expected to have "transparency" semantics (zero is fully opaque and one is fully transparent).Steps to reproduce
Open the test scene here:
https://github.com/Autodesk/maya-usd/blob/dev/test/lib/usd/pxrUsdPreviewSurface/PxrUsdPreviewSurfaceDrawTest/PxrUsdPreviewSurfaceDrawTest.ma
You should notice that in the third "column" from the right, the spheres are all opaque and ramp from solid white at the front to middle gray in the back.
This is the image being produced when I run the test:
Expected behavior
The spheres in the third "column" from the right should ramp from fully transparent to fully opaque, matching the baseline image here:
https://github.com/Autodesk/maya-usd/blob/dev/test/lib/usd/pxrUsdPreviewSurface/PxrUsdPreviewSurfaceDrawTest/baseline/PxrUsdPreviewSurfaceDrawTest_value_ramps.png
Specs
The text was updated successfully, but these errors were encountered: