Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-09-11 18:05:07 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-09-11 18:05:16 +0300
commit57f9e31bf4fb23b8a74f55c6778022eb5dd3b259 (patch)
tree6c4506398c0d45907f3108c3c3058896c3c4c2d1 /source/blender/draw/intern/draw_common.h
parent3fbdcefa174dd85972b7b63c0955e3a8d42f6943 (diff)
DRW: Convert common theme color to linear for viewport render
This is not 100% correct (it should use a transfer function depending on the display profile) but this is already much better than using srgb.
Diffstat (limited to 'source/blender/draw/intern/draw_common.h')
-rw-r--r--source/blender/draw/intern/draw_common.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_common.h b/source/blender/draw/intern/draw_common.h
index c402f63f6a2..da136c8f377 100644
--- a/source/blender/draw/intern/draw_common.h
+++ b/source/blender/draw/intern/draw_common.h
@@ -36,8 +36,12 @@ struct ModifierData;
struct ParticleSystem;
struct PTCacheEdit;
+#define UBO_FIRST_COLOR colorWire
+#define UBO_LAST_COLOR colorGridAxisZ
+
/* Used as ubo but colors can be directly referenced as well */
/* Keep in sync with: common_globals_lib.glsl (globalsBlock) */
+/* NOTE! Also keep all color as vec4 and between UBO_FIRST_COLOR and UBO_LAST_COLOR */
typedef struct GlobalsUboStorage {
/* UBOs data needs to be 16 byte aligned (size of vec4) */
float colorWire[4];
@@ -99,6 +103,8 @@ typedef struct GlobalsUboStorage {
float colorGridAxisY[4];
float colorGridAxisZ[4];
+ /* NOTE! Put all color before UBO_LAST_COLOR */
+
/* Pack individual float at the end of the buffer to avoid alignement errors */
float sizeLampCenter, sizeLampCircle, sizeLampCircleShadow;
float sizeVertex, sizeEdge, sizeEdgeFix, sizeFaceDot;