2

I'm making a particle engine in Java, and right now I'm using a subclass of java.awt.canvas. I'm using canvas.getBufferStrategy().getDrawGraphics() and then, when I'm done, using canvas.getBufferStrategy().Show().

Now that I've got some particles (graphics.fillOval(...)) - I need to do some additive blending! Problem is, I can't find additive blending anywhere (googled). What I came up with from a google search is open gl through jogl. jogl would be a great move from graphics, since I have change the graphics color thousands of times a tick, and I can't find additive blending, but I'm just unsure as to whether or not jogl is standard and works on all (or most) computers.

Any thoughts or suggestions are welcome.

MByD
  • 135,866
  • 28
  • 264
  • 277
Caleb Jares
  • 6,163
  • 6
  • 56
  • 83

1 Answers1

3

You may want to consider AlphaComposite, as shown in this kinetic model.

Addendum: This utility may be helpful in visualizing the effect of various compositing rules.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • I would prefer JOGL if possible, and the requrements are java 2 and OpenGL. However, what if the user doesn't have OpenGL? That's why I'm looking at java 3d. If it has a software rendered as a fallback it would be perfect. Any thoughts? – Caleb Jares May 06 '11 at 17:04
  • When I've used JOGL, Java Web Start served the (myriad) decencies well enough. See also, [JOGL Demos](http://download.java.net/media/jogl/demos/www/). – trashgod May 06 '11 at 18:11