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

Loaders: Unpack colors to working color space #29448

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

donmccurdy
Copy link
Collaborator

Several loaders were converting model input colors to explicitly Linear-sRGB, with methods like convertSRGBToLinear. For future compatibility with wide gamut and HDR workflows, it would be better to target the working color space (Linear-sRGB by default, but may be changed by the user) instead. With this PR, I change the remaining affected loaders to these patterns:

// tells Color.js that the source color was sRGB, causing
// implicit conversion to working color space
color.setRGB( r, g, b, SRGBColorSpace );

// explicitly converts from the given source color space to
// the working color space
ColorManagement.toWorkingColorSpace( color, SRGBColorSpace );

examples/jsm/loaders/MTLLoader.js Fixed Show fixed Hide fixed
examples/jsm/loaders/MTLLoader.js Fixed Show fixed Hide fixed
examples/jsm/loaders/MTLLoader.js Fixed Show fixed Hide fixed
@donmccurdy donmccurdy marked this pull request as ready for review September 20, 2024 02:31
@mrdoob mrdoob added this to the r169 milestone Sep 20, 2024
@mrdoob mrdoob merged commit a789b44 into mrdoob:dev Sep 20, 2024
11 checks passed
@donmccurdy donmccurdy deleted the feat/loaders-use-working-color-space branch September 20, 2024 03:50
LD2Studio pushed a commit to LD2Studio/LD2Studio-Editor that referenced this pull request Sep 20, 2024
* feat(loaders): Loaders unpack colors to working color space

* fix semicolons
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.

2 participants