diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-04-14 21:44:45 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-04-14 21:44:56 +0300 |
commit | 21c658b718b9bd0f79f435a6a8a8603c365264a5 (patch) | |
tree | bcaa239369d799368236d4303f33d674c3cb14f3 /source/blender/draw/intern/draw_manager.c | |
parent | bf49bb354fca4ad96f8f3e6802ecf733b29ac3e3 (diff) |
GPUShader: Implement workaround for gizmo drawing on sRGB framebuffer
This solution involves adding a uniform to each fragment shader that is
used by gizmo drawing and use the framebuffer state to set this uniform
accordingly.
This solution can also be carried to external shaders (addons).
A single line of code would then be enough to fix the issue.
The only trickery here is the dummy define:
`#define srgb_to_framebuffer_space(a)`
This is in order to avoid breaking other DRW shaders that use the same
fragment shader code but do not need the tranformation.
Related to T74139
Reviewed By: brecht, campbellbarton
Differential Revision: https://developer.blender.org/D7261
Diffstat (limited to 'source/blender/draw/intern/draw_manager.c')
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 1434cac5f97..09b9b63d07a 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1296,9 +1296,6 @@ void DRW_draw_callbacks_post_scene(void) DRW_state_reset(); GPU_framebuffer_bind(dfbl->overlay_fb); - /* Disable sRGB encoding from the fixed function pipeline since all the drawing in this - * function is done with sRGB color. Avoid double transform. */ - glDisable(GL_FRAMEBUFFER_SRGB); GPU_matrix_projection_set(rv3d->winmat); GPU_matrix_set(rv3d->viewmat); |