diff options
Diffstat (limited to 'source/blender/draw/engines/overlay/shaders/overlay_armature_envelope_outline_vert.glsl')
-rw-r--r-- | source/blender/draw/engines/overlay/shaders/overlay_armature_envelope_outline_vert.glsl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/overlay_armature_envelope_outline_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_armature_envelope_outline_vert.glsl index 0a8e279e9b0..ca5a6aff2ca 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_armature_envelope_outline_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_armature_envelope_outline_vert.glsl @@ -17,8 +17,8 @@ vec2 compute_dir(vec2 v0, vec2 v1, vec2 v2) mat3 compute_mat(vec4 sphere, vec3 bone_vec, out float z_ofs) { - bool is_persp = (ProjectionMatrix[3][3] == 0.0); - vec3 cam_ray = (is_persp) ? sphere.xyz - ViewMatrixInverse[3].xyz : -ViewMatrixInverse[2].xyz; + bool is_persp = (drw_view.winmat[3][3] == 0.0); + vec3 cam_ray = (is_persp) ? sphere.xyz - drw_view.viewinv[3].xyz : -drw_view.viewinv[2].xyz; /* Sphere center distance from the camera (persp) in world space. */ float cam_dist = length(cam_ray); @@ -88,13 +88,13 @@ vec3 get_outline_point(vec2 pos, void main() { - float dst_head = distance(headSphere.xyz, ViewMatrixInverse[3].xyz); - float dst_tail = distance(tailSphere.xyz, ViewMatrixInverse[3].xyz); - // float dst_head = -dot(headSphere.xyz, ViewMatrix[2].xyz); - // float dst_tail = -dot(tailSphere.xyz, ViewMatrix[2].xyz); + float dst_head = distance(headSphere.xyz, drw_view.viewinv[3].xyz); + float dst_tail = distance(tailSphere.xyz, drw_view.viewinv[3].xyz); + // float dst_head = -dot(headSphere.xyz, drw_view.viewmat[2].xyz); + // float dst_tail = -dot(tailSphere.xyz, drw_view.viewmat[2].xyz); vec4 sph_near, sph_far; - if ((dst_head > dst_tail) && (ProjectionMatrix[3][3] == 0.0)) { + if ((dst_head > dst_tail) && (drw_view.winmat[3][3] == 0.0)) { sph_near = tailSphere; sph_far = headSphere; } @@ -130,7 +130,7 @@ void main() gl_Position = p1; /* compute position from 3 vertex because the change in direction - * can happen very quicky and lead to very thin edges. */ + * can happen very quickly and lead to very thin edges. */ vec2 ss0 = proj(p0); vec2 ss1 = proj(p1); vec2 ss2 = proj(p2); |