Render: support USD Hydra render delegates

Hydra is a rendering architecture part of USD, designed to abstract the
host application from the renderer. A renderer implementing a Hydra
render delegate can run in any host application supporting Hydra, which
now includes Blender.

For external renderers this means less code to be written, and improved
performance due to a using a C++ API instead of a Python API.

Add-ons need to subclass bpy.types.HydraRenderEngine. See the example in
the Python API docs for details.

An add-on for Hydra Storm will be included as well. This is USD's
rasterizing renderer, used in other applications like usdview. For users
it can provide a preview of USD file export, and for developers it
serves a reference.

There are still limitations and missing features, especially around
materials. The remaining to do items are tracked in #110765.

This feature was contributed by AMD.

Ref #110765

Co-authored-by: Georgiy Markelov <georgiy.m.markelov@gmail.com>
Co-authored-by: Vasyl-Pidhirskyi <vpidhirskyi@gmail.com>
Co-authored-by: Brian Savery <brian.savery@gmail.com>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/104712
This commit is contained in:
Bogdan Nagirniak
2023-08-04 15:10:48 +02:00
committed by Brecht Van Lommel
parent 61f407d427
commit 04bb5f9995
54 changed files with 5144 additions and 55 deletions

View File

@@ -364,6 +364,13 @@ if(WITH_HARU)
add_definitions(-DWITH_HARU)
endif()
if(WITH_HYDRA)
list(APPEND LIB
bf_render_hydra
)
add_definitions(-DWITH_HYDRA)
endif()
blender_add_lib(bf_python "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
# RNA_prototypes.h

View File

@@ -257,6 +257,11 @@ static PyObject *CCL_initPython()
}
#endif
#ifdef WITH_HYDRA
/* defined in render_hydra module */
PyObject *BPyInit_hydra();
#endif
static _inittab bpy_internal_modules[] = {
{"mathutils", PyInit_mathutils},
#if 0
@@ -286,6 +291,9 @@ static _inittab bpy_internal_modules[] = {
#endif
{"gpu", BPyInit_gpu},
{"idprop", BPyInit_idprop},
#ifdef WITH_HYDRA
{"_bpy_hydra", BPyInit_hydra},
#endif
{nullptr, nullptr},
};