Skip to content

Fixed esp fade distance being squared twice - #6631

Open
dekrom wants to merge 1 commit into
MeteorDevelopment:masterfrom
dekrom:fix/esp-fade-distance
Open

Fixed esp fade distance being squared twice#6631
dekrom wants to merge 1 commit into
MeteorDevelopment:masterfrom
dekrom:fix/esp-fade-distance

Conversation

@dekrom

@dekrom dekrom commented Aug 30, 2026

Copy link
Copy Markdown

Type of change

  • Bug fix
  • New feature

Description

ESP#getFadeAlpha squares the fade distance and then treats the result as if it were still a
plain distance:

double dist = PlayerUtils.squaredDistanceToCamera(...);
double fadeDist = Math.pow(fadeDistance.get(), 2);
if (dist <= fadeDist * fadeDist) alpha = (float) (Math.sqrt(dist) / fadeDist);

dist is squared, so the comparison is against the fade distance to the fourth power, and the
ramp divides a real distance by a squared one. With the default of 3 the fade starts at 9 blocks
instead of 3, and an entity sitting exactly at the fade distance comes out at alpha 0.33 instead
of 1. The setting description says the distance where the colour begins to fade, which is not
what you get.

Comparing squared against squared and dividing distance by distance is all it needs.

Related issues

None that I found.

How Has This Been Tested?

Not measured in game yet. The units do not line up in the source: dist is squared and it is
compared against fadeDist * fadeDist where fadeDist is already squared. Builds clean against
current master.

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants