Skip to main content

Glow Effect with specific color

4 replies [Last post]
oliverdb
Offline
Joined: 2005-02-10
Points: 0

I have an SGImage that is a child of a SGEffect. I am trying to create a glow effect but I cannot adjust the color of the flow, how is that done?

Something like this.

Glow glow = new Glow();
glow.setLevel(0.7f);
eff.setEffect(glow);

eff.setChild(sgimage);

Message was edited by: oliverdb

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Chris Campbell

What visual effect are you trying to achieve? Do you want the whole
image to glow with a "tint" of a certain color? Or perhaps you have
an image with transparent areas, and you want the areas around opaque
pixels (or around the edge of the image) to glow with a certain color?

If it's the latter, you can use the DropShadow effect and control the
color of the "glow" using the setColor() method.

If it's the former, then there's no explicit knob (i.e. no setColor()
method) to control the "tint" color. The Glow effect is currently
implemented by blurring the source and then adding (using
BlendMode.ADD) it to the original source.

Chris

On Jul 1, 2008, at 7:47 AM, scenario@javadesktop.org wrote:
> I have an SGImage that is a child of a SGEffect. I am trying to
> create a glow effect but I cannot adjust the color of the flow.
>
> Something like this.
>
> Glow glow = new Glow();
> glow.setLevel(0.7f);
> eff.setEffect(glow);
>
> eff.setChild(sgimage);
> [Message sent by forum member 'oliverdb' (oliverdb)]
>
> http://forums.java.net/jive/thread.jspa?messageID=283650
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
> For additional commands, e-mail: dev-help@scenegraph.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
For additional commands, e-mail: dev-help@scenegraph.dev.java.net

oliverdb
Offline
Joined: 2005-02-10
Points: 0

Hey Chris

Unfortunatly gave up on SGEffect.

I managed todo the glow effect in a JComponent(not scenegraph), using a blurred out and resized image, which i ran through a color filter to make it the glow any color I liked. I could make it pulsating by adjusting the alpha value of the blurred image. Very very low CPU utilization. It also made a more intense glow than I was able todo with the SGGlow effect.

This worked like a charm. But I am missing some way to put color filtres on my images in a scenegraph. Currently I dont know how to "grey" out an image.

Anyway great framework its a pleasure to work with :-)

Chris Campbell

On Jul 10, 2008, at 12:58 AM, scenario@javadesktop.org wrote:
> Hey Chris
>
> Unfortunatly gave up on SGEffect.
>
> I managed todo the glow effect in a JComponent(not scenegraph),
> using a blurred out and resized image, which i ran through a color
> filter to make it the glow any color I liked. I could make it
> pulsating by adjusting the alpha value of the blurred image. Very
> very low CPU utilization. It also made a more intense glow than I
> was able todo with the SGGlow effect.
>

Could you post a screenshot (preferably on some server, and provide
the URL) that shows your original image and the final image after your
glow/colorize effect? That will help us get a better idea of what
changes we could make to our existing Glow effect.

I'm pretty sure you can achieve the effect you're looking for by
chaining a couple existing Effect classes together, it's just that it
might be less obvious than using Glow directly. If you could post a
screenshot, I might be able to suggest such a chaining that will give
you the desired results without having to fallback on other techniques.

Just to confirm, you did try adjusting the intensity of the Glow
effect using the setLevel() method, correct?

> This worked like a charm. But I am missing some way to put color
> filtres on my images in a scenegraph. Currently I dont know how to
> "grey" out an image.
>

You can use the ColorAdjust effect and then vary its saturation
property (call setSaturation()) from 0 to -1.

Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
For additional commands, e-mail: dev-help@scenegraph.dev.java.net

oliverdb
Offline
Joined: 2005-02-10
Points: 0

Hey Chris

I cannot send you a screenshot just yet as its a Commercial project.I did try to set the glow level but it werent intense enough. This is ofcourse because I needed the pulsating glow as a way to draw attention.

I also noticed the ColorAdjust effect (after posting) but it messed up the image I was working on. It seemed like the completely white parts of the image became pitch black, with a pixel/block like threshold to the rest of the image. I tried different file-formats but it did not help.