Make DomeLight visible for Storm delegate #68

Merged
Bogdan Nagirniak merged 5 commits from Vasyl-Pidhirskyi/blender_bn:BLEN-460 into hydra-render 2023-07-20 22:35:48 +02:00
5 changed files with 10 additions and 15 deletions
Showing only changes of commit 18486907b0 - Show all commits

View File

@ -54,8 +54,7 @@ Engine::Engine(RenderEngine *bl_engine, const std::string &render_delegate_name)
render_index_.get(), pxr::SdfPath::AbsoluteRootPath().AppendElementString("renderTask")); render_index_.get(), pxr::SdfPath::AbsoluteRootPath().AppendElementString("renderTask"));
if (render_delegate_name == "HdStormRendererPlugin") { if (render_delegate_name == "HdStormRendererPlugin") {
light_tasks_delegate_ = std::make_unique<LightTasksDelegate>( light_tasks_delegate_ = std::make_unique<LightTasksDelegate>(
render_index_.get(), render_index_.get(), pxr::SdfPath::AbsoluteRootPath().AppendElementString("lightTasks"));
pxr::SdfPath::AbsoluteRootPath().AppendElementString("lightTasks"));
} }
engine_ = std::make_unique<pxr::HdEngine>(); engine_ = std::make_unique<pxr::HdEngine>();

View File

@ -17,8 +17,8 @@
#include "CLG_log.h" #include "CLG_log.h"
#include "render_task_delegate.h"
#include "light_tasks_delegate.h" #include "light_tasks_delegate.h"
#include "render_task_delegate.h"
#include "scene_delegate/blender_scene_delegate.h" #include "scene_delegate/blender_scene_delegate.h"
#include "scene_delegate/usd_scene_delegate.hh" #include "scene_delegate/usd_scene_delegate.hh"

View File

@ -109,8 +109,7 @@ void FinalEngine::prepare_for_render(Depsgraph *depsgraph)
if (light_tasks_delegate_) { if (light_tasks_delegate_) {
light_tasks_delegate_->set_camera_path(free_camera_delegate_->GetCameraId()); light_tasks_delegate_->set_camera_path(free_camera_delegate_->GetCameraId());
light_tasks_delegate_->set_camera_and_viewport( light_tasks_delegate_->set_camera_and_viewport(
free_camera_delegate_->GetCameraId(), pxr::GfVec4d(0, 0, resolution_[0], free_camera_delegate_->GetCameraId(), pxr::GfVec4d(0, 0, resolution_[0], resolution_[1]));
resolution_[1]));
tasks_ = light_tasks_delegate_->get_tasks(); tasks_ = light_tasks_delegate_->get_tasks();
} }
tasks_.push_back(render_task_delegate_->get_task()); tasks_.push_back(render_task_delegate_->get_task());

View File

@ -9,7 +9,7 @@
namespace blender::render::hydra { namespace blender::render::hydra {
LightTasksDelegate::LightTasksDelegate(pxr::HdRenderIndex *parent_index, LightTasksDelegate::LightTasksDelegate(pxr::HdRenderIndex *parent_index,
pxr::SdfPath const &delegate_id) pxr::SdfPath const &delegate_id)
: pxr::HdSceneDelegate(parent_index, delegate_id) : pxr::HdSceneDelegate(parent_index, delegate_id)
{ {
skydome_task = GetDelegateID().AppendElementString("simpleLightTask"); skydome_task = GetDelegateID().AppendElementString("simpleLightTask");
@ -20,10 +20,7 @@ LightTasksDelegate::LightTasksDelegate(pxr::HdRenderIndex *parent_index,
pxr::HdTaskSharedPtrVector LightTasksDelegate::get_tasks() pxr::HdTaskSharedPtrVector LightTasksDelegate::get_tasks()
{ {
return { return {GetRenderIndex().GetTask(skydome_task), GetRenderIndex().GetTask(simple_light_task)};
GetRenderIndex().GetTask(skydome_task),
GetRenderIndex().GetTask(simple_light_task)
};
} }
void LightTasksDelegate::set_camera_path(pxr::SdfPath const &camera_path) void LightTasksDelegate::set_camera_path(pxr::SdfPath const &camera_path)
@ -32,7 +29,7 @@ void LightTasksDelegate::set_camera_path(pxr::SdfPath const &camera_path)
} }
void LightTasksDelegate::set_camera_and_viewport(pxr::SdfPath const &camera_id, void LightTasksDelegate::set_camera_and_viewport(pxr::SdfPath const &camera_id,
pxr::GfVec4d const &viewport) pxr::GfVec4d const &viewport)
{ {
if (skydome_task_params_.viewport != viewport || skydome_task_params_.camera != camera_id) { if (skydome_task_params_.viewport != viewport || skydome_task_params_.camera != camera_id) {
skydome_task_params_.viewport = viewport; skydome_task_params_.viewport = viewport;

View File

@ -240,10 +240,10 @@ void ViewportEngine::render(Depsgraph * /* depsgraph */, bContext *context)
if (light_tasks_delegate_) { if (light_tasks_delegate_) {
light_tasks_delegate_->set_camera_path(free_camera_delegate_->GetCameraId()); light_tasks_delegate_->set_camera_path(free_camera_delegate_->GetCameraId());
light_tasks_delegate_->set_camera_and_viewport(free_camera_delegate_->GetCameraId(), light_tasks_delegate_->set_camera_and_viewport(free_camera_delegate_->GetCameraId(),
pxr::GfVec4d(view_settings.border[0], pxr::GfVec4d(view_settings.border[0],
view_settings.border[1], view_settings.border[1],
view_settings.border[2], view_settings.border[2],
view_settings.border[3])); view_settings.border[3]));
} }
if ((bl_engine_->type->flag & RE_USE_GPU_CONTEXT) == 0) { if ((bl_engine_->type->flag & RE_USE_GPU_CONTEXT) == 0) {