Core: Move Phong shader chunks out of BSDFs
...continuing a pattern started previously.
bsdfs.js is now vacuous, and has been removed.
📦 Bundle size
Full ESM build, minified and gzipped.
Filesize dev |
Filesize PR | Diff |
|---|---|---|
| 642.7 kB (159.1 kB) | 642.6 kB (159 kB) | -92 B |
🌳 Bundle size after tree-shaking
Minimal build including a renderer, camera, empty scene, and dependencies.
Filesize dev |
Filesize PR | Diff |
|---|---|---|
| 432.9 kB (104.8 kB) | 432.8 kB (104.8 kB) | -92 B |
Perhaps renaming bsdfs to other name could avoid code duplication of MMDToonShader.js and lights_phong_pars_fragment.glsl.js?
Because I don't like the idea of moving the Blinn-Phong BRDF out of a Blinn-Phong-specific file in core to accommodate an example program that is modifying shader chunks via onBeforeCompile().
If a user wants to use onBeforeCompile() to hack the shader code, the user must copy the shader chunk and edit it.
I do not support moving part of the Blinn-Phong-specific code out of the Phong pars file in Core so the user has fewer lines to copy.