Forward alpha channel in color4 RgbToHsv and HsvToRgb#2838
Closed
mvanhorn wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
Closed
Forward alpha channel in color4 RgbToHsv and HsvToRgb#2838mvanhorn wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
mvanhorn wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
Conversation
The color4 variants of RgbToHsv and HsvToRgb hardcoded the alpha component to 1.0 instead of forwarding the input alpha. Per the MaterialX spec, the alpha channel should pass through unchanged. Fixed in both GLSL and OSL implementations. Fixes AcademySoftwareFoundation#2765
|
Author
|
Closing - the EasyCLA check requires CLA authorization that I haven't completed. The fix itself is correct (all build checks pass). Happy to resubmit after signing the CLA, or feel free to pick up the 4-line change. |
Member
|
This looks really promising, thanks @mvanhorn. If you'd like to proceed with this proposal, you can just reopen the PR and follow the instructions in #2838 (comment) to resolve the EasyCLA warning. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The color4 variants of
mx_rgbtohsvandmx_hsvtorgbhardcode theoutput alpha to
1.0instead of forwarding_in.a. Per the MaterialXspec, the alpha channel should pass through unchanged during color space
conversion.
Fixed in both GLSL (
genglsl/) and OSL (genosl/) implementations.The color3 variants are unaffected (no alpha channel).
Files changed:
libraries/stdlib/genglsl/mx_rgbtohsv_color4.glsl:1.0->_in.alibraries/stdlib/genglsl/mx_hsvtorgb_color4.glsl:1.0->_in.alibraries/stdlib/genosl/mx_rgbtohsv_color4.osl:1.0->_in.alibraries/stdlib/genosl/mx_hsvtorgb_color4.osl:1.0->_in.aAs noted in the issue, this also fixes the inherited bug in HsvAdjust
(which is a node graph using RgbToHsv and HsvToRgb).
Fixes #2765
This contribution was developed with AI assistance (Claude Code).