Skip to content

Commit a7c0637

Browse files
rajabalapixar-oss
authored andcommitted
[hdx] Fix free camera setter.
In SetViewAndProjectionMatrix, we were ignoring any clipping planes that were set. This resulted in repeated thrashing on the clipping planes state when SetClippingPlanes was called leading to spurious scene updates causing renders to restart and never converge. (Internal change: 2380790)
1 parent 04ccdb0 commit a7c0637

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

pxr/imaging/hdx/freeCameraPrimDataSource.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ HdxFreeCameraPrimDataSource::SetWindowPolicy(
298298
}
299299
static const HdDataSourceLocator locator =
300300
HdCameraSchema::GetDefaultLocator()
301-
.Append(_tokens->windowPolicy);
301+
.Append(_tokens->windowPolicy);
302302
dirtyLocators->insert(locator);
303303
}
304304

@@ -308,10 +308,11 @@ HdxFreeCameraPrimDataSource::SetViewAndProjectionMatrix(
308308
const GfMatrix4d& projectionMatrix,
309309
HdDataSourceLocatorSet * dirtyLocators)
310310
{
311-
SetCamera(
312-
_CameraFromViewAndProjectionMatrix(
313-
viewMatrix, projectionMatrix),
314-
dirtyLocators);
311+
GfCamera cam = _CameraFromViewAndProjectionMatrix(
312+
viewMatrix, projectionMatrix);
313+
cam.SetClippingPlanes(_info->camera.GetClippingPlanes());
314+
315+
SetCamera(cam, dirtyLocators);
315316
}
316317

317318
void

pxr/imaging/hdx/taskControllerSceneIndex.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2398,7 +2398,8 @@ SetFreeCameraClipPlanes(const std::vector<GfVec4d> &clippingPlanes)
23982398
}
23992399

24002400
HdDataSourceLocatorSet locators;
2401-
ds->SetClippingPlanes({clippingPlanes.begin(), clippingPlanes.end()});
2401+
ds->SetClippingPlanes(
2402+
{clippingPlanes.begin(), clippingPlanes.end()}, &locators);
24022403

24032404
if (locators.IsEmpty()) {
24042405
return;

0 commit comments

Comments
 (0)