Skip to content

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Aug 3, 2025

Related issue: #31557 (comment)

Description

  • Remove option.mask parameter, use .sample() instead.
  • Align API of blur filters and deprecated premultipliedGaussianBlur().
const maskReflection = sample( ( uv ) => {

	const sample = reflection.sample( uv );
	const mask = reflectionDepth.sample( uv );

	return vec4( sample.rgb, sample.a.mul( mask.r ) );

}, reflection.uvNode );

Copy link

github-actions bot commented Aug 3, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.62
79.03
338.62
79.03
+0 B
+0 B
WebGPU 566.43
156.57
566.48
156.58
+52 B
+14 B
WebGPU Nodes 565.03
156.32
565.09
156.34
+52 B
+14 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 470.05
113.73
470.05
113.73
+0 B
+0 B
WebGPU 637.91
172.58
637.91
172.58
+0 B
+0 B
WebGPU Nodes 592.56
161.85
592.56
161.85
+0 B
+0 B

@sunag
Copy link
Collaborator Author

sunag commented Aug 3, 2025

@Mugen87 I'm doing something a bit different — instead of aligning all the different blur options, we can use the new .sample() interface. This way, we won’t have to worry as much if developers need more customized features in the future. We can do the same with premultiplyAlpha too.

@sunag sunag added this to the r180 milestone Aug 3, 2025
@sunag sunag marked this pull request as ready for review August 4, 2025 00:42
@sunag sunag merged commit 93b9620 into mrdoob:dev Aug 6, 2025
9 checks passed
@sunag sunag deleted the dev-align-blur-api branch August 6, 2025 04:49
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