Skip to content

fix: rename log-depth shader define and bump three to 0.183.2#290

Open
JodokGBS wants to merge 3 commits intosparkjsdev:mainfrom
GEOBILITY-SYSTEMS:fix/logarithmic-depth-buffer-three-0.183.2
Open

fix: rename log-depth shader define and bump three to 0.183.2#290
JodokGBS wants to merge 3 commits intosparkjsdev:mainfrom
GEOBILITY-SYSTEMS:fix/logarithmic-depth-buffer-three-0.183.2

Conversation

@JodokGBS
Copy link
Copy Markdown

Summary

  • Rename deprecated Three.js shader define USE_LOGDEPTHBUF to USE_LOGARITHMIC_DEPTH_BUFFER in src/shaders/splatVertex.glsl.
  • Update three from ^0.178.0 to ^0.183.2 in package.json (devDependencies and peerDependencies).
  • Refresh package-lock.json for the dependency bump.

Why

USE_LOGDEPTHBUF was renamed upstream in Three.js. This keeps Spark compatible with newer Three.js versions.

@dmarcos
Copy link
Copy Markdown
Contributor

dmarcos commented Apr 2, 2026

Thanks. Is this applicable to https://github.com/sparkjsdev/spark/tree/v2.0.0-preview branch?

@JodokGBS
Copy link
Copy Markdown
Author

JodokGBS commented Apr 2, 2026

Thanks. Is this applicable to https://github.com/sparkjsdev/spark/tree/v2.0.0-preview branch?

No as far as i can see, this PR is not needed for v2 as it has no #ifdef USE_LOGDEPTHBUF.
It seems in v2 Spark lets Three handle log-depth internally through its shader chunks, so there’s nothing to rename in the Spark code.

@asundqui
Copy link
Copy Markdown
Contributor

Hi @JodokGBS , thanks for your PR!

Indeed in v2.0.0-preview branch this is unnecessary because it doesn't use #ifdef USE_LOGDEPTHBUF, so there is no incompatibility there. We will be merging v2.0.0-preview into main soon so I'd prefer to only merge changes into that branch.

v2.0.0-preview has a minimum Three.js version 0.180.0. I see your PR upgrades it to a newer version, but I think we'd prefer to leave it.

There are other unrelated changes in the PR in the commit handle nullable texture data for three 0.183 typings - I'm not sure I follow why this is needed?

@JodokGBS
Copy link
Copy Markdown
Author

Hi @asundqui

Thanks for taking the time to look into this PR.

The nullable texture changes were only a TypeScript compatibility fix after bumping @types/three to 0.183.1 (0b4f422): strict TS started failing because DataArrayTexture.image.data is typed as TypedArray | null (so .image.data.buffer needs a null check). There should be no runtime behavior change.

Given that v2.0.0-preview is being merged into main soon and already doesn’t use #ifdef USE_LOGDEPTHBUF, I agree this PR is not needed and can be closed.

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.

3 participants