Skip to content

Commit

Permalink
[Hdx] Adding to Hdx TaskController the SetShadowParams from pull requ…
Browse files Browse the repository at this point in the history
…est 541.

(Internal change: 1899710)
  • Loading branch information
poljere authored and pixar-oss committed Oct 3, 2018
1 parent 5cb1713 commit e5c8d4f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
21 changes: 21 additions & 0 deletions pxr/imaging/lib/hdx/taskController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,27 @@ HdxTaskController::SetRenderParams(HdxRenderTaskParams const& params)
}
}

void
HdxTaskController::SetShadowParams(HdxShadowTaskParams const& params)
{
if (!GetRenderIndex()->IsSprimTypeSupported(HdPrimTypeTokens->simpleLight)){
return;
}

HdxShadowTaskParams oldParams =
_delegate.GetParameter<HdxShadowTaskParams>(
_shadowTaskId, HdTokens->params);

HdxShadowTaskParams mergedParams = params;
mergedParams.camera = oldParams.camera;

if (mergedParams != oldParams) {
_delegate.SetParameter(_shadowTaskId, HdTokens->params, mergedParams);
GetRenderIndex()->GetChangeTracker().MarkTaskDirty(
_shadowTaskId, HdChangeTracker::DirtyParams);
}
}

void
HdxTaskController::SetEnableShadows(bool enable)
{
Expand Down
7 changes: 6 additions & 1 deletion pxr/imaging/lib/hdx/taskController.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,14 @@ class HdxTaskController {
HDX_API
void SetEnableShadows(bool enable);

/// Set the shadow params. Note: params.camera will
/// be overwritten, since it comes from SetCameraState.
HDX_API
void SetShadowParams(HdxShadowTaskParams const& params);

/// -------------------------------------------------------
/// Progressive Image Generation

/// Return whether the image has converged.
HDX_API
bool IsConverged() const;
Expand Down

0 comments on commit e5c8d4f

Please sign in to comment.