diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-03-24 19:50:17 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-03-24 19:54:30 +0300 |
commit | f3ea8cd60876e499b664e12eec24d163136c04ba (patch) | |
tree | c3f3c547c06b5f5a7fe565e118a2f2bef5059b3f /source/blender/draw/engines/overlay/shaders | |
parent | 5801a016d4cf2384274b0f813e29d61662dc8ee2 (diff) |
Overlay: Wireframe: Make facing ratio offset depends on gl_Position.w
This makes the offset dependent of the actual near and far clip distances.
Diffstat (limited to 'source/blender/draw/engines/overlay/shaders')
-rw-r--r-- | source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl b/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl index 1abac302cda..001c128e4ac 100644 --- a/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl @@ -122,7 +122,7 @@ void main() gl_Position.xy += wofs.xy * sizeViewportInv.xy * gl_Position.w; /* Push the vertex towards the camera. Helps a bit. */ - gl_Position.z -= facing_ratio * curvature * 4.0e-5; + gl_Position.z -= facing_ratio * curvature * 1.0e-5 * gl_Position.w; /* Convert to screen position [0..sizeVp]. */ edgeStart = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * sizeViewport.xy; |