Skip to content

Fix faint lightshafts when Voxy/Distant Horizons is enabled#316

Open
aLink536 wants to merge 1 commit into
ComplementaryDevelopment:mainfrom
aLink536:fix/voxy-lightshaft-brightness
Open

Fix faint lightshafts when Voxy/Distant Horizons is enabled#316
aLink536 wants to merge 1 commit into
ComplementaryDevelopment:mainfrom
aLink536:fix/voxy-lightshaft-brightness

Conversation

@aLink536
Copy link
Copy Markdown

@aLink536 aLink536 commented Jun 7, 2026

What's the issue

When Voxy or Distant Horizons is enabled, lightshafts appear very faint — sometimes nearly invisible depending on how large the LOD render distance is set.

Root cause

In volumetricLight.glsl, the Voxy/DH branch sets maxDistance = renderDistance * 0.5 for all pixels. The weight accumulation normalises against maxDistance:

float sliceWeight = smoothstep1(pow(nextDistance / maxDistance, fogCurve))
                  - smoothstep1(pow(lastDistance / maxDistance, fogCurve));

With a large LOD render distance (e.g. 512 chunks → maxDistance = 4096), a ray that stops at vanilla geometry (~192 blocks) only accumulates ~4% of the expected weight. The effect scales badly — the larger the Voxy render distance the user has set, the fainter the shafts.

Fix

Decouple the weight-normalisation distance from the LOD extension distance:

  • Non-sky pixels keep maxDistance = far * 0.98 — weight normalisation is identical to non-Voxy behaviour, so lightshafts are full brightness regardless of LOD render distance setting.
  • Sky pixels (both vanilla and LOD depth are 1.0) use loddedMaxDistance = max(renderDistance * 0.5, far * 0.98) — the ray still extends into the LOD zone and weights correctly integrate to 1.0.

Files changed

  • shaders/lib/atmospherics/volumetricLight/volumetricLight.glsl

When VOXY or DISTANT_HORIZONS is defined, maxDistance was set to
renderDistance * 0.5 for all pixels. The weight accumulation normalizes
against maxDistance, so with a large LOD render distance (e.g. 512 chunks)
geometry at vanilla render distance only accumulated ~4% of the expected
weight, making lightshafts appear very faint.

Fix: keep maxDistance = far * 0.98 for non-sky pixels so weight
normalization is identical to vanilla behaviour. Only sky pixels that
need to trace into the LOD zone use loddedMaxDistance, where the extended
distance is appropriate and weights still integrate correctly to 1.0.
@aLink536 aLink536 force-pushed the fix/voxy-lightshaft-brightness branch from 2af46d3 to 3685b73 Compare June 7, 2026 17:15
@aLink536
Copy link
Copy Markdown
Author

aLink536 commented Jun 7, 2026

On Extreme

Before:
Screenshot_20260607_181906

After:
Screenshot_20260607_181837

@EminGT
Copy link
Copy Markdown
Member

EminGT commented Jun 7, 2026

Thank you for trying to help, but this is intentional. Extreme light shafts make lods invisible and most people don't like that.

@aLink536
Copy link
Copy Markdown
Author

aLink536 commented Jun 7, 2026

@EminGT May be worth tweaking this further, in some cases even on extreme the rays are not visible with Voxy enabled. I'd look at adding a more granular 'strength' setting so people can find the balance that works for them - benefits non voxy users as well.

Voxy enabled:
image

Voxy Disabled:
image

Voxy enabled with my fix - (ingame time changed is why light shafts have moved):
image

@EminGT
Copy link
Copy Markdown
Member

EminGT commented Jun 8, 2026

Hm, the Extreme setting wasn't supposed to change with Voxy. That's an issue

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