Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples: Added hashBlur and improve webgpu_backdrop_area example #29606

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Oct 10, 2024

Description

hashBlur is more performant in tests, the main reason is because it doesn't need mipmaps, and it seems to have satisfactory quality, although with noise it has a better smoother blur transition amount.

image

@sunag sunag added this to the r170 milestone Oct 10, 2024
@sunag sunag marked this pull request as ready for review October 10, 2024 03:19
Copy link

github-actions bot commented Oct 10, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 689.82
170.9
689.82
170.9
+0 B
+0 B
WebGPU 812.47
218.85
812.49
218.86
+16 B
+5 B
WebGPU Nodes 811.98
218.72
812
218.73
+16 B
+5 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 462.84
111.78
462.84
111.78
+0 B
+0 B
WebGPU 536.55
144.82
536.56
144.82
+16 B
+6 B
WebGPU Nodes 492.66
134.54
492.68
134.55
+16 B
+6 B

@sunag sunag merged commit 69e0515 into mrdoob:dev Oct 10, 2024
12 checks passed
@sunag sunag deleted the dev-hashed-blur branch October 10, 2024 04:27
@mrdoob
Copy link
Owner

mrdoob commented Oct 10, 2024

Very nice!

Should transmission use it too?


const draw = ( uv ) => textureNode.uv( uv );

const targetUV = textureNode.uvNode;
Copy link
Collaborator

@Mugen87 Mugen87 Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be texture nodes without uvNode so maybe:

const targetUV = textureNode.uvNode || uv();

Without this fix, I can't use the blur with ssrPass.getTextureNode().

@sunag
Copy link
Collaborator Author

sunag commented Oct 10, 2024

Should transmission use it too?

That's the goal, although I still didn't get the same approximate result.

@Mugen87
Copy link
Collaborator

Mugen87 commented Oct 10, 2024

I've tried to blur the result of a reflector but encountered an issue with both hash and gaussian blur: https://jsfiddle.net/c79ak854/1/

  • When orbiting the camera around the scene, the blurred reflections of hashBlur get an offset.
image
  • When using gaussianBlur(), the reflections are completely missing:
image

@sunag
Copy link
Collaborator Author

sunag commented Oct 11, 2024

#29619

It was necessary 3 fixes, but now it's working.

hashBlur
image

gaussian blur
image

@mrdoob
Copy link
Owner

mrdoob commented Oct 11, 2024

I noticed webgpu_ocean has a similar issue:

https://threejs.org/examples/webgpu_ocean.html

Screen.Recording.2024-10-11.at.12.14.18.PM.mov

@sunag
Copy link
Collaborator Author

sunag commented Oct 11, 2024

Fixed too :) #29626

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