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 90d4c89 commit b6f6998
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions threejs/particle-life/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ function init() {

}

function toggleBlending(value) {
if (material) {
material.blending = value ? THREE.AdditiveBlending : THREE.NormalBlending;
material.needsUpdate = true;
}
}

function onMouseDown() {
if (!firstClick) {
setParameters();
Expand Down Expand Up @@ -230,12 +237,7 @@ function updateParticles() {
geometry.attributes.position.needsUpdate = true;
}

function toggleBlending(value) {
if (material) {
material.blending = value ? THREE.AdditiveBlending : THREE.NormalBlending;
material.needsUpdate = true;
}
}


init();
animate();
Expand Down

0 comments on commit b6f6998

Please sign in to comment.