1

I am writing a game in Java but have run in to an issue. I need to blur certain entitities within the game in order to create the right look. However, a lot of these objects are circular and so I am having issues blurring them properly.

Here is an example of the kind of thing I'm aiming for: https://i.stack.imgur.com/oSSOL.png

Currently, I'm using a box blur but just can't think of a way to achieve this sort of effect.

If somebody could give me a nudge in the direction I need to be looking that would be great.

Thanks.

Will

Gynteniuxas
  • 7,035
  • 18
  • 38
  • 54
Will Moffat
  • 169
  • 8
  • I think that a gaussian blur would be a great option for what you are trying to achieve. Check out these articles for a quick how-to: http://www.jhlabs.com/ip/blurring.html ------ http://stackoverflow.com/questions/98359/fastest-gaussian-blur-implementation – Evan Bechtol Sep 19 '16 at 16:06
  • 2
    What GUI toolkit are you using? JavaFX? Swing?... – Puce Sep 19 '16 at 16:08
  • You could possibly use a ColorGradient: https://sourceforge.net/p/tus/code/HEAD/tree/tjacobs/ui/ex/ColorGradient.java – ControlAltDel Sep 19 '16 at 16:14
  • Guassian blur still seems to blur outside the circle, although it's possible that my implementation is wrong. I use just standard Graphics 2D. – Will Moffat Sep 19 '16 at 22:44

0 Answers0