Fix T64296 Z-axis overlay vanishes at scene origin in 3D Viewport

Grid shader was still using deprecated eye vector.
This commit is contained in:
Clément Foucault 2019-05-09 10:59:25 +02:00
parent dea8fb2bea
commit a951aa5f62
Notes: blender-bot 2023-02-14 07:18:54 +01:00
Referenced by issue #64296, Z-axis overlay vanishes at scene origin in 3D Viewport (cosmetic)
1 changed files with 2 additions and 2 deletions

View File

@ -9,9 +9,9 @@ in vec3 local_pos;
out vec4 FragColor;
uniform mat4 ProjectionMatrix;
uniform mat4 ViewMatrixInverse;
uniform vec3 cameraPos;
uniform vec3 planeAxes;
uniform vec3 eye;
uniform vec4 gridSettings;
uniform float meshSize;
uniform float lineKernel = 0.0;
@ -109,7 +109,7 @@ void main()
dist = 1.0; /* avoid branch after */
if ((gridFlag & PLANE_XY) != 0) {
float angle = 1.0 - abs(eye.z);
float angle = 1.0 - abs(ViewMatrixInverse[2].z);
dist = 1.0 + angle * 2.0;
angle *= angle;
fade *= 1.0 - angle * angle;