George Neil
George Neil

Reputation: 367

opacity issue while using THREE.ParticleSystem

I just made a jsfiddle to demonstrate the issue. http://jsfiddle.net/georgeneil/64LF4/4/

I have a cube and 20 particles in the 'Scene'. The particles are created using THREE.ParticleSystem. Here some of the particles are behind the cube. While changing the opacity in the GUI control i was NOT able to see the particles. But it is clearly seen when i set the visibility of cube as false in the GUI control.

Can some one help me how to fix this issue. I need to see the particles when i reduce the opacity of the cube.

Upvotes: 1

Views: 187

Answers (1)

WestLangley
WestLangley

Reputation: 104783

+1 for an excellent demo!

Opacity can be tricky. You need to do two things:

  1. add transparent: true as a property of your cube's material,

  2. add the cube to the scene after you add the particles.

Here is an updated Fiddle: http://jsfiddle.net/64LF4/6/

Upvotes: 2

Related Questions