WIP: Support more AOVs #72

Closed
Georgiy Markelov wants to merge 6 commits from DagerD/blender:BLEN-461 into hydra-render

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit e126a467dd - Show all commits

View File

@ -17,6 +17,10 @@
#include "camera.h"
#include "final_engine.h"
PXR_NAMESPACE_OPEN_SCOPE
TF_DEFINE_PRIVATE_TOKENS(tokens_, (worldCoordinate));
PXR_NAMESPACE_CLOSE_SCOPE
namespace blender::render::hydra {
void FinalEngine::render(Depsgraph *depsgraph)
@ -120,13 +124,13 @@ void FinalEngine::prepare_for_render(Depsgraph *depsgraph)
aovs_map_.add_new("Combined", pxr::HdAovTokens->color);
aovs_map_.add_new("Depth", pxr::HdAovTokens->depth);
aovs_map_.add_new("Normal", pxr::HdAovTokens->normal);
aovs_map_.add_new("Position", pxr::tokens_->worldCoordinate);
RenderResult *result = RE_engine_get_result(bl_engine_);
RenderLayer *layer = (RenderLayer *)result->layers.first;
for (RenderPass *pass = (RenderPass *)layer->passes.first; pass != nullptr; pass = pass->next) {
if (aovs_map_.lookup_key_ptr(pass->name)) {
render_images_.emplace(pass->name,
std::vector<float>(pass->rectx * pass->recty * pass->channels));
render_images_.emplace(pass->name, std::vector<float>(pass->rectx * pass->recty * pass->channels));
}
}
}