paperlab 0.5.1 → 0.5.2
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/dist/stage.cjs +4 -3
- package/dist/stage.cjs.map +1 -1
- package/dist/stage.js +4 -3
- package/dist/stage.js.map +1 -1
- package/package.json +1 -1
package/dist/stage.js
CHANGED
|
@@ -486,8 +486,7 @@ function makeGlowTexture(color) {
|
|
|
486
486
|
const ctx = canvas.getContext("2d");
|
|
487
487
|
const glow = ctx.createRadialGradient(size / 2, size / 2, 0, size / 2, size / 2, size / 2);
|
|
488
488
|
const c = new THREE3.Color(color);
|
|
489
|
-
const
|
|
490
|
-
for (const [stop, alpha] of [
|
|
489
|
+
for (const [stop, level] of [
|
|
491
490
|
[0, 1],
|
|
492
491
|
[0.5, 1],
|
|
493
492
|
[0.62, 0.66],
|
|
@@ -496,7 +495,8 @@ function makeGlowTexture(color) {
|
|
|
496
495
|
[0.94, 0.03],
|
|
497
496
|
[1, 0]
|
|
498
497
|
]) {
|
|
499
|
-
|
|
498
|
+
const scaled = `${c.r * 255 * level | 0}, ${c.g * 255 * level | 0}, ${c.b * 255 * level | 0}`;
|
|
499
|
+
glow.addColorStop(stop, `rgb(${scaled})`);
|
|
500
500
|
}
|
|
501
501
|
ctx.fillStyle = glow;
|
|
502
502
|
ctx.fillRect(0, 0, size, size);
|
|
@@ -521,6 +521,7 @@ function Source({
|
|
|
521
521
|
{
|
|
522
522
|
map: texture,
|
|
523
523
|
transparent: true,
|
|
524
|
+
blending: THREE3.AdditiveBlending,
|
|
524
525
|
color: new THREE3.Color(intensity, intensity, intensity),
|
|
525
526
|
depthWrite: false,
|
|
526
527
|
fog: false
|