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

TSL: Add blendNormal() to BlendMode. #29879

Merged
merged 2 commits into from
Nov 14, 2024
Merged

TSL: Add blendNormal() to BlendMode. #29879

merged 2 commits into from
Nov 14, 2024

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Nov 14, 2024

Related issue: #29597 (comment)

Description

This PR adds a blendNormal() helper which simplifies the SSR blend on app level.

BTW: Is BlendMode a typo? Should it be BlendNode?

Copy link

github-actions bot commented Nov 14, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 339.37
79.06
339.37
79.06
+0 B
+0 B
WebGPU 477.94
132.55
478.14
132.61
+196 B
+59 B
WebGPU Nodes 477.41
132.42
477.61
132.49
+196 B
+61 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 464.82
112.02
464.82
112.02
+0 B
+0 B
WebGPU 546.87
148.17
546.87
148.17
+0 B
+0 B
WebGPU Nodes 502.75
137.88
502.75
137.88
+0 B
+0 B

@sunag
Copy link
Collaborator

sunag commented Nov 14, 2024

BTW: Is BlendMode a typo? Should it be BlendNode?

Maybe BlendModes? We are using the Node suffix only when there is an extended class of Node.

@sunag
Copy link
Collaborator

sunag commented Nov 14, 2024

Do you think blendNormal is better? Especially in auto-complete, I was thinking about renaming the others too.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Nov 14, 2024

Maybe BlendModes? We are using the Node suffix only when there is an extended class of Node.

Got it. 👍

BlendModes sounds better since the module is a collection of blend functions.

Do you think blendNormal is better? Especially in auto-complete, I was thinking about renaming the others too.

Sounds good! I'll update the PR.

@Mugen87 Mugen87 changed the title TSL: Add normalBlend() to BlendMode. TSL: Add blendNormal() to BlendMode. Nov 14, 2024
@sunag sunag merged commit 2f35721 into mrdoob:dev Nov 14, 2024
12 checks passed
@sunag sunag mentioned this pull request Nov 15, 2024
3 tasks
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