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

ToneMappingNode: properly handle alpha #29076

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

WestLangley
Copy link
Collaborator

For WebGLRenderer, the input to the tone mapping function is vec3 color.

However, for WebGPURenderer, the input is vec4 color. (And, since it is implemented as a post processing step, the RGB components have premultiplied alpha -- but that is not an issue here.)

The tone mapping operation and color space transform should be applied to the RGB channels only. The alpha channel should remain unchanged.

Copy link

github-actions bot commented Aug 7, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
685.1 kB (169.6 kB) 685.1 kB (169.6 kB) +0 B

🌳 Bundle size after tree-shaking

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

Filesize dev Filesize PR Diff
462 kB (111.5 kB) 462 kB (111.5 kB) +0 B

@WestLangley WestLangley force-pushed the dev-webgpu_tone_mapping branch from d8994d2 to 138a89c Compare August 7, 2024 18:52
@WestLangley WestLangley marked this pull request as ready for review August 7, 2024 19:20
@WestLangley WestLangley changed the title WebGPURenderer: ToneMappingNode mishandles alpha ToneMappingNode: properly handle alpha Aug 7, 2024
@WestLangley WestLangley added this to the r168 milestone Aug 7, 2024
@sunag sunag merged commit 3e8a4f5 into mrdoob:dev Aug 8, 2024
12 checks passed
@WestLangley WestLangley deleted the dev-webgpu_tone_mapping branch August 8, 2024 03:25
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