After the overlay engine refactoring landed we are one step closer to do better color management in the 3d viewport. This design task describes the steps that needs to happen and the reasoning behind it.
- Colors in the viewport and after rendering are different when using overlay engine. The reason is that color transfer is done as one of the last steps of the first render engine (EEVEE, Workbench). The overlay engine ignores the color space it is compositing into.
- Colors in the viewport and after rendering are different when using grease pencil. The reason is that color transfer is done as one of the last steps of the first render engine (EEVEE, Workbench). The render engine can set the output buffer already to sRGB or linear REC709. Grease Pencil (the second render engine) converts its input color to match this behavior, but does the blending in the color space of the buffer.
One benefit of the overlay unification project is that the overlays are rendered in a separate GPU texture.. This was a first step of implementing a better drawing color management pipeline.
This proposal consist of several some rules.
- The Draw manager will be responsible for the view transform, pending on the active draw mode and draw engines.
- The Draw Manager will be responsible to perform the display transform as a last step in the drawing pipeline.
- The compositing between engines must be performed in scene reference space.
- Image empties and camera background images are currently composited directly in the engine output. That is a hack and has to be removed.
Conceptually the pipeline would look like:
Note: that the Z Combine could also be any compositing trick. It is controlled by the draw engine. The Z Combine shows when it is being used in the pipeline, not what is being done.
Note: Due to upcoming implementation the view transform will happen after the grease pencil engine
WARNING! as this seems conceptually a good idea, OCIO is limiting this. The best we can do is to apply color management after the grease pencil. But the line renderings will always be drawn in display space. The other option is that the line renderings will also be color managed with the settings that the scene and draw mode requests.
- Get input from GPU Viewport, Render & Cycles and Grease Pencil.