Hydra render engine #104712

Closed
Bogdan Nagirniak wants to merge 142 commits from BogdanNagirniak/blender:hydra-render into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 12 additions and 10 deletions
Showing only changes of commit 7ae4cd82c5 - Show all commits

View File

@ -40,8 +40,12 @@ static std::string cache_image_file(Image *image,
ImageSaveOptions opts;
if (BKE_image_save_options_init(&opts, main, scene, image, iuser, false, false)) {
BogdanNagirniak marked this conversation as resolved Outdated

true -> false, it does not need to guess a filepath since you are setting it.

true -> false, it does not need to guess a filepath since you are setting it.
char file_name[32];
const char *r_ext;
BKE_image_path_ext_from_imformat(&scene->r.im_format, &r_ext);
const char *r_ext = BLI_path_extension_or_end(image->id.name);
if (!pxr::HioImageRegistry::GetInstance().IsSupportedImageFile(image->id.name)) {
BogdanNagirniak marked this conversation as resolved Outdated

Pass nullptr for reports if you are not going to do anything with them. Then it will print errors to the console instead of silently ignroing them.

Pass `nullptr` for reports if you are not going to do anything with them. Then it will print errors to the console instead of silently ignroing them.
BKE_image_path_ext_from_imformat(&scene->r.im_format, &r_ext);
opts.im_format = scene->r.im_format;
}
snprintf(file_name, sizeof(file_name), "img_%016llx%s", (uintptr_t)image, r_ext);
file_path = get_cache_file(file_name);

View File

@ -90,7 +90,7 @@ void WorldData::init()
if (!color_input.directly_linked_links().is_empty()) {
bNode *color_input_node = color_input.directly_linked_links()[0]->fromnode;
if (color_input_node->type == SH_NODE_TEX_IMAGE) {
if (ELEM(color_input_node->type, SH_NODE_TEX_IMAGE, SH_NODE_TEX_ENVIRONMENT)) {
NodeTexImage *tex = static_cast<NodeTexImage *>(color_input_node->storage);
Image *image = (Image *)color_input_node->id;
if (image) {
@ -176,13 +176,11 @@ void WorldData::write_transform()
{
transform = pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(1.0, 0.0, 0.0), -90), pxr::GfVec3d());
/* TODO : do this check via RenderSettings*/
if (scene_delegate_->engine->render_delegate_name == "HdRprPlugin") {
transform *= pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(1.0, 0.0, 0.0), -180),
pxr::GfVec3d());
transform *= pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(0.0, 0.0, 1.0), 90.0),
pxr::GfVec3d());
}
transform *= pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(1.0, 0.0, 0.0), -180),
pxr::GfVec3d());
transform *= pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(0.0, 0.0, 1.0), 90.0),
pxr::GfVec3d());
}
} // namespace blender::render::hydra