Skip to content

TSL: Add blendNormal() to BlendMode.#29879

Merged
sunag merged 2 commits intomrdoob:devfrom
Mugen87:dev3
Nov 14, 2024
Merged

TSL: Add blendNormal() to BlendMode.#29879
sunag merged 2 commits intomrdoob:devfrom
Mugen87:dev3

Conversation

@Mugen87
Copy link
Copy Markdown
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?

@github-actions
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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