drawcall / Proton

Javascript particle animation library
https://drawcall.github.io/Proton/
MIT License
2.42k stars 275 forks source link

Rotate is break if I use Color #72

Closed kavandos closed 4 years ago

kavandos commented 4 years ago

I use rotate and it works fine emitter.addBehaviour(new Proton.Rotate( new Proton.Span(0, 360), 2, "to" ));

but once I add Color, Rotate stops working


emitter.addBehaviour(new Proton.Rotate( new Proton.Span(0, 360), 2, "to" ));
emitter.addBehaviour(new Proton.Color('ff0000', 'ff0000'));
kavandos commented 4 years ago

I there a way to make it work both with Color and Rotate?

kavandos commented 4 years ago

P.S. CanvasRenderer

drawcall commented 4 years ago

I guess you use both Proton.Body and Proton.Color in CanvasRender. Oh, painting a picture in canvas is a lossy performance operation. Proton uses the canvas cache buffer for painting pictures, so this case does not support simultaneous effect. You can use webgl instead.

drawcall commented 4 years ago

In fact, for most practical projects you do n’t need to color a picture

kavandos commented 4 years ago

thanks, switched to WebGLRenderer

kavandos commented 4 years ago

Looks like WEBGLRenderer doesn't clear it self by default