@ccp-nc/crystvis-js 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/dependabot.yml +69 -0
- package/.github/workflows/dependency-review.yml +91 -0
- package/.github/workflows/security-scan.yml +113 -0
- package/.github/workflows/test.yml +191 -0
- package/.github/workflows/update-dependencies.yml +214 -0
- package/CHANGELOG.md +36 -0
- package/LICENSE +0 -0
- package/README.html +0 -0
- package/README.md +5 -1
- package/audit.txt +37 -0
- package/changes.txt +27 -0
- package/docs/.nojekyll +0 -0
- package/docs/data/search.json +1 -0
- package/docs/fonts/Inconsolata-Regular.ttf +0 -0
- package/docs/fonts/OpenSans-Regular.ttf +0 -0
- package/docs/fonts/WorkSans-Bold.ttf +0 -0
- package/docs/index.html +10 -0
- package/docs/lib_model.module_js-AtomImage.html +3 -0
- package/docs/lib_model.module_js-BondImage.html +3 -0
- package/docs/lib_model.module_js-Model.html +3 -0
- package/docs/lib_model.module_js.html +3 -0
- package/docs/lib_modelview.module_js-ModelView.html +12 -0
- package/docs/lib_modelview.module_js.html +3 -0
- package/docs/lib_visualizer.module_js-CrystVis.html +3 -0
- package/docs/lib_visualizer.module_js.html +3 -0
- package/docs/model.js.html +2160 -0
- package/docs/modelview.js.html +449 -0
- package/docs/scripts/core.js +726 -0
- package/docs/scripts/core.min.js +23 -0
- package/docs/scripts/resize.js +90 -0
- package/docs/scripts/search.js +265 -0
- package/docs/scripts/search.min.js +6 -0
- package/docs/scripts/third-party/Apache-License-2.0.txt +202 -0
- package/docs/scripts/third-party/fuse.js +9 -0
- package/docs/scripts/third-party/hljs-line-num-original.js +369 -0
- package/docs/scripts/third-party/hljs-line-num.js +1 -0
- package/docs/scripts/third-party/hljs-original.js +5171 -0
- package/docs/scripts/third-party/hljs.js +1 -0
- package/docs/scripts/third-party/popper.js +5 -0
- package/docs/scripts/third-party/tippy.js +1 -0
- package/docs/scripts/third-party/tocbot.js +672 -0
- package/docs/scripts/third-party/tocbot.min.js +1 -0
- package/docs/styles/clean-jsdoc-theme-base.css +1159 -0
- package/docs/styles/clean-jsdoc-theme-dark.css +412 -0
- package/docs/styles/clean-jsdoc-theme-light.css +482 -0
- package/docs/styles/clean-jsdoc-theme-scrollbar.css +30 -0
- package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +1 -0
- package/docs/styles/clean-jsdoc-theme.min.css +1 -0
- package/docs/tutorial-Events.html +13 -0
- package/docs/tutorial-Queries.html +16 -0
- package/docs/tutorial-ThreejsMigration.html +25 -0
- package/docs/visualizer.js.html +574 -0
- package/docs-tutorials/Events.md +0 -0
- package/docs-tutorials/Queries.md +0 -0
- package/docs-tutorials/ThreejsMigration.md +96 -0
- package/eslint.config.js +41 -0
- package/fonts/OpenSans/OFL.txt +0 -0
- package/fonts/OpenSans/OpenSans-Italic-VariableFont_wdth,wght.ttf +0 -0
- package/fonts/OpenSans/OpenSans-VariableFont_wdth,wght.ttf +0 -0
- package/fonts/OpenSans/README.txt +0 -0
- package/fonts/OpenSans/static/OpenSans/OpenSans-Bold.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans/OpenSans-BoldItalic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans/OpenSans-ExtraBold.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans/OpenSans-Italic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans/OpenSans-Light.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans/OpenSans-LightItalic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans/OpenSans-Medium.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans/OpenSans-MediumItalic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans/OpenSans-Regular.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans/OpenSans-SemiBold.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans/OpenSans-SemiBoldItalic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-Bold.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-BoldItalic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-ExtraBold.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-ExtraBoldItalic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-Italic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-Light.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-LightItalic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-Medium.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-MediumItalic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-Regular.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-SemiBold.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_Condensed/OpenSans_Condensed-SemiBoldItalic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Bold.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-BoldItalic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBold.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBoldItalic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Italic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Light.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-LightItalic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Medium.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-MediumItalic.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Regular.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBold.ttf +0 -0
- package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBoldItalic.ttf +0 -0
- package/fonts/Rubik/OFL.txt +0 -0
- package/fonts/Rubik/README.txt +0 -0
- package/fonts/Rubik/Rubik-Italic-VariableFont_wght.ttf +0 -0
- package/fonts/Rubik/Rubik-VariableFont_wght.ttf +0 -0
- package/fonts/Rubik/static/Rubik-Black.ttf +0 -0
- package/fonts/Rubik/static/Rubik-BlackItalic.ttf +0 -0
- package/fonts/Rubik/static/Rubik-Bold.ttf +0 -0
- package/fonts/Rubik/static/Rubik-BoldItalic.ttf +0 -0
- package/fonts/Rubik/static/Rubik-ExtraBold.ttf +0 -0
- package/fonts/Rubik/static/Rubik-ExtraBoldItalic.ttf +0 -0
- package/fonts/Rubik/static/Rubik-Italic.ttf +0 -0
- package/fonts/Rubik/static/Rubik-Light.ttf +0 -0
- package/fonts/Rubik/static/Rubik-LightItalic.ttf +0 -0
- package/fonts/Rubik/static/Rubik-Medium.ttf +0 -0
- package/fonts/Rubik/static/Rubik-MediumItalic.ttf +0 -0
- package/fonts/Rubik/static/Rubik-Regular.ttf +0 -0
- package/fonts/Rubik/static/Rubik-SemiBold.ttf +0 -0
- package/fonts/Rubik/static/Rubik-SemiBoldItalic.ttf +0 -0
- package/index.html +0 -0
- package/index.js +0 -0
- package/jsconf.json +0 -0
- package/lib/assets/fonts/bmpfonts.in.js +0 -0
- package/lib/assets/fonts/bmpfonts.js +0 -0
- package/lib/assets/fonts/font.js +33 -3
- package/lib/assets/fonts/index.js +0 -0
- package/lib/assets/fonts/threebmfont.js +2 -12
- package/lib/data.js +0 -0
- package/lib/formats/cell.js +0 -0
- package/lib/formats/cif.js +0 -0
- package/lib/formats/magres.js +0 -0
- package/lib/formats/xyz.js +149 -52
- package/lib/loader.js +28 -7
- package/lib/model.js +10 -3
- package/lib/modelview.js +30 -0
- package/lib/nmrdata.js +0 -0
- package/lib/orbit.js +77 -1
- package/lib/primitives/atoms.js +12 -7
- package/lib/primitives/cell.js +1 -1
- package/lib/primitives/dither.js +1 -1
- package/lib/primitives/ellipsoid.js +22 -8
- package/lib/primitives/geometries.js +3 -3
- package/lib/primitives/isosurface.js +2 -6
- package/lib/primitives/shapes.js +1 -1
- package/lib/primitives/sprites.js +9 -2
- package/lib/query.js +3 -28
- package/lib/render.js +40 -9
- package/lib/selbox.js +0 -0
- package/lib/shaders/aura.frag +0 -1
- package/lib/shaders/aura.vert +0 -1
- package/lib/shaders/dither.frag +0 -0
- package/lib/shaders/dither.vert +0 -0
- package/lib/shaders/index.in.js +0 -0
- package/lib/shaders/index.js +4 -4
- package/lib/shaders/msdf300.frag +0 -2
- package/lib/shaders/msdf300.vert +0 -2
- package/lib/tensor.js +0 -1
- package/lib/visualizer.js +5 -4
- package/outdated.txt +12 -0
- package/package.json +21 -22
- package/scripts/build-bundle.js +6 -2
- package/scripts/build-resources.js +0 -0
- package/scripts/plugins-shim.js +0 -0
- package/test/data/CHA.cif +0 -0
- package/test/data/H2O.xyz +0 -0
- package/test/data/H2_bound.xyz +0 -0
- package/test/data/bohr.cell +0 -0
- package/test/data/ethanol.cell +0 -0
- package/test/data/ethanol_with_tensors.xyz +33 -0
- package/test/data/example_single.cif +0 -0
- package/test/data/frac.cell +0 -0
- package/test/data/org.cif +0 -0
- package/test/data/pyridine.xyz +0 -0
- package/test/data/si8.xyz +0 -0
- package/test/loader.js +168 -8
- package/test/model.js +2 -4
- package/test/test-html/examples.js +0 -0
- package/test/test-html/index.html +0 -0
- package/tools/compile_colors.py +0 -0
- package/tools/compile_periodic.py +0 -0
- package/tools/ptable.json +0 -0
- package/tools/test +0 -0
- package/.eslintrc.json +0 -16
- package/.github/workflows/test-mocha.yml +0 -30
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Three.js Migration Notes
|
|
2
|
+
|
|
3
|
+
## Upgrade from Three.js 0.137 to 0.178
|
|
4
|
+
|
|
5
|
+
With the release of version 0.6.0, `crystvis-js` has been updated to use Three.js 0.178 (from the previous version 0.137). This represents a significant upgrade with several important changes that developers should be aware of.
|
|
6
|
+
|
|
7
|
+
### Key Changes
|
|
8
|
+
|
|
9
|
+
1. **Color Management**:
|
|
10
|
+
- Three.js has changed how colors are handled between versions
|
|
11
|
+
- Colors are now handled in the sRGB color space by default with more strict enforcement
|
|
12
|
+
- Color methods like `getHex()` now return values in sRGB color space
|
|
13
|
+
- Use `renderer.outputColorSpace = THREE.SRGBColorSpace` (replaces older `outputEncoding = THREE.sRGBEncoding`)
|
|
14
|
+
|
|
15
|
+
2. **Shader Compatibility**:
|
|
16
|
+
- GLSL shaders now require explicit version declarations through the `glslVersion` parameter
|
|
17
|
+
- When using `RawShaderMaterial` with GLSL 3.0, you must specify `glslVersion: THREE.GLSL3`
|
|
18
|
+
- The `#version` directive should not be included manually in the shader code when using `glslVersion`, as Three.js will inject it automatically
|
|
19
|
+
- Including your own `#version` directive will cause a duplication error
|
|
20
|
+
|
|
21
|
+
3. **Material Properties**:
|
|
22
|
+
- Material property handling has been updated
|
|
23
|
+
- Use `.set()` method for colors instead of direct assignment with `new THREE.Color()`
|
|
24
|
+
- Direct assignment with `=` may not trigger internal updates properly anymore
|
|
25
|
+
- Some material properties may require different configuration for the same visual result
|
|
26
|
+
|
|
27
|
+
### Texture Handling
|
|
28
|
+
|
|
29
|
+
If your application uses textures (e.g., from loaded models or images), they now require explicit color space declaration:
|
|
30
|
+
|
|
31
|
+
```javascript
|
|
32
|
+
// Old approach (pre-0.6.0)
|
|
33
|
+
texture.encoding = THREE.sRGBEncoding;
|
|
34
|
+
|
|
35
|
+
// New approach (0.6.0+)
|
|
36
|
+
texture.colorSpace = THREE.SRGBColorSpace;
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Breaking Changes
|
|
40
|
+
|
|
41
|
+
If you're extending `crystvis-js` or using it in a custom way, be aware of these breaking changes:
|
|
42
|
+
|
|
43
|
+
1. **Color Setting**:
|
|
44
|
+
```javascript
|
|
45
|
+
// Old approach (pre-0.6.0)
|
|
46
|
+
material.color = new THREE.Color(hexValue);
|
|
47
|
+
|
|
48
|
+
// New approach (0.6.0+)
|
|
49
|
+
material.color.set(hexValue);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
2. **Shader Usage**:
|
|
53
|
+
```javascript
|
|
54
|
+
// Old approach (pre-0.6.0)
|
|
55
|
+
new THREE.RawShaderMaterial({
|
|
56
|
+
vertexShader: shader,
|
|
57
|
+
fragmentShader: shader
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// New approach (0.6.0+)
|
|
61
|
+
new THREE.RawShaderMaterial({
|
|
62
|
+
vertexShader: shader,
|
|
63
|
+
fragmentShader: shader,
|
|
64
|
+
glslVersion: THREE.GLSL3 // For GLSL 3.0 shaders
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
3. **Renderer Configuration**:
|
|
69
|
+
- The default rendering equations have changed slightly
|
|
70
|
+
- Materials may appear different (usually more physically accurate but sometimes duller)
|
|
71
|
+
- Lighting and material properties may need adjustment for the same visual appearance
|
|
72
|
+
- Explicitly use `renderer.outputColorSpace = THREE.SRGBColorSpace` as the new API (post-r139)
|
|
73
|
+
- Physically correct lighting model updates may affect appearance
|
|
74
|
+
- The default values of `material.toneMapped` or lighting intensities might need tuning
|
|
75
|
+
|
|
76
|
+
### Recommendations
|
|
77
|
+
|
|
78
|
+
If you're using `crystvis-js` as a dependency:
|
|
79
|
+
- Update your code to use `.set()` for color changes
|
|
80
|
+
- If you're extending the library with custom shaders, ensure you set `glslVersion` correctly
|
|
81
|
+
- Test your visualizations thoroughly after upgrading
|
|
82
|
+
|
|
83
|
+
If you're maintaining a fork:
|
|
84
|
+
- Review all color operations in your codebase
|
|
85
|
+
- Check all shader implementations for version directive issues
|
|
86
|
+
- Consider adjusting material parameters to maintain consistent appearance
|
|
87
|
+
|
|
88
|
+
## Future Compatibility
|
|
89
|
+
|
|
90
|
+
We will continue to update Three.js dependencies in future releases. To minimize migration issues:
|
|
91
|
+
|
|
92
|
+
1. Avoid direct Three.js class extensions where possible
|
|
93
|
+
2. Use the provided APIs rather than accessing Three.js objects directly
|
|
94
|
+
3. When using Three.js directly, follow their recommended practices for forward compatibility
|
|
95
|
+
|
|
96
|
+
For questions or issues related to this migration, please open an issue on the [GitHub repository](https://github.com/ccp-nc/crystvis-js/issues).
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
|
|
4
|
+
const cleanedBrowserGlobals = Object.fromEntries(
|
|
5
|
+
Object.entries(globals.browser).filter(([key]) => !key.match(/\s/))
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
export default [
|
|
9
|
+
{
|
|
10
|
+
ignores: ['node_modules/', 'demo/', 'test/test-html/'],
|
|
11
|
+
},
|
|
12
|
+
js.configs.recommended,
|
|
13
|
+
{
|
|
14
|
+
languageOptions: {
|
|
15
|
+
ecmaVersion: 2021,
|
|
16
|
+
sourceType: 'module',
|
|
17
|
+
globals: {
|
|
18
|
+
...cleanedBrowserGlobals,
|
|
19
|
+
...globals.node,
|
|
20
|
+
},
|
|
21
|
+
parserOptions: {
|
|
22
|
+
ecmaVersion: 2021,
|
|
23
|
+
sourceType: 'module',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
rules: {
|
|
27
|
+
'no-unused-vars': ['error', { args: 'none' }],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
files: ['test/**/*.js'],
|
|
32
|
+
languageOptions: {
|
|
33
|
+
globals: {
|
|
34
|
+
...globals.mocha,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
rules: {
|
|
38
|
+
'no-unused-vars': ['warn', { args: 'none' }],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
];
|
package/fonts/OpenSans/OFL.txt
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBoldItalic.ttf
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-MediumItalic.ttf
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/fonts/OpenSans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBoldItalic.ttf
CHANGED
|
File without changes
|
package/fonts/Rubik/OFL.txt
CHANGED
|
File without changes
|
package/fonts/Rubik/README.txt
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/index.html
CHANGED
|
File without changes
|
package/index.js
CHANGED
|
File without changes
|
package/jsconf.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/assets/fonts/font.js
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
* @fileoverview Contains a BitmapFont class designed to load bitmap fonts and ready them for use
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
// Alpha test threshold for text material transparency
|
|
8
|
+
const ALPHA_TEST_THRESHOLD = 0.01;
|
|
9
|
+
|
|
10
|
+
// Luminance boost configuration constants
|
|
11
|
+
const LUMINANCE_BOOST_FACTOR = 1.2;
|
|
12
|
+
const LUMINANCE_BOOST_MAX = 0.95;
|
|
13
|
+
|
|
7
14
|
import _ from 'lodash';
|
|
8
15
|
import {
|
|
9
16
|
loadFont,
|
|
@@ -42,12 +49,31 @@ class BitmapFont {
|
|
|
42
49
|
if (shift instanceof Array) {
|
|
43
50
|
shift = new THREE.Vector3(shift[0], shift[1], shift[2]);
|
|
44
51
|
}
|
|
52
|
+
|
|
53
|
+
// Handle color conversion more explicitly to avoid colorspace issues
|
|
54
|
+
let textColor;
|
|
55
|
+
if (typeof color === 'number') {
|
|
56
|
+
// Convert hex color properly to ensure correct representation
|
|
57
|
+
textColor = new THREE.Color();
|
|
58
|
+
// Convert the hex number to a properly formatted hex string
|
|
59
|
+
const hexString = '#' + ('000000' + color.toString(16)).slice(-6);
|
|
60
|
+
textColor.set(hexString);
|
|
61
|
+
} else if (color instanceof THREE.Color) {
|
|
62
|
+
textColor = color.clone();
|
|
63
|
+
} else {
|
|
64
|
+
textColor = new THREE.Color(color);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Boost color brightness for better visibility
|
|
68
|
+
const hsl = textColor.getHSL({}); // getHSL returns an object with h, s, l
|
|
69
|
+
hsl.l = Math.min(hsl.l * LUMINANCE_BOOST_FACTOR, LUMINANCE_BOOST_MAX);
|
|
70
|
+
textColor.setHSL(hsl.h, hsl.s, hsl.l);
|
|
45
71
|
|
|
46
72
|
return new THREE.RawShaderMaterial({
|
|
47
73
|
uniforms: {
|
|
48
74
|
opacity: new THREE.Uniform(opacity),
|
|
49
75
|
map: new THREE.Uniform(texture),
|
|
50
|
-
color: new THREE.Uniform(
|
|
76
|
+
color: new THREE.Uniform(textColor),
|
|
51
77
|
fixRotation: new THREE.Uniform(fixRotation),
|
|
52
78
|
fixScale: new THREE.Uniform(fixScale),
|
|
53
79
|
targScale: new THREE.Uniform(targScale),
|
|
@@ -57,9 +83,13 @@ class BitmapFont {
|
|
|
57
83
|
transparent: true,
|
|
58
84
|
vertexShader: Shaders.msdfVertShader,
|
|
59
85
|
fragmentShader: Shaders.msdfFragShader,
|
|
60
|
-
depthTest: depthTest
|
|
86
|
+
depthTest: depthTest,
|
|
87
|
+
depthWrite: false,
|
|
88
|
+
glslVersion: THREE.GLSL3,
|
|
89
|
+
blendSrc: THREE.SrcAlphaFactor,
|
|
90
|
+
blendDst: THREE.OneMinusSrcAlphaFactor,
|
|
91
|
+
alphaTest: ALPHA_TEST_THRESHOLD
|
|
61
92
|
});
|
|
62
|
-
|
|
63
93
|
}
|
|
64
94
|
|
|
65
95
|
getTextGeometry(text, options = {}) {
|
|
File without changes
|
|
@@ -4,20 +4,10 @@
|
|
|
4
4
|
// variables to make these packages work...
|
|
5
5
|
// it's ugly but there's no way out, it seems.
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
Buffer
|
|
10
|
-
} from 'buffer';
|
|
7
|
+
import loadFontRaw from 'load-bmfont';
|
|
11
8
|
|
|
12
9
|
const loadFont = function(fntfile, callback) {
|
|
13
|
-
|
|
14
|
-
globalThis.Buffer = Buffer;
|
|
15
|
-
|
|
16
|
-
const loadFontRaw = require('load-bmfont');
|
|
17
|
-
loadFontRaw(fntfile, (...args) => {
|
|
18
|
-
callback.apply(this, args);
|
|
19
|
-
globalThis.Buffer = oldBuffer;
|
|
20
|
-
});
|
|
10
|
+
loadFontRaw(fntfile, callback);
|
|
21
11
|
};
|
|
22
12
|
|
|
23
13
|
import createGeometry from '@jkshenton/three-bmfont-text';
|
package/lib/data.js
CHANGED
|
File without changes
|
package/lib/formats/cell.js
CHANGED
|
File without changes
|
package/lib/formats/cif.js
CHANGED
|
File without changes
|
package/lib/formats/magres.js
CHANGED
|
File without changes
|