Skip to content

Commit 38efbe8

Browse files
index2.html: render stars as round dots, not squares
PointsMaterial draws each point as a square quad. Add a soft white radial-gradient sprite as the material map so the points read as round dots; depthWrite is disabled so the transparent corners don't clip neighbouring stars. The sprite is white, so it still takes the material's colour tint (cruise green / warp white). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1294ea5 commit 38efbe8

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

index2.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,8 +1261,23 @@ <h2>Trusted by sysadmins, hoarders and the merely paranoid.</h2>
12611261
starPos.set([v.x, v.y, v.z], s * 3);
12621262
}
12631263
starGeo.setAttribute('position', new THREE.BufferAttribute(starPos, 3));
1264+
// soft circular sprite so the points render as round dots instead of squares
1265+
// (white, so it still takes the material's colour tint)
1266+
const starSprite = (() => {
1267+
const sz = 64, c = document.createElement('canvas');
1268+
c.width = c.height = sz;
1269+
const ctx = c.getContext('2d');
1270+
const g = ctx.createRadialGradient(sz / 2, sz / 2, 0, sz / 2, sz / 2, sz / 2);
1271+
g.addColorStop(0.0, 'rgba(255,255,255,1)');
1272+
g.addColorStop(0.5, 'rgba(255,255,255,0.92)');
1273+
g.addColorStop(1.0, 'rgba(255,255,255,0)');
1274+
ctx.fillStyle = g;
1275+
ctx.fillRect(0, 0, sz, sz);
1276+
return new THREE.CanvasTexture(c);
1277+
})();
12641278
const stars = new THREE.Points(starGeo, new THREE.PointsMaterial({
1265-
color: 0x7fdb91, size: 0.45, sizeAttenuation: true, transparent: true, opacity: 0.7
1279+
color: 0x7fdb91, size: 0.45, sizeAttenuation: true, transparent: true, opacity: 0.7,
1280+
map: starSprite, depthWrite: false
12661281
}));
12671282
scene.add(stars);
12681283

0 commit comments

Comments
 (0)