diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-06-10 20:35:25 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-06-10 21:06:26 +0300 |
commit | 542462d35c5c17742aa4d3d17c13bbbf312fe7a3 (patch) | |
tree | 0cfe5284da09612beaacc42765cb192586de1650 /source/blender/draw/modes/shaders/object_outline_prepass_vert.glsl | |
parent | e321fc4a7c8f93d5ffee50d107430df04b612e23 (diff) |
Workbench: Xray: Add selected/active non-occluded outlines
This Fix the problem when multiple objects are selected and one of them
occlude the others. You cannot see clearly what is selected.
With this option, selection is more clear when Xray mode is enabled.
Diffstat (limited to 'source/blender/draw/modes/shaders/object_outline_prepass_vert.glsl')
-rw-r--r-- | source/blender/draw/modes/shaders/object_outline_prepass_vert.glsl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/draw/modes/shaders/object_outline_prepass_vert.glsl b/source/blender/draw/modes/shaders/object_outline_prepass_vert.glsl new file mode 100644 index 00000000000..ba824a7c007 --- /dev/null +++ b/source/blender/draw/modes/shaders/object_outline_prepass_vert.glsl @@ -0,0 +1,16 @@ + +uniform mat4 ModelViewMatrix; +uniform mat4 ModelViewProjectionMatrix; + +in vec3 pos; + +out vec4 pPos; +out vec3 vPos; + +void main() +{ + vPos = (ModelViewMatrix * vec4(pos, 1.0)).xyz; + pPos = ModelViewProjectionMatrix * vec4(pos, 1.0); + /* Small bias to always be on top of the geom. */ + pPos.z -= 1e-3; +} |