-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Src: encodings_fragment -> colorspace_fragment #26206
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
I'm a bit worried about this change. The So I wonder if the renaming is worth the breakage. I think it would be best to deprecate the shader chunk first and then log a warning for ten releases. Maybe we can try to implement a small deprecation check in |
This should do it: const shaderChunkMap = new Map( [
[ 'encodings_fragment', 'color_space_fragment' ], // @deprecated, r154
[ 'encodings_pars_fragment', 'color_space_pars_fragment' ] // @deprecated, r154
] );
function includeReplacer( match, include ) {
let string = ShaderChunk[ include ];
if ( string === undefined ) {
const newInclude = shaderChunkMap.get( include );
if ( newInclude !== undefined ) {
string = ShaderChunk[ newInclude ];
console.warn( 'THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', include, newInclude );
} else {
throw new Error( 'Can not resolve #include <' + include + '>' );
}
}
return resolveIncludes( string );
} |
@Mugen87 Good suggestion, thanks. I implemented it in this PR. |
I think |
We decided to use the term "color space", not "colorspace". Hence, the variable name became Consequently, I chose to use |
f0fccb9
to
bc8833c
Compare
@WestLangley Thanks! 🙏 Also great to finally have a migration helper for these 🥲 |
This PR requires updated build files. Otherwise, the modified examples are out-of-sync with core. |
e31a6d4 🚀 |
... plus related changes.