squarefeet / ShaderParticleEngine

A GLSL-heavy particle engine for THREE.js. Originally based on Stemkoski's great particle engine (see README)
http://squarefeet.github.io/ShaderParticleEngine/
MIT License
853 stars 115 forks source link

Prevent particles from following camera ? #123

Closed etiennepinchon closed 7 years ago

etiennepinchon commented 7 years ago

Hi!

Love this library so far but I have little issue with it, I cannot find a way to prevent the particles from rotating and tracking the camera when it moves.

I want the particles to stay in the same orientation, is it possible?

Thank you!

squarefeet commented 7 years ago

Hi @etiennepinchon,

Do you mean that you wish the particles to not always face the camera? If so, then unfortunately that's not going to be possible. The particles are rendered as 'billboards' - these are 2D objects, not 3D, so can't be rotated in 3D space.

etiennepinchon commented 7 years ago

Hi @squarefeet, thank you for you quick response! Yes exactly what I wanted to do (similar to the things we can do with Unity)!

Btw, your engine is by far the most advanced one I have seen on the web, really amazing work! 👍

squarefeet commented 7 years ago

Thanks man :)

It's definitely possible, but it would require rewriting most of the library! Internally, the library uses a THREE.Points instance, which is what causes the billboard behaviour.

I daresay that if you wanted an adventure, you could replace THREE.Points with a constructor to render quads instead!

squarefeet commented 7 years ago

Closing this as mesh-based particles are out of scope for this project.