forked from blender/blender
Make DomeLight visible for Storm delegate #68
@ -54,8 +54,7 @@ Engine::Engine(RenderEngine *bl_engine, const std::string &render_delegate_name)
|
||||
render_index_.get(), pxr::SdfPath::AbsoluteRootPath().AppendElementString("renderTask"));
|
||||
if (render_delegate_name == "HdStormRendererPlugin") {
|
||||
light_tasks_delegate_ = std::make_unique<LightTasksDelegate>(
|
||||
render_index_.get(),
|
||||
pxr::SdfPath::AbsoluteRootPath().AppendElementString("lightTasks"));
|
||||
render_index_.get(), pxr::SdfPath::AbsoluteRootPath().AppendElementString("lightTasks"));
|
||||
}
|
||||
|
||||
engine_ = std::make_unique<pxr::HdEngine>();
|
||||
|
@ -17,8 +17,8 @@
|
||||
|
||||
#include "CLG_log.h"
|
||||
|
||||
#include "render_task_delegate.h"
|
||||
#include "light_tasks_delegate.h"
|
||||
#include "render_task_delegate.h"
|
||||
|
||||
#include "scene_delegate/blender_scene_delegate.h"
|
||||
#include "scene_delegate/usd_scene_delegate.hh"
|
||||
|
@ -109,8 +109,7 @@ void FinalEngine::prepare_for_render(Depsgraph *depsgraph)
|
||||
if (light_tasks_delegate_) {
|
||||
light_tasks_delegate_->set_camera_path(free_camera_delegate_->GetCameraId());
|
||||
light_tasks_delegate_->set_camera_and_viewport(
|
||||
free_camera_delegate_->GetCameraId(), pxr::GfVec4d(0, 0, resolution_[0],
|
||||
resolution_[1]));
|
||||
free_camera_delegate_->GetCameraId(), pxr::GfVec4d(0, 0, resolution_[0], resolution_[1]));
|
||||
tasks_ = light_tasks_delegate_->get_tasks();
|
||||
}
|
||||
tasks_.push_back(render_task_delegate_->get_task());
|
||||
|
@ -9,7 +9,7 @@
|
||||
namespace blender::render::hydra {
|
||||
|
||||
LightTasksDelegate::LightTasksDelegate(pxr::HdRenderIndex *parent_index,
|
||||
pxr::SdfPath const &delegate_id)
|
||||
pxr::SdfPath const &delegate_id)
|
||||
: pxr::HdSceneDelegate(parent_index, delegate_id)
|
||||
{
|
||||
skydome_task = GetDelegateID().AppendElementString("simpleLightTask");
|
||||
@ -20,10 +20,7 @@ LightTasksDelegate::LightTasksDelegate(pxr::HdRenderIndex *parent_index,
|
||||
|
||||
pxr::HdTaskSharedPtrVector LightTasksDelegate::get_tasks()
|
||||
{
|
||||
return {
|
||||
GetRenderIndex().GetTask(skydome_task),
|
||||
GetRenderIndex().GetTask(simple_light_task)
|
||||
};
|
||||
return {GetRenderIndex().GetTask(skydome_task), GetRenderIndex().GetTask(simple_light_task)};
|
||||
}
|
||||
|
||||
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,
|
||||
pxr::GfVec4d const &viewport)
|
||||
pxr::GfVec4d const &viewport)
|
||||
{
|
||||
if (skydome_task_params_.viewport != viewport || skydome_task_params_.camera != camera_id) {
|
||||
skydome_task_params_.viewport = viewport;
|
||||
|
@ -240,10 +240,10 @@ void ViewportEngine::render(Depsgraph * /* depsgraph */, bContext *context)
|
||||
if (light_tasks_delegate_) {
|
||||
light_tasks_delegate_->set_camera_path(free_camera_delegate_->GetCameraId());
|
||||
light_tasks_delegate_->set_camera_and_viewport(free_camera_delegate_->GetCameraId(),
|
||||
pxr::GfVec4d(view_settings.border[0],
|
||||
view_settings.border[1],
|
||||
view_settings.border[2],
|
||||
view_settings.border[3]));
|
||||
pxr::GfVec4d(view_settings.border[0],
|
||||
view_settings.border[1],
|
||||
view_settings.border[2],
|
||||
view_settings.border[3]));
|
||||
}
|
||||
|
||||
if ((bl_engine_->type->flag & RE_USE_GPU_CONTEXT) == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user