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: Color Space revision #29248

Merged
merged 5 commits into from
Aug 28, 2024
Merged

TSL: Color Space revision #29248

merged 5 commits into from
Aug 28, 2024

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Aug 28, 2024

Description

Examples:

// with parameter

node = node.toOutputColorSpace( THREE.SRGBColorSpace );
node = node.toWorkingColorSpace( THREE.SRGBColorSpace );

// without parameter -- it's will use `renderer.outputColorSpace`
// this turn more security the conversion of `sRGB` or `DisplayP3` to `linearSRGB` and vice versa.
// the user does not need to worry about the output display to work with color space conversions

node = node.toOutputColorSpace();
node = node.toWorkingColorSpace();
  • Improve TSL ColorSpace
  • Revision currentColorSpace
  • Added currentToneMapping

@sunag sunag added this to the r168 milestone Aug 28, 2024
Copy link

github-actions bot commented Aug 28, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
685.4 kB (169.7 kB) 685.4 kB (169.7 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.4 kB) 462 kB (111.4 kB) +0 B

@sunag
Copy link
Collaborator Author

sunag commented Aug 28, 2024

@WestLangley I improve the names to linearSRGB instead of just linear as you suggest in X d0f9425

@sunag sunag marked this pull request as ready for review August 28, 2024 21:44
@sunag sunag changed the title WebGPURenderer: ColorSpaceNode revision TSL: Color Space revision Aug 28, 2024
@sunag sunag added WebGPU TSL Three.js Shading Language labels Aug 28, 2024
@sunag sunag merged commit 3f2956c into mrdoob:dev Aug 28, 2024
12 checks passed
@sunag sunag deleted the dev-rev-colorspace branch August 28, 2024 22:58
@donmccurdy
Copy link
Collaborator

donmccurdy commented Aug 29, 2024

Note that for wide-gamut rendering, Linear-sRGB will not necessarily hold the role of "working color space", we'd instead want to render in Linear P3, Linear Rec. 2020, or perhaps ACEScg. That's not an urgent concern right now... but I wonder if naming with that "working color space" term might be more future-proof?

const outputNode = node.fromWorkingColorSpace( targetColorSpace = renderer.outputColorSpace );
const linearNode = node.toWorkingColorSpace( sourceColorSpace = renderer.outputColorSpace );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TSL Three.js Shading Language WebGPU
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants