diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-05-04 22:17:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-05-04 22:17:31 +0300 |
commit | 4bd2429f3519a58ccd1f93200dae42e52c45956e (patch) | |
tree | 90370ccbb2029ae2850fcc09bfbb43167a76e2cc /source/blender/gpu/shaders | |
parent | 9869436b89449a346fac07ca8061221ce8d4ce7e (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.glsl | 17 |
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 } |