Blurring an Anti-Arc?

Hey i am new to the forums. I am currently developing an applet game with Java 2D. Not sure if this was the right place to put this topic up but sorry if it was. I am looking for anyway to blur the anti-arc of where a player is looking. If you don’t know what i am talking about i have some photoshop images.

Normal transparent arc - ugly flashlight in horror games? ( Correct me on the correct term for this arc stuff idk what im even talking about)
http://game.swixi.com/zam2black.png

What i am looking for, Blurring the anti-arc
http://game.swixi.com/zam2blur.png

Any ideas would be helpful, I have no clue how i would go about. I was thinking if i could somehow copy part of the image and use ConvoleOp on it. It would work correctly. Problem is, idk how to copy a part of the image that is not a rectangle. Oh well, help ploxxxx

You can clip with arbitrary shapes, but that’s a bit slow. And blur is very slow. You certainly won’t be able to do that in real time.

Well, with OpenGL and shaders things look different. But I’m not sure if the effect is any good. It looks more irritating than effective/atmospheric imo.

I wouldn’t say it’s impossible to do it at real-time with Java2D, but I would expect it to be the bottleneck of your rendering code & highly resolution dependant.

Using ConvolveOp & a custom clip it should be fairly simple:

Take a copy of the portion of the arc you don’t want blurred, (draw it onto a tmp image with an appropriately configured clip)
blur the whole of the original,
and copy back the unblurred portion you stored in the tmp image. (if your tmp image had transparency there will be no need for the custom clip on this draw)

Ofcourse, you might find you want the strength of the blur to increase the further outside the field of view a given pixel is… you won’t be able to do that with ConvolveOp.
If that’s the case - you’ll have to resort to manipulating the image on a per-pixel basis, bypassing the J2D pipeline altogether.

Rather than blurring maybe if you just painted a translucent dark grey image over the top it would look ok, be performant and achieve the same effect

i think left4kdead is a pretty good example of a flash light horror game using java2d http://www.mojang.com/notch/j4k/l4kd/

not sure how the spotlight effect is done there but it works well.

How do you use the clip? setClip will cut the image out? or only show that clip of image?