Skip to content

Commit 14d5130

Browse files
committed
Correct alpha
1 parent 99c5889 commit 14d5130

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/progressed/entities/bullet/pseudo3d/SkyBeamBulletType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SkyBeamBulletType extends BulletType{
1515
public float radius = tilesize;
1616
public boolean bloom = true;
1717
public Color baseColor = PMPal.nexusLaserDark;
18-
public Color topColor = PMPal.nexusLaser.cpy().a(0);
18+
public Color topColor = PMPal.nexusLaser;
1919

2020
static{
2121
BlackHoleUtils.immuneBulletTypes.add(SkyBeamBulletType.class);

src/progressed/graphics/draw3d/Perspective.java

+6-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class Perspective{
1212
public static float viewportOffset = 8f;
1313
/** Field of View in degrees */
1414
public static float fov = settings.getInt("pm-fov", 60);
15-
public static float fadeDst = 128f;
15+
public static float fadeDst = 1024f;
1616
public static float maxScale = 8f;
1717

1818
/** @return If the z coordinate is below the viewport height. */
@@ -65,18 +65,15 @@ public static float alpha(float x, float y, float z){
6565
float cx = camera.position.x, cy = camera.position.y;
6666
float cz = cameraZ();
6767

68-
float d1 = Math3D.dst(x, y, z, cx, cy, cz); //Distance between camera and far point
69-
7068
x -= cx;
7169
y -= cy;
72-
float pz = cz - z;
73-
74-
float vx = x / pz * viewportOffset,
75-
vy = y / pz * viewportOffset;
70+
float zz = cz - z;
7671

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();
7875

79-
float dst = d1 - d2;
76+
float dst = Math3D.dst(x, y, z, vx, vy, vz); //Distance between viewport and pos
8077
float fade = Math.min(fadeDst, cz - viewportOffset);
8178

8279
if(dst > fade){

0 commit comments

Comments
 (0)