Page MenuHome

Cycles Hydra Render Delegate
Confirmed, NormalPublicTO DO

Description

Status

There is experimental support for building Cycles as a Hydra render delegate. This enables Cycles to be used as a renderer in applications with Hydra support, for example Usdview, Omniverse and Houdini.

No official support is provided at this point due to the experimental state.

Features

  • CPU/CUDA/OptiX/HIP/Metal support
  • Camera Settings
  • Render Settings (automatically queried from Cycles via node type system)
  • AOVs
    • Basic AOVs (color, depth, normal, primId, instanceId)
    • Other AOVs
    • Custom AOVs
  • Lights (Disk, Distant, Dome, Rect, Sphere)
  • Meshes
  • Geom Subsets
  • Subdivision Surfaces (using native Cycles support)
  • Custom Primvars (converted to Cycles attributes)
  • Cycles Materials (can be exported to USD using the universal-scene-description branch of Blender)
  • USD Preview Surface Materials
  • Curves
  • Point Clouds
  • OpenVDB Volumes
  • Motion Blur
  • Display driver
    • Windows OpenGL interop
    • macOS interop
    • Linux interop
  • Device selection

.. list to be completed ...

Bugs

  • Wrong environment map rotation and default white environment inconsistent with other renderers
  • Fix Blender USD exporter not setting normalize attribute, causing too bright lights
  • Fix excessive camera depth of field with scenes exported from Blender
  • Fix viewport with OpenGL interop not working in Houdini on Windows (D15090)

Building

https://wiki.blender.org/wiki/Building_Blender/CyclesHydra

Event Timeline

Brecht Van Lommel (brecht) changed the task status from Needs Triage to Confirmed.Mar 23 2022, 2:57 PM
Brecht Van Lommel (brecht) created this task.

Thanks for the great work on this.
Are there any details, which build configurations have been tested?
I'm getting some build errors on windows vs2019 when Python is enabled, so I had to disable it in the USD (21.08) and the hdCycles builds.
Also the OpenVDB versions are causing some problems. The USD default is v6.1 and the Cycles defaulft is 8.0.1 and changing any of them to match them is generating new errors.

I am havening similar issues when trying to build it under Linux.
One of the main problems seems to be that the build prefers using the
USD, Boost, and Python versions of the Blender dependencies and not the ones used to build the external USD.

Is there any reason why hdCycles uses its own FindUSD.cmake to set up the USD dependencies instead of the cmake config which is automatically build
by USD?

Is there any reason why hdCycles uses its own FindUSD.cmake to set up the USD dependencies instead of the cmake config which is automatically build

Try setting the CMAKE_FIND_PACKAGE_PREFER_CONFIG option to sidestep that behavior.

It's probably not possible to use Blender's precompiled libraries at all, unless you build USD against Blender's precompiled libraries. So right now, it may be easiest to build without a precompiled library directory present, and setting TBB_ROOT_DIR, OPENVDB_ROOT_DIR, PYTHON_ROOT_DIR, etc. manually if needed.

We should be able to make this process smoother though, or at least document it.

Right, the build process could use some improvement. Setting USD_ROOT, TBB_ROOT(_DIR), OPENVDB_ROOT(_DIR) etc. works for the moment though (most importantly USD_ROOT and OPENVDB_ROOT, the others are used in mostly ABI compatible ways, so doesn't matter as much if linking against the different version in the precompiled libraries). Can also just disable OpenVDB support to not worry about it at all with WITH_OPENVDB=0. To get a USD build working that was built with Python, currently have to set a USD_PYTHON_LIBRARIES CMake variable with the additional libs to link (e.g. USD_PYTHON_LIBRARIES=boost_python37-vc141-mt-x64-1_68;python37 on Windows for Python 3.7).

Relying on find_package(pxr) and pxrConfig.cmake could be an option to solve this, just need to find a way to integrate this into the Blender build system without disrupting it when not building the Hydra render delegate.

I committed various fixes for Linux, and updated the standalone repository to include the Hydra render delegate. Hopefully I didn't break Windows in the process.

I did some work towards getting this building against Houdini in D14594: Cycles Hydra: support for building against Houdini.

It's not actually working yet, any help debugging this is welcome.

Awesome! There is a bit more necessary to get it running with Houdini on Windows it seems. I posted some suggestions to D14594 that made it work for me.

I added support for rendering USD files from the Cycles standalone executable in rC1a5f4932b481: Add USD as a file format for Cycles standalone rendering and rC5d03a41653e3: Build: preparation for supporting USD in standalone.

This also includes changes to make the Hydra render delegate build using the upcoming 3.2 precompiled libraries update. The resulting plugin will not be particularly useful as Blender can't load it, but being able to build the standalone executable without any additional libraries is nice.

Still rough around the edges in many ways, here's a render with a USD file exported from Blender:

I also made some changes to Houdini building to fix issues with packages in rC949e461053ab: Build: install Houdini render delegate in houdini/dso/usd_plugins.