12 #ifdef WITH_HYDRA_DISPLAY_DRIVER
22 #include <pxr/imaging/hd/renderPassState.h>
27 HdRprimCollection
const &collection,
29 : HdRenderPass(index, collection), _renderParam(renderParam)
38 GetRenderIndex()->GetRenderDelegate());
39 if (renderDelegate->IsDisplaySupported()) {
40 #ifdef WITH_HYDRA_DISPLAY_DRIVER
42 make_unique<HdCyclesDisplayDriver>(renderParam, renderDelegate->GetHgi()));
55 for (
const HdRenderPassAovBinding &aovBinding : _renderParam->
GetAovBindings()) {
56 if (aovBinding.renderBuffer && !aovBinding.renderBuffer->IsConverged()) {
64 void HdCyclesRenderPass::ResetConverged()
66 for (
const HdRenderPassAovBinding &aovBinding : _renderParam->
GetAovBindings()) {
68 renderBuffer->SetConverged(
false);
73 void HdCyclesRenderPass::_Execute(
const HdRenderPassStateSharedPtr &renderPassState,
74 const TfTokenVector &renderTags)
85 GetRenderIndex()->GetRenderDelegate());
87 const unsigned int settingsVersion = renderDelegate->GetRenderSettingsVersion();
90 const HdRenderPassAovBindingVector &aovBindings = renderPassState->GetAovBindings();
93 (settingsVersion != _lastSettingsVersion &&
97 if (renderDelegate->IsDisplaySupported()) {
99 HdRenderPassAovBinding displayAovBinding = !aovBindings.empty() ? aovBindings.front() :
100 HdRenderPassAovBinding();
101 if (displayAovBinding.aovName == HdAovTokens->color && displayAovBinding.renderBuffer) {
111 #if PXR_VERSION >= 2102
112 CameraUtilFraming framing = renderPassState->GetFraming();
113 if (!framing.IsValid()) {
114 const GfVec4f vp = renderPassState->GetViewport();
115 framing = CameraUtilFraming(GfRect2i(GfVec2i(0),
int(vp[2]),
int(vp[3])));
118 scene->
camera->set_full_width(framing.dataWindow.GetWidth());
119 scene->
camera->set_full_height(framing.dataWindow.GetHeight());
121 const GfVec4f vp = renderPassState->GetViewport();
131 renderPassState->GetWorldToViewMatrix(),
132 renderPassState->GetProjectionMatrix(),
133 renderPassState->GetClipPlanes(),
139 _lastSettingsVersion = settingsVersion;
145 #if PXR_VERSION >= 2102
146 buffer_params.
full_x =
static_cast<int>(framing.displayWindow.GetMin()[0]);
147 buffer_params.
full_y =
static_cast<int>(framing.displayWindow.GetMin()[1]);
148 buffer_params.
full_width =
static_cast<int>(framing.displayWindow.GetSize()[0]);
149 buffer_params.
full_height =
static_cast<int>(framing.displayWindow.GetSize()[1]);
151 buffer_params.
window_x = framing.dataWindow.GetMinX() - buffer_params.
full_x;
152 buffer_params.
window_y = framing.dataWindow.GetMinY() - buffer_params.
full_y;
153 buffer_params.
window_width = framing.dataWindow.GetWidth();
154 buffer_params.
window_height = framing.dataWindow.GetHeight();
159 buffer_params.
width =
static_cast<int>(vp[2]);
160 buffer_params.
height =
static_cast<int>(vp[3]);
179 void HdCyclesRenderPass::_MarkCollectionDirty()
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
void ApplyCameraSettings(PXR_NS::HdRenderParam *renderParam, CCL_NS::Camera *targetCamera) const
~HdCyclesRenderPass() override
HdCyclesRenderPass(PXR_NS::HdRenderIndex *index, const PXR_NS::HdRprimCollection &collection, HdCyclesSession *renderParam)
bool IsConverged() const override
const PXR_NS::HdRenderPassAovBindingVector & GetAovBindings() const
CCL_NS::Session * session
void SetDisplayAovBinding(const PXR_NS::HdRenderPassAovBinding &aovBinding)
void SyncAovBindings(const PXR_NS::HdRenderPassAovBindingVector &aovBindings)
void set_display_driver(unique_ptr< DisplayDriver > driver)
void cancel(bool quick=false)
void reset(const SessionParams &session_params, const BufferParams &buffer_params)
void set_output_driver(unique_ptr< OutputDriver > driver)
#define HDCYCLES_NAMESPACE_CLOSE_SCOPE