Three.js offers two different ways in which you can use an HTML5 canvas to style your particles. If you use the
CanvasRenderer class you can directly reference an HTML5 canvas from the
ParticleCanvasMaterial object. When you use the
WebGLRenderer class you need to take a couple of extra steps to use an HTML5 canvas as a style for your particle. In the following two sections we'll show you both of these approaches.
ParticleCanvasMaterial you can use the output from the HTML5 Canvas as a texture for your particles. This material is specifically created for the
CanvasRenderer and only works when you use this specific renderer. Before we look at how to ...