@@ -12,7 +12,7 @@ public class Perspective{
12
12
public static float viewportOffset = 8f ;
13
13
/** Field of View in degrees */
14
14
public static float fov = settings .getInt ("pm-fov" , 60 );
15
- public static float fadeDst = 128f ;
15
+ public static float fadeDst = 1024f ;
16
16
public static float maxScale = 8f ;
17
17
18
18
/** @return If the z coordinate is below the viewport height. */
@@ -65,18 +65,15 @@ public static float alpha(float x, float y, float z){
65
65
float cx = camera .position .x , cy = camera .position .y ;
66
66
float cz = cameraZ ();
67
67
68
- float d1 = Math3D .dst (x , y , z , cx , cy , cz ); //Distance between camera and far point
69
-
70
68
x -= cx ;
71
69
y -= cy ;
72
- float pz = cz - z ;
73
-
74
- float vx = x / pz * viewportOffset ,
75
- vy = y / pz * viewportOffset ;
70
+ float zz = cz - z ;
76
71
77
- float d2 = Math3D .dst (vx , vy , z ); //Distance between camera and viewport pos
72
+ float vx = x / zz * viewportOffset , //Position scaled to near plane.
73
+ vy = y / zz * viewportOffset ;
74
+ float vz = viewportZ ();
78
75
79
- float dst = d1 - d2 ;
76
+ float dst = Math3D . dst ( x , y , z , vx , vy , vz ); //Distance between viewport and pos
80
77
float fade = Math .min (fadeDst , cz - viewportOffset );
81
78
82
79
if (dst > fade ){
0 commit comments