Skip to content

Adsk Contrib - Add built-in displays that mirror rather than clamp negative values#2183

Merged
doug-walker merged 3 commits into
AcademySoftwareFoundation:mainfrom
autodesk-forks:walker/mirror_displays
Sep 12, 2025
Merged

Adsk Contrib - Add built-in displays that mirror rather than clamp negative values#2183
doug-walker merged 3 commits into
AcademySoftwareFoundation:mainfrom
autodesk-forks:walker/mirror_displays

Conversation

@doug-walker
Copy link
Copy Markdown
Collaborator

Per discussion in the TSC, this PR adds built-in transforms that may be used to create display color spaces. The names of the new built-ins are the names of the clamping versions with " - MIRROR NEGS" appended. The following are the new built-in transform names:
"DISPLAY - CIE-XYZ-D65_to_REC.1886-REC.709 - MIRROR NEGS",
"DISPLAY - CIE-XYZ-D65_to_REC.1886-REC.2020 - MIRROR NEGS",
"DISPLAY - CIE-XYZ-D65_to_G2.2-REC.709 - MIRROR NEGS",
"DISPLAY - CIE-XYZ-D65_to_sRGB - MIRROR NEGS",
"DISPLAY - CIE-XYZ-D65_to_G2.6-P3-D65 - MIRROR NEGS"

Additional unit tests were added to validate the clamping and mirroring behavior.

Note that the DisplayP3, HLG, and PQ built-ins are already mirroring, so no changes were needed there. A few of the other built-ins I did not add a mirrored version for since they are not used in our built-in configs.

Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Copy link
Copy Markdown
Collaborator

@remia remia left a comment

Choose a reason for hiding this comment

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

It seems that some update to Gihub runners or ASWF docker image broke our CI but otherwise looks good.

{ 1.0e-6f,
{ 0.5f, 0.4f, 0.3f }, { 0.933793573229f, 0.564092030327f, 0.550040502218f } } },
{ 0.5f, 0.4f, 0.3f, -0.05f, 0.05f, 1.25f },
{ 0.933793573229f, 0.564092030327f, 0.550040502218f, -11.142147651136028f, 0.477958897494f, 1.124971166876f } } },
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Probably ~-11 corresponding to -0.05 is an expected outcome but since it's an outlier, I wanted to mention. Ignore this comment if that's expected.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It is expected. The unmirrored sRGB transfer function is just linearly extrapolating the linear segment, which has a high slope.
The conversion of XYZ [-.05, .05, 1.25] to RGB is [-0.86218110634 , 0.194204378648, 1.308234040874], and then the -0.86 is multiplied by the slope of the linear segment, which is 12.92.

Copy link
Copy Markdown
Collaborator

@cozdas cozdas left a comment

Choose a reason for hiding this comment

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

Looks good.

@doug-walker doug-walker merged commit b3252c7 into AcademySoftwareFoundation:main Sep 12, 2025
26 checks passed
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