Commit 830a9a0
authored
Handle UI display color space in MaterialX Viewer (#2394)
This PR fixes discrepancies between the rendered preview material in MaterialXView and the NanoGUI color picker. In both the `Color3` and `Color4` cases, it completes the following conversions:
1. Uses `Color3::linearToSrgb()` to convert the stored value in "lin_rec709" color space to sRGB space for use in the color picker.
2. After user selects a color in the GUI and presses the "Pick" button, converts the selected RGB values to linear space using the `Color3::srgbToLinear()` conversion function. The converted linear color value is what is ultimately written to the material.
In the `Color4` case, the alpha channel is left untouched, both during reading and writing.1 parent ec0955e commit 830a9a0
1 file changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| 330 | + | |
330 | 331 | | |
331 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
332 | 335 | | |
333 | 336 | | |
334 | 337 | | |
| |||
339 | 342 | | |
340 | 343 | | |
341 | 344 | | |
342 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
343 | 349 | | |
344 | 350 | | |
345 | 351 | | |
| |||
354 | 360 | | |
355 | 361 | | |
356 | 362 | | |
357 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
358 | 367 | | |
359 | 368 | | |
360 | 369 | | |
| |||
363 | 372 | | |
364 | 373 | | |
365 | 374 | | |
366 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
367 | 379 | | |
368 | 380 | | |
369 | 381 | | |
| |||
0 commit comments