Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jcponce committed Jul 14, 2024
1 parent cd8d8a0 commit 2c0cedb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions threejs/particle-life/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let positions, colors, velocitiesBuffer;

let material;
let params = {
additiveBlending: false
additiveBlending: true
};

function init() {
Expand Down Expand Up @@ -66,7 +66,8 @@ function init() {
transparent: true,
vertexColors: true,
alphaMap: texture,
depthWrite: false
depthWrite: false,
blending: THREE.AdditiveBlending
});
particles = new THREE.Points(geometry, material);
scene.add(particles);
Expand Down Expand Up @@ -127,7 +128,7 @@ function initializeParticles() {
velocitiesBuffer[i * 3] = 0;
velocitiesBuffer[i * 3 + 1] = 0;
velocitiesBuffer[i * 3 + 2] = 0;
let color = new THREE.Color(`hsl(${(i % numTypes) * colorStep}, 80%, 50%)`);
let color = new THREE.Color(`hsl(${(i % numTypes) * colorStep}, 100%, 40%)`);
colors[i * 3] = color.r;
colors[i * 3 + 1] = color.g;
colors[i * 3 + 2] = color.b;
Expand Down

0 comments on commit 2c0cedb

Please sign in to comment.