Set NSWindow color space to sRGB on macOS#10827
Conversation
|
Hi, thank you for your pull request. |
I’m not sure I understand. This is something that the application is responsible for configuring and can’t be overridden at the OS level. It should be set to the color space the application is rendering in, which in this case is sRGB, so that the OS can apply the display’s color profile and show the correct colors on the screen. |
I must admit, I don't have enough knowledge on this topic. The application was using native RGB. as you can see, our rendering target uses the BGRA(which is bassically RGBA channel, 8 bit per channel) color format. I assumed the operating system's color profile would automatically map to the corresponding color space. From what I understand, the RGB differs from the sRGB color profile—the ranges are different. I did a quick Google search and found some discussions in the GLFW repo, but it seems those are quite recent, haven't been merged yet, and there isn't much discussion. After evaluating this, I'm open to trying this change. Since I only use a Mac native monitor, I can't really tell the difference. |
|
Hi @as-com |
This reverts commit 32ca697.
|
@SoftFever MacBook Pros since 2016 have shipped with wide color gamut (Display P3) displays, so the version with color management disabled will look much more saturated. The "duller" version (i.e. the one with color management enabled) is actually the more accurate rendition and will appear consistent across different displays. You can see the effect (and possibly reproduce the flickering colors) by connecting an (older? cheaper?) external monitor without wide color and dragging the OrcaSlicer window between it and the internal display. I triggered the flickering bug by dragging OrcaSlicer between the internal display (Display P3) and a Dell U2415 (sRGB). Incorrect color management also has effects other than searing your retinas - on displays with very deep color primaries like the red primary on LG Nano IPS and some recent OLED displays, red (#ff0000 in the display's native color space) text can have poor contrast with dark grey backgrounds unless it's properly converted from the actual intended color (such as #ff0000 in sRGB) to the display's color space. |
|
Hi, Andrew |
# Description Fixes #6813 Fixes #7782 Fixes #6367 This is a port of libvgcode, OpenGL Core Profile (libvgcode requires OpenGL 3.2+), and probably other stuff I forgot from PrusaSlicer. libvgcode is also known as "Improved G-code Viewer" which was introduced in [PrusaSlicer 2.8.0](https://github.com/prusa3d/PrusaSlicer/releases/tag/version_2.8.0-alpha5). It significantly improves performance of the G-code preview and allows displaying the actual speed and volumetric flow rate. ## TODO - [x] Make the sliders work properly again - [x] Make view type selection work - [x] Fix toggling of feature type visibility - [x] Expose actual speed/actual flow view types - [x] Fix display of G2/G3 arcs - [x] Wire up actual speed graph widgets - [x] Fix painter gizmos - [x] Fix crash when selecting filament view type on Windows - [ ] Figure out display color management (#10827) - [x] Fix incorrect rendering of small area flow compensation (or any extrusions with varying flow) - [ ] Localization - [ ] Testing - [ ] Code cleanup, performance optimization ## Removed functionality Some functionality is not supported by libvgcode: - Toggling visibility of tools - Toggling visibility of colors in color print view - Support for systems with OpenGL <3.2 - Bambu's implementation of G2/G3 arcs was replaced with PrusaSlicer's implementation # Screenshots/Recordings/Graphs https://github.com/user-attachments/assets/c1413a82-3058-4541-b96c-3d5f7cdef174 <details> <summary>Outdated Stuff</summary> https://github.com/user-attachments/assets/ca172ef4-0828-4d21-8768-b08a4132c9ab <img width="1611" height="1145" alt="image" src="https://github.com/user-attachments/assets/5e0d04ff-8046-4636-a08a-cdedc60303bc" /> </details> ## Tests - [x] Normally sliced G-code - [ ] G-code viewer mode - [x] Arc fitting enabled - [x] Spiral Z-hops - [x] Multi-extruder/multi-color - [x] Vase mode - [x] Skirt/brim - [x] Supports - [ ] Support transition (whatever this is) - [x] Painter gizmos - [x] Measurement gizmo - [x] Move/rotate/scale gizmos - [x] H2D/H2S support (oh no) - [ ] Windows - [x] macOS - [ ] Linux
re: #10827 (comment) Let's give this another try :)
re: #10827 (comment) Let's give this another try :)
…er#12546) re: OrcaSlicer#10827 (comment) Let's give this another try :)
…er#12546) re: OrcaSlicer#10827 (comment) Let's give this another try :)

Description
This PR addresses an issue where colors in the 3D view are over-saturated on displays with a wide color gamut and also fixes flickering colors after the window is dragged between displays with different color profiles.
Note: this change does not affect Windows or Linux.
Screenshots/Recordings/Graphs
Left is with this change, right is original
If you do not have a display that supports a wide color gamut or your system's color management is not properly configured, you may find it difficult to see the difference in this screenshot. (Try viewing it on a recent smartphone)
Tests
Tested on macOS