Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add storm support for camera exposure controls #3464

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

pmolodo
Copy link
Contributor

@pmolodo pmolodo commented Dec 13, 2024

Description of Change(s)

This is a follow-up / add-on to the PR which adds camera exposure controls:

It adds HdxExposureScaleTask to allow visualization of the camera exposure controls in Storm.

See here to just see the additional changes, vs #3085:

Checklist

[X] I have created this PR based on the dev branch

[X] I have followed the coding conventions

[ ] I have added unit tests that exercise this functionality (Reference:
testing guidelines)

[X] I have verified that all unit tests pass with the proposed changes

[X] I have submitted a signed Contributor License Agreement (Reference:
Contributor License Agreement instructions)

@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-10512

(This is an automated message. See here for more information.)

@jesschimein
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pmolodo pmolodo force-pushed the usdGeomCamera-exposure-storm branch from adb7ebb to 1a69581 Compare December 18, 2024 20:44
Copy link
Contributor

@tcauchois tcauchois left a comment

Choose a reason for hiding this comment

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

Left a few comments about the PR; not sure I can review this yet. I'm excited about it though!

@@ -54,9 +54,6 @@ class HdxColorChannelTask : public HdxTask
// Returns true if the values were updated. False if unchanged.
bool _UpdateParameterBuffer(float screenSizeX, float screenSizeY);

/// Apply the color channel filtering.
void _ApplyColorChannel();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you revert the changes to colorChannelTask? They seem unrelated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Heh, you caught me... I tried to sneak in a few commits with some minor code cleanup. Moved them to a separate PR: #3521

@@ -2297,6 +2297,42 @@ class Camera "Camera" (
However, it follows that if even one property is authored in the correct
scene units, then they all must be.

\\section UsdGeom_CameraExposure Camera Exposure Model
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be great to rebase this CL on top of dev; now that the exposure schema has landed, it would make the PR much smaller.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@pmolodo pmolodo force-pushed the usdGeomCamera-exposure-storm branch 2 times, most recently from a8793af to 77a2a03 Compare February 5, 2025 17:06
@jesschimein
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

}
}

// Currently, we're querying GetLinearExposureScale() every frame - not
Copy link
Contributor

Choose a reason for hiding this comment

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

When "linearExposureScale" is updated, the target camera will get an "HdCamera::DirtyParams" update. You could add a version counter to the HdCamera, and check if the task has the latest version, although that only seems worthwhile if _compositor->SetShaderConstants is expensive.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the note to essentially just say what you just did:

https://github.com/PixarAnimationStudios/OpenUSD/compare/cf0b28ae9427c505b1203f2703a43d2da0d5c71c..671584d67090cbf5c0ff0a6e45948d8e37cea3f3#diff-3924f5481764e570f5ee99cd9387fa56621c09b9c6a58f08c3ee240c70bdc86aR60

    // Currently, we're querying GetLinearExposureScale() every frame -
    // if we wanted to be more selective:
    //
    // - target camera should get a HdCamera::DirtyParams update whenever
    //   any input attrs to linearExposureScale change
    // - we could store a version counter on the HdCamera
    // - ...and a `_lastCamVersion` on this task, and then only update
    //   our _linearExposureScale if it didn't == cam's version
    //
    // However, this shouldn't be a problem unless
    // _compositor->SetShaderConstants is expensive, so not going to
    // optimize unless we have evidence of that.

I can also just remove the comment entirely, if you think this is unlikely to ever be an issue.

@@ -44,6 +44,7 @@ pxr_library(hdx
colorCorrectionTask
drawTargetTask
effectsShader
exposureScaleTask
Copy link
Contributor

Choose a reason for hiding this comment

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

The makefile/package/taskController updates all seem to be "exposureScale", but "linearExposureScale" is included as well. Note that camera ended up with "GetLinearExposureScale" but not "ExposureScale", so possibly we need to nix all of the plain old "exposureScale" stuff.

I couldn't find the pow(2, exposureScale) anywhere in exposureScaleTask, but if we're going with linearExposureScale that doesn't matter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apologies - this was apparently in an incomplete state of transition to the new "everything is named linearExposure" changes.

So, anyway, completed the renames of all the *ExposureScale to *LinearExposureScale:

https://github.com/PixarAnimationStudios/OpenUSD/compare/cf0b28ae9427c505b1203f2703a43d2da0d5c71c..671584d67090cbf5c0ff0a6e45948d8e37cea3f3

@pmolodo pmolodo force-pushed the usdGeomCamera-exposure-storm branch 2 times, most recently from cf0b28a to 671584d Compare February 21, 2025 22:26
@pmolodo pmolodo force-pushed the usdGeomCamera-exposure-storm branch from 671584d to cb9b2a6 Compare February 21, 2025 22:27
@pmolodo
Copy link
Contributor Author

pmolodo commented Feb 21, 2025

@pmolodo
Copy link
Contributor Author

pmolodo commented Feb 21, 2025

Hi @tcauchois - sorry for fixing this up sooner! Comfirmed this is building and executing correctly, though...

@pmolodo
Copy link
Contributor Author

pmolodo commented Feb 21, 2025

Also - this repo contains some quick tests I slapped together to verify functionality:

https://github.com/pmolodo/usd_cam_exposure_test/tree/main

Would you want me to clean this up / proceduralize it, and turn them into proper unittests?

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.

3 participants