DRW: Increase weight paint wire depth bias

By default wire would z-fight against the surface.
Increase the bias, also don't adjust the 'w' component
since it causes bias that depends on the view direction.
This commit is contained in:
Campbell Barton 2019-02-14 13:50:15 +11:00
parent c12b29e884
commit 7280d9d1e4
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ void main()
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
/* Add offset in Z to avoid zfighting and render selected wires on top. */
/* TODO scale this bias using znear and zfar range. */
gl_Position.zw -= exp2(-20.0) * (is_select ? 2.0 : 1.0);
gl_Position.z -= (is_select ? 2e-4 : 1e-4);
if (is_hidden) {
gl_Position = vec4(-2.0, -2.0, -2.0, 1.0);