Skip to content

Conversation

@hodoulp
Copy link
Contributor

@hodoulp hodoulp commented Jul 25, 2025

The pull request adds the framing in the public API and unit tests to demonstrate that it works.

In fact, it replaces the former ViewportportRect by the generic pxr::CameraUtilFraming introducing lot of changes. I still picked that solution to have the most generic method directly in the public API.

Note: There are some changes in all the unit tests (explained the number of changed files in this pull request). But these changes are quite simple and there are two helpers to make that transition even easier.

@hodoulp hodoulp requested review from Copilot and debloip-adsk July 25, 2025 22:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds framing functionality to the public API along with supporting unit tests to validate the implementation.

  • Adds new baseline test image for frame display testing on macOS
  • Implements framing capabilities in the public API
  • Includes unit tests to demonstrate and verify framing functionality

@hodoulp hodoulp changed the title OGSMOD-7803 - Add framing to the public API OGSMOD-7803 - MayaHydra - Add framing to the public API Jul 28, 2025
Copy link
Contributor

@debloip-adsk debloip-adsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it and it does work for our purposes. However, I am wondering if there is a benefit to having the framing param be part of the ViewParams/viewInfo, when it is simply used to set renderParams.framing, which is already accessible?

@hodoulp
Copy link
Contributor Author

hodoulp commented Jul 28, 2025

I tested it and it does work for our purposes. However, I am wondering if there is a benefit to having the framing param be part of the ViewParams/viewInfo, when it is simply used to set renderParams.framing, which is already accessible?

My point is that it makes the API more understandable / readable i.e., consumer can set exactly what the context needs (nothing to guess).

@hodoulp hodoulp marked this pull request as ready for review July 30, 2025 17:26
@hodoulp
Copy link
Contributor Author

hodoulp commented Jul 30, 2025

Before moving forward, can @AdamFelt and/or @pixnblox have a look?

@hodoulp
Copy link
Contributor Author

hodoulp commented Aug 21, 2025

cc'ing @pixnblox, @erikaharrison-adsk and/or @sebastienberube-adsk can you have a look?

Copy link

@kohakukun kohakukun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in general but, as this is open source, we might want to keep a changelog since this is a breaking change. This change would increase the major version

TestHelpers::FramePassInstance::CreateInstance(stage.stage(), context->_backend);

// Render 10 times (i.e., arbitrary number to guaranty best result).
int frameCount = 10;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to render multiple times? Is there something like noise cancelling or other statistical methods happening in the rendering?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometime you need several passes to have a 'complete' render when using Storm.

ASSERT_TRUE(context->_backend->compareImages(imageFile));
}

TEST(TestViewportToolbox, TestFramePasses_DisplayClipping1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, this is the use case which was not possible with only the viewport?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. But it was possible by directly accessing the underneath render pass. Now it's easier to access and customize.


params.renderBufferSize = GfVec2i(width, height);
params.viewInfo.viewport = { { 0, 0 }, { width, height } };
params.renderBufferSize = GfVec2i(width, height);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I would use the style that was used before and is being used in the other lines. With the spaces to generate alignment. This also will reduce the list of changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line still aligns with the line below which changed.

/// Gets the viewport dimensions.
virtual const PXR_NS::GfVec4i GetViewport() const
/// Gets the viewport positions & dimensions.
virtual const PXR_NS::GfRange2f GetViewport() const

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO since we are moving away from the viewport keyword, we might change the getter as well and have maybe GetDisplayWindow and GetDataWindow

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lot of impacts on existing code but it's a good idea.

hodoulp and others added 2 commits August 25, 2025 15:14
Signed-off-by: Patrick Hodoul <[email protected]>
hodoulp and others added 3 commits August 26, 2025 09:09
Signed-off-by: Patrick Hodoul <[email protected]>
Signed-off-by: Patrick Hodoul <[email protected]>
Signed-off-by: Patrick Hodoul <[email protected]>
@hodoulp hodoulp merged commit cf28658 into main Aug 27, 2025
10 checks passed
@hodoulp hodoulp deleted the hodoulp/add_framing branch August 27, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants