Are bloom effects possible for Java Graphics2D? If so, how?
Asked Answered
D

1

6

I've been attempting to make a 2D space-like game using Java just for the fun of it. I've decided just to use Java's Graphics2D to render my game because I wasn't in the mood to learn LWJGL. However, I just now realized how limited it is. For example, I realized a nice bloom/glow effect would look really nice. However, I can't find anything on Google about doing so with Graphics2D and without using another library.

What bloom effect I'm looking for:
https://gamedev.stackexchange.com/questions/18594/how-can-i-make-this-style-of-2d-glowing-graphics

Bloom information:
http://en.wikipedia.org/wiki/Bloom_%28shader_effect%29

So the main question is, does anyone know of a good method to add a sharp bloom shader effect using Graphics2D?

Dinky answered 25/11, 2013 at 1:45 Comment(4)
The closest thing I can think of would be to create an effect using ConvolveOp with custom matrices. If you play around with that a bit, you should be able to create something similar to what you're looking for.Abram
For the benefit of everyone else reading this question - en.wikipedia.org/wiki/Bloom_%28shader_effect%29Carpophagous
@Gilbert Le Blanc Apologies, I should have been more detailed about everything.Dinky
@Abram To be fair, IIRC doing a convolution with a custom matrix describes about half of all common image processing operations.Washerman
L
7

There's no bloom effect ready for use available in the Java 2D API, but it is certainly possible to implement one.

Lauer answered 25/11, 2013 at 2:4 Comment(2)
Java2D Bloom link broken.Comintern
@Comintern Not surprised, after all, it's a 10+ years old answer. The Wayback Machine doesn't have a copy of that page but one can find interesting stuff searching on Google.Lauer

© 2022 - 2024 — McMap. All rights reserved.