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

Geometry lights support in the render delegate #1080

Merged
merged 5 commits into from Apr 4, 2022

Conversation

sebastienblor
Copy link
Collaborator

Changes proposed in this pull request
First implementation of usd geometry lights in hydra. This currently supports the usd primitive UsdLuxGeometryLight which is what our writer authors.
This required the following changes :

  • Added a usd_imaging adapter for geometry lights. There's already one in the usd repo but it does nothing. I wanted to make the adapter inherit from UsdImagingLightAdapter, but this isn't linking properly since the virtual function _RemovePrim doesn't have the USDIMAGING_API tag and so the symbol isn't exported. Even if I hack it by redefining the function, I still get strange behaviours. So instead, I'm just inheriting from the base UsdImagingPrimAdapter class. In this adapter, I can redefine the function Get so that when we're asked to return the geometry relationship, we look for the mesh path, convert it to the render index path, and provide that SdfPath to the delegate
  • In the render delegate side, we now read geometry lights and convert them to arnold mesh lights. In addition to the usual lights delegate reading code, we also call the Get function explained above so that we can get the path to the mesh light. Then we look for it in the arnold universe and set it to the mesh light.
  • For some reason, even though I'm setting the HdDiryFlags properly in the adapter class, I'm not receiving the right thing in the render delegate. For now I'm doing an exception for mesh lights, and always update the light whenever Sync is called. The downside is that we'll always set all light attributes even when only transform in modified, etc...
  • For mesh lights, it's important to set the mesh visibility properly, and it's currently being set as arnold:visibility in our writer. But the render delegate current only support bool flags like arnold:visibility:camera , etc... (the procedural supports both). I added support for full visibility being set in the delegate too (in utils.cpp).
  • We need to declare the new adapter in the schemas and in pluginfo.json

I realized we didn't have any test for mesh lights in our procedural testsuite so I made one as test_0209. I verified that I get a similar result in Hydra now

Issues fixed in this pull request
Fixes #971

@sebastienblor sebastienblor added enhancement New feature or request render delegate Related to the Arnold Render Delegate labels Mar 17, 2022
@jhodgson jhodgson changed the title First draft of geometry lights support in the render delegate Geometry lights support in the render delegate Apr 4, 2022
@sebastienblor sebastienblor merged commit a319376 into Autodesk:master Apr 4, 2022
@sebastienblor sebastienblor deleted the pr/971 branch April 4, 2022 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request render delegate Related to the Arnold Render Delegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for mesh lights in Hydra
2 participants