WIP Make shadows visible for Storm delegate #80

Closed
Vasyl Pidhirskyi wants to merge 16 commits from Vasyl-Pidhirskyi/blender_bn:BLEN-469 into hydra-render

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
3 changed files with 3 additions and 6 deletions
Showing only changes of commit 4b99d62d33 - Show all commits

View File

@ -135,7 +135,6 @@ float Engine::renderer_percent_done()
pxr::HdTaskSharedPtrVector Engine::tasks() pxr::HdTaskSharedPtrVector Engine::tasks()
{ {
bool has_shadows = hydra_scene_delegate_->has_shadows();
pxr::HdTaskSharedPtrVector res; pxr::HdTaskSharedPtrVector res;
if (light_tasks_delegate_) { if (light_tasks_delegate_) {
if (scene_->r.alphamode != R_ALPHAPREMUL) { if (scene_->r.alphamode != R_ALPHAPREMUL) {
@ -147,7 +146,7 @@ pxr::HdTaskSharedPtrVector Engine::tasks()
#endif #endif
} }
res.push_back(light_tasks_delegate_->simple_task()); res.push_back(light_tasks_delegate_->simple_task());
if (has_shadows) { if (hydra_scene_delegate_->has_shadows()) {
res.push_back(light_tasks_delegate_->shadow_task()); res.push_back(light_tasks_delegate_->shadow_task());
} }
} }

View File

@ -26,7 +26,6 @@ namespace blender::render::hydra {
void FinalEngine::render() void FinalEngine::render()
{ {
const ViewLayer *view_layer = DEG_get_evaluated_view_layer(depsgraph_); const ViewLayer *view_layer = DEG_get_evaluated_view_layer(depsgraph_);
bool has_shadows = hydra_scene_delegate_->has_shadows();
char scene_name[MAX_ID_FULL_NAME]; char scene_name[MAX_ID_FULL_NAME];
BKE_id_full_name_get(scene_name, &scene_->id, 0); BKE_id_full_name_get(scene_name, &scene_->id, 0);
@ -49,7 +48,7 @@ void FinalEngine::render()
render_task_delegate_->set_viewport(pxr::GfVec4d(0, 0, width, height)); render_task_delegate_->set_viewport(pxr::GfVec4d(0, 0, width, height));
if (light_tasks_delegate_) { if (light_tasks_delegate_) {
light_tasks_delegate_->set_viewport(pxr::GfVec4d(0, 0, width, height)); light_tasks_delegate_->set_viewport(pxr::GfVec4d(0, 0, width, height));
light_tasks_delegate_->set_shadows(has_shadows); light_tasks_delegate_->set_shadows(hydra_scene_delegate_->has_shadows());
} }
RenderResult *rr = RE_engine_get_result(bl_engine_); RenderResult *rr = RE_engine_get_result(bl_engine_);

View File

@ -213,7 +213,6 @@ GPUTexture *DrawTexture::texture() const
void ViewportEngine::render() void ViewportEngine::render()
{ {
ViewSettings view_settings(context_); ViewSettings view_settings(context_);
bool has_shadows = hydra_scene_delegate_->has_shadows();
if (view_settings.width() * view_settings.height() == 0) { if (view_settings.width() * view_settings.height() == 0) {
return; return;
}; };
@ -228,7 +227,7 @@ void ViewportEngine::render()
render_task_delegate_->set_viewport(viewport); render_task_delegate_->set_viewport(viewport);
if (light_tasks_delegate_) { if (light_tasks_delegate_) {
light_tasks_delegate_->set_viewport(viewport); light_tasks_delegate_->set_viewport(viewport);
light_tasks_delegate_->set_shadows(has_shadows); light_tasks_delegate_->set_shadows(hydra_scene_delegate_->has_shadows());
} }
render_task_delegate_->add_aov(pxr::HdAovTokens->color); render_task_delegate_->add_aov(pxr::HdAovTokens->color);