Skip to content

Support both log depth buffer defines across three.js versions - #15

Merged
Ameobea merged 1 commit into
Ameobea:mainfrom
wanfuxiong:feat/r180-logdepth
Aug 6, 2026
Merged

Ameobea merged 1 commit into
Ameobea:mainfrom
wanfuxiong:feat/r180-logdepth

Conversation

@wanfuxiong

Copy link
Copy Markdown
Contributor

Three.js renamed the USE_LOGDEPTHBUF shader define to USE_LOGARITHMIC_DEPTH_BUFFER in r180. Since this library's peer dependency range spans both sides of that change (>= 0.125.0 <= 0.182.0), the log-depth un-linearization in the shaders silently stopped working on r180+.

This PR makes the depth-unlinearization checks in godrays.frag and compositor.frag accept both macro names:
#if defined( USE_LOGDEPTHBUF ) || defined( USE_LOGARITHMIC_DEPTH_BUFFER )

@Ameobea

Ameobea commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Looks great - thanks for another very helpful contribution.

@Ameobea
Ameobea merged commit 339e85d into Ameobea:main Aug 6, 2026
1 check passed
@Ameobea

Ameobea commented Aug 6, 2026

Copy link
Copy Markdown
Owner

This fix is deployed in three-good-godrays@0.12.1

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