diff options
Diffstat (limited to 'source/blender/draw/modes/shaders/edit_mesh_overlay_facefill_vert.glsl')
-rw-r--r-- | source/blender/draw/modes/shaders/edit_mesh_overlay_facefill_vert.glsl | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/draw/modes/shaders/edit_mesh_overlay_facefill_vert.glsl b/source/blender/draw/modes/shaders/edit_mesh_overlay_facefill_vert.glsl new file mode 100644 index 00000000000..bc46b3fe0f4 --- /dev/null +++ b/source/blender/draw/modes/shaders/edit_mesh_overlay_facefill_vert.glsl @@ -0,0 +1,37 @@ + +uniform mat4 ModelViewProjectionMatrix; +uniform mat4 ModelMatrix; +uniform ivec4 dataMask = ivec4(0xFF); + +in vec3 pos; +in ivec4 data; + +flat out vec4 faceColor; + +#define FACE_ACTIVE (1 << 3) +#define FACE_SELECTED (1 << 4) +#define FACE_FREESTYLE (1 << 5) + +void main() +{ + gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); + + ivec4 data_m = data & dataMask; + + if ((data_m.x & FACE_ACTIVE) != 0) { + faceColor = colorFaceSelect; + } + else if ((data_m.x & FACE_SELECTED) != 0) { + faceColor = colorFaceSelect; + } + else if ((data_m.x & FACE_FREESTYLE) != 0) { + faceColor = colorFaceFreestyle; + } + else { + faceColor = colorFace; + } + +#ifdef USE_WORLD_CLIP_PLANES + world_clip_planes_calc_clip_distance((ModelMatrix * vec4(pos, 1.0)).xyz); +#endif +} |