Design: DrawEngine Color Management #72420
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
10 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#72420
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
DrawManager
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.
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.
Next Steps
GPU Viewport
,Render & Cycles
andGrease Pencil
.Added subscriber: @Jeroen-Bakker
[WIP] Design: DrawEngine Colormanagementto [WIP] Design: DrawEngine Color Management[WIP] Design: DrawEngine Color Managementto Design: DrawEngine Color ManagementAdded subscriber: @item412
Added subscriber: @Pipeliner
Added subscriber: @EAW
Added subscriber: @frameshift
Great to see this being tackled! One small note:
I believe you mean the scene linear reference space.
Added subscribers: @fclem, @antoniov
@Jeroen-Bakker Actually @fclem is doing a big refactor of the grease pencil drawing engine and he is already thinking in color management.
Side note: I recently found that the sRGB texture format was allowed to be used in framebuffers (but was listed under texture only fomat in GPU module). This texture format if use used correctly should give us linear blending an decoding of srgb textures for free. (note: i do know we already use that for image textures).
Ok I've managed to do a proof of concept implementation of the sRGB framebuffer handling and it gives a lot of benefits... but changes some things that we may want to take into account.
Here is the paste with the diff: P1213
New (linear color space blending)*
Old (display space color space blending)
*Note: This is technically true only if the display space is sRGB. If not, opengl will still assume it is and do the sRGB - Linear conversions instead of Display Space - Linear.
We can see that the blending of bright color is more noticeable (i.e: the grid) and the darker ones are less prominent than before (i.e.:the lights' ground line. barely noticeable below selected orange lights).
This gives much more pleasant anti-aliasing which was my motivation for this.
The technical bits:
draw_common.c
but some are still hardcoded (i.e: bone drawing IIRC)GL_FRAMEBUFFER_SRGB
when we render to these framebuffers. This way opengl does the Linear to sRGB conversion AFTER blending when doing the writes.GL_FRAMEBUFFER_SRGB
insideDRW_transform_to_display
because the display transform is already done by the OCIO shader.I tried to always enable GL_FRAMEBUFFER_SRGB (which is supposed to only modify writes to sRGB textures/rendertargets) but now everything in blender's UI need to be in linear space since it is transformed back to sRGB by opengl's fixed pipeline.
You can such missing color correction on the view gizmos in the top right corner of the viewport.
So we can decide to only do the viewport management .
BTW this also mean doing proper color management for the Image editor since it also uses GPUViewport.
I think this is a nice step into a better color managed UI. We could use sRGB for area framebuffer everywhere to hold data in a compressed manner (in
GL_SRGB8_A8
format) and use OCIO to do the Linear > display space conversion at blitting time. This way we can make an exception for the viewport by using a floating point format to easily support HDR displays and wide gammuts.We could also use
GL_RGB10_A2
format for areas buffers but this means having less alpha precision.Added subscriber: @troy_s
After talking with @troy_s I've come to realize that the terminology is a bit messed up here.
When I was referring to sRGB textures and framebuffers, I was just referring to the transfer function that does not alter the primaries and just remap the input for better perceptual storage. The input color would still be linear.
Also when we say we will render overlays in display space, we mean Linear Display Space.
It is difficult to read white text over a light grey alpha background like Firefox default
so I remade it over a solid black background in case anyone else was having the same difficulty.
I've included the relevant colourimetric transforms required in the chain, given three two different layers of transparency in the viewport. Hope someone finds this informative.
Added subscriber: @BSannholm
Changed status from 'Confirmed' to: 'Resolved'
Added subscriber: @pauanyu_blender