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

Convert from sRGB to linear in color picker #2035

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sgmq0
Copy link

@sgmq0 sgmq0 commented Sep 28, 2024

This addresses issue #1209

Let me know if I'm missing anything, I'm not very sure about the naming conventions.

@jstone-lucasfilm
Copy link
Member

jstone-lucasfilm commented Sep 28, 2024

This looks like a great start, thanks @sgmq0!

Here are two initial thoughts and recommendations for next steps:

  • We should probably add the reverse transform from linear shader colors to the sRGB-encoded space of the color picker, so that the colors that artists see displayed in the viewer interface are in their correct space.
  • It's fine to start with just the MaterialX Viewer for this initial pull request, though ultimately we want to extend this change to the MaterialX Graph Editor as well!

@kwokcb
Copy link
Contributor

kwokcb commented Sep 30, 2024

Checking with nanogui (Viewer) and imgui (Editor) both appear to assume sRGB for display colors so looks like the reverse transform is required.

@jstone-lucasfilm
Copy link
Member

I wanted to follow up on this proposal, @sgmq0, to see if you might have the bandwidth to address the requests above. Let us know either way!

@sgmq0
Copy link
Author

sgmq0 commented Oct 23, 2024

School got busy and I ended up not having the bandwidth to finish in a timely manner, but thank you for the reminder! I can try to address both requests within a week or so.

@sgmq0
Copy link
Author

sgmq0 commented Oct 29, 2024

Hi @jstone-lucasfilm !
Just to clarify, is the goal to transform the color picker to sRGB to match the color space of the viewer?

@jstone-lucasfilm
Copy link
Member

That's exactly right, @sgmq0, and you should be able to use the built-in linearToSrgb function to implement this transform.

This should effectively transform colors from the linear space of the renderer (lin_rec709) to the srgb-encoded space of the color picker (srgb_texture).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants