Blender Git Loki
Git Commits -> Revision 21c658b
Revision 21c658b by Clément Foucault (master) April 14, 2020, 18:44 (GMT) |
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 |
Commit Details:
Full Hash: 21c658b718b9bd0f79f435a6a8a8603c365264a5
Parent Commit: bf49bb3
Lines Changed: +103, -11
1 Added Path:
/source/blender/gpu/shaders/gpu_shader_colorspace_lib.glsl (+16, -0) (View)
18 Modified Paths:
/source/blender/draw/intern/draw_manager.c (+0, -3) (Diff)
/source/blender/editors/interface/interface_widgets.c (+1, -0) (Diff)
/source/blender/editors/mesh/editmesh_knife.c (+1, -0) (Diff)
/source/blender/editors/space_image/space_image.c (+1, -1) (Diff)
/source/blender/editors/uvedit/uvedit_draw.c (+1, -0) (Diff)
/source/blender/gpu/CMakeLists.txt (+1, -0) (Diff)
/source/blender/gpu/GPU_shader.h (+10, -0) (Diff)
/source/blender/gpu/GPU_shader_interface.h (+1, -0) (Diff)
/source/blender/gpu/intern/gpu_batch.c (+1, -0) (Diff)
/source/blender/gpu/intern/gpu_framebuffer.c (+7, -0) (Diff)
/source/blender/gpu/intern/gpu_immediate.c (+1, -0) (Diff)
/source/blender/gpu/intern/gpu_shader.c (+51, -5) (Diff)
/source/blender/gpu/intern/gpu_shader_interface.c (+1, -0) (Diff)
/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl (+1, -0) (Diff)
/source/blender/gpu/shaders/gpu_shader_3D_smooth_color_frag.glsl (+1, -0) (Diff)
/source/blender/gpu/shaders/gpu_shader_flat_color_frag.glsl (+1, -0) (Diff)
/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl (+1, -0) (Diff)
/source/blender/python/gpu/gpu_py_shader.c (+6, -2) (Diff)
/source/blender/editors/interface/interface_widgets.c (+1, -0) (Diff)
/source/blender/editors/mesh/editmesh_knife.c (+1, -0) (Diff)
/source/blender/editors/space_image/space_image.c (+1, -1) (Diff)
/source/blender/editors/uvedit/uvedit_draw.c (+1, -0) (Diff)
/source/blender/gpu/CMakeLists.txt (+1, -0) (Diff)
/source/blender/gpu/GPU_shader.h (+10, -0) (Diff)
/source/blender/gpu/GPU_shader_interface.h (+1, -0) (Diff)
/source/blender/gpu/intern/gpu_batch.c (+1, -0) (Diff)
/source/blender/gpu/intern/gpu_framebuffer.c (+7, -0) (Diff)
/source/blender/gpu/intern/gpu_immediate.c (+1, -0) (Diff)
/source/blender/gpu/intern/gpu_shader.c (+51, -5) (Diff)
/source/blender/gpu/intern/gpu_shader_interface.c (+1, -0) (Diff)
/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl (+1, -0) (Diff)
/source/blender/gpu/shaders/gpu_shader_3D_smooth_color_frag.glsl (+1, -0) (Diff)
/source/blender/gpu/shaders/gpu_shader_flat_color_frag.glsl (+1, -0) (Diff)
/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl (+1, -0) (Diff)
/source/blender/python/gpu/gpu_py_shader.c (+6, -2) (Diff)