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:
authorCampbell Barton <ideasman42@gmail.com>2017-05-04 22:17:31 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-05-04 22:17:31 +0300
commit4bd2429f3519a58ccd1f93200dae42e52c45956e (patch)
tree90370ccbb2029ae2850fcc09bfbb43167a76e2cc /source/blender/gpu/shaders
parent9869436b89449a346fac07ca8061221ce8d4ce7e (diff)
Use mesh draw cache for back-buffer selection
Vertex/weight paint now work with core profile, resolves T51380.
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl
index 8c241cff5d4..f65fbe2a2e2 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl
@@ -3,12 +3,20 @@ uniform mat4 ModelViewProjectionMatrix;
#if __VERSION__ == 120
attribute vec3 pos;
+#if defined(USE_COLOR_U32)
+ attribute int color;
+#else
attribute vec4 color;
+#endif
flat varying vec4 finalColor;
#else
in vec3 pos;
+#if defined(USE_COLOR_U32)
+ in int color;
+#else
in vec4 color;
+#endif
flat out vec4 finalColor;
#endif
@@ -16,5 +24,14 @@ uniform mat4 ModelViewProjectionMatrix;
void main()
{
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
+
+#if defined(USE_COLOR_U32)
+ finalColor = vec4(
+ ((color ) & 0xFF) * (1.0f / 255.0f),
+ ((color >> 8) & 0xFF) * (1.0f / 255.0f),
+ ((color >> 16) & 0xFF) * (1.0f / 255.0f),
+ ((color >> 24) ) * (1.0f / 255.0f));
+#else
finalColor = color;
+#endif
}