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.
**Current Limitation**
* 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.
**DrawManager**
One benefit of the overlay unification project is that the overlays are rendered in a separate GPU texture. {F8216336} {F8216337} {F8216339}. This was a first step of implementing a better drawing color management pipeline.
This proposal consist of several some rules.
1. Render Engine is only responsible for the View Transform. Note that this also includes external render engines like cycles.
2. The Draw Manager will be responsible to perform the display transform as a last step in the drawing pipeline.
3. The compositing between engines must be performed in linear REC709.
- Image empties and camera background images are currently composited directly in the engine output. That is a hack and can be removed
Conceptually the pipeline would look like:
{F8216489}
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.
**Next Steps**
1. Get input from `GPU Viewport`, `Render & Cycles` and `Grease Pencil`.