Skip to content

Commit d9b3085

Browse files
authored
Merge pull request #732 from pmndrs/dev
Version 6.38.0
2 parents 902ed8e + f47f304 commit d9b3085

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1330
-912
lines changed

.github/workflows/cd.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@ on:
44
workflow_dispatch:
55
push:
66
tags:
7-
- "*"
7+
- "v*"
8+
9+
permissions:
10+
id-token: write
11+
contents: read
812

913
jobs:
1014
deploy:
1115
name: Deploy
1216
runs-on: ubuntu-latest
1317
steps:
14-
- name: Git checkout
15-
uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
1619
- name: Install PNPM
1720
uses: pnpm/action-setup@v4
1821
with:
1922
version: 10
2023
- name: Install Node
2124
uses: actions/setup-node@v4
2225
with:
23-
node-version: 22
26+
node-version: 24
27+
registry-url: "https://registry.npmjs.org"
2428
cache: "pnpm"
2529
- name: Install dependencies and test
2630
run: pnpm install-test --frozen-lockfile
2731
- name: Publish
28-
id: publish
29-
uses: JS-DevTools/npm-publish@v3
30-
with:
31-
token: ${{ secrets.NPM_TOKEN }}
32-
- if: ${{ steps.publish.outputs.type }}
33-
run: |
34-
echo "Published version: ${{ steps.publish.outputs.version }}"
35-
- name: Deploy
32+
run: pnpm publish --ignore-scripts
33+
env:
34+
NPM_CONFIG_PROVENANCE: true
35+
- name: Pages
3636
run: pnpm run deploy
3737
- uses: JamesIves/github-pages-deploy-action@v4
3838
with:

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@ jobs:
1111
name: Test
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Git checkout
15-
uses: actions/checkout@v4
14+
- uses: actions/checkout@v5
1615
- name: Install PNPM
1716
uses: pnpm/action-setup@v4
1817
with:
1918
version: 10
2019
- name: Install Node
2120
uses: actions/setup-node@v4
2221
with:
23-
node-version: 22
22+
node-version: 24
2423
cache: "pnpm"
2524
- name: Install and test
2625
run: pnpm install-test --frozen-lockfile

demo/src/demos/DepthOfFieldDemo.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ export class DepthOfFieldDemo extends PostProcessingDemo {
183183
smaaEffect.edgeDetectionMaterial.setEdgeDetectionThreshold(0.01);
184184

185185
const depthOfFieldEffect = new DepthOfFieldEffect(camera, {
186-
focusDistance: 0.0,
187-
focalLength: 0.048,
188-
bokehScale: 2.0,
186+
focusDistance: 0.4,
187+
focusRange: 2.2,
188+
bokehScale: 2.3,
189189
height: 480
190190
});
191191

@@ -250,7 +250,7 @@ export class DepthOfFieldDemo extends PostProcessingDemo {
250250
"coc": {
251251
"edge blur kernel": depthOfFieldEffect.blurPass.kernelSize,
252252
"focus": cocMaterial.uniforms.focusDistance.value,
253-
"focal length": cocMaterial.uniforms.focalLength.value
253+
"focus range": cocMaterial.uniforms.focalLength.value
254254
},
255255
"vignette": {
256256
"enabled": true,
@@ -303,16 +303,16 @@ export class DepthOfFieldDemo extends PostProcessingDemo {
303303

304304
});
305305

306-
folder.add(params.coc, "focus", 0.0, 1.0, 0.001).onChange((value) => {
306+
folder.add(params.coc, "focus", 0.0, 15.0, 0.1).onChange((value) => {
307307

308308
cocMaterial.uniforms.focusDistance.value = value;
309309

310310
});
311311

312-
folder.add(params.coc, "focal length", 0.0, 1.0, 0.0001)
312+
folder.add(params.coc, "focus range", 0.0, 5.0, 0.01)
313313
.onChange((value) => {
314314

315-
cocMaterial.uniforms.focalLength.value = value;
315+
cocMaterial.uniforms.focusRange.value = value;
316316

317317
});
318318

demo/src/demos/ShockWaveDemo.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,24 @@ export class ShockWaveDemo extends PostProcessingDemo {
105105
ndc.x = (event.clientX / window.innerWidth) * 2.0 - 1.0;
106106
ndc.y = -(event.clientY / window.innerHeight) * 2.0 + 1.0;
107107

108-
ndc.z = await this.depthPickingPass.readDepth(ndc);
108+
const renderer = this.composer.getRenderer();
109+
let depth = await this.depthPickingPass.readDepth(ndc);
110+
111+
if(renderer.capabilities.reversedDepthBuffer) {
112+
113+
depth = 1.0 - depth;
114+
115+
} else if(renderer.capabilities.logarithmicDepthBuffer) {
116+
117+
const camera = this.camera;
118+
const d = Math.pow(2.0, depth * Math.log2(camera.far + 1.0)) - 1.0;
119+
const a = camera.far / (camera.far - camera.near);
120+
const b = camera.far * camera.near / (camera.near - camera.far);
121+
depth = a + b / d;
122+
123+
}
124+
125+
ndc.z = depth;
109126
ndc.z = ndc.z * 2.0 - 1.0;
110127

111128
// Convert from NDC to world position.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postprocessing",
3-
"version": "6.37.8",
3+
"version": "6.38.0",
44
"description": "A post processing library for three.js.",
55
"homepage": "https://github.com/pmndrs/postprocessing",
66
"license": "Zlib",
@@ -90,7 +90,7 @@
9090
"watch:js": "node esbuild -w"
9191
},
9292
"peerDependencies": {
93-
"three": ">= 0.157.0 < 0.181.0"
93+
"three": ">= 0.157.0 < 0.182.0"
9494
},
9595
"devDependencies": {
9696
"@tweakpane/core": "2.x.x",
@@ -103,7 +103,7 @@
103103
"cpy-cli": "6.x.x",
104104
"cssnano": "7.x.x",
105105
"dat.gui": "0.x.x",
106-
"del-cli": "6.x.x",
106+
"del-cli": "7.x.x",
107107
"esbuild": "0.25.x",
108108
"esbuild-plugin-glsl": "1.x.x",
109109
"esdoc": "1.x.x",
@@ -120,7 +120,7 @@
120120
"sass": "1.x.x",
121121
"spatial-controls": "6.x.x",
122122
"stylelint": "16.x.x",
123-
"stylelint-config-standard-scss": "15.x.x",
123+
"stylelint-config-standard-scss": "16.x.x",
124124
"stylelint-order": "7.x.x",
125125
"three": "0.x.x",
126126
"three-demo": "5.x.x",

0 commit comments

Comments
 (0)