[SOLVED] Making 1 Object Glow Problem

Hi guys,

Im having problems with a simple problem involving glow. I cant figure it out and it keeps bothering me. I cant seem to make 1 object glow. If I use the glow tutorial it makes everything glow and just the object of my choice. Can anyone help me out and tell me how I can make 1 object of my choice glow?

I used this:
FilterPostProcessor fpp=new FilterPostProcessor(assetManager);
BloomFilter bloom=new BloomFilter();
fpp.addFilter(bloom);
viewPort.addProcessor(fpp);

But this doesn’t specify which object I want glowing. Please help.

http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:bloom_and_glow?s[]=glow

Thank you for sending me something I’ve read 100 times. I specifically said that I already read this in the tutorial and that I don’t understand how to make ONE object of my choice glow. If I follow this it make all of the object glow.

Then show us that code. Because the code you showed would make everything glow and is completely different than the last part of that tutorial that shows how to make one object glow.

We can’t read minds… only code. So when you show me an example from the wrong part of a tutorial then I wonder if we are even talking about the same tutorial.

Notice how this does not at all resemble the code you posted:

1 Like

public void simpleInitApp() {
Box boxMesh = new Box(1,1,1);
Geometry boxGeo = new Geometry(“Colored Box”, boxMesh);
Material boxMat = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
boxMat.setColor(“Color”, ColorRGBA.Red);
boxGeo.setMaterial(boxMat);
rootNode.attachChild(boxGeo);

    /** A translucent/transparent texture */
    Box cube2Mesh = new Box( 2,2,2);
    Geometry cube2Geo = new Geometry("see-through box", cube2Mesh);
    Material cube2Mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    ColorRGBA color = ColorRGBA.Blue.clone();
    color.a = 0.1f;
    cube2Mat.setColor("Color", color);
    cube2Mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
    cube2Geo.setQueueBucket(Bucket.Transparent);
    cube2Geo.setMaterial(cube2Mat);
    rootNode.attachChild(cube2Geo);

So… where do you set the glow color?

Where do you set the bloom filter to object mode?

These were all parts of the tutorial you read 100 times.

My bad sent you the wrong code.

public void simpleInitApp() {
Box boxMesh = new Box(1,1,1);
Geometry boxGeo = new Geometry(“Colored Box”, boxMesh);
Material boxMat = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
FilterPostProcessor fpp=new FilterPostProcessor(assetManager);
BloomFilter bloom=new BloomFilter();
fpp.addFilter(bloom);
viewPort.addProcessor(fpp);
boxMat.setColor(“Color”, ColorRGBA.Red);
boxGeo.setMaterial(boxMat);
rootNode.attachChild(boxGeo);

    /** A translucent/transparent texture */
    Box cube2Mesh = new Box( 2,2,2);
    Geometry cube2Geo = new Geometry("see-through box", cube2Mesh);
    Material cube2Mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    ColorRGBA color = ColorRGBA.Blue.clone();
    color.a = 0.1f;
    cube2Mat.setColor("Color", color);
    cube2Mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
    cube2Geo.setQueueBucket(Bucket.Transparent);
    cube2Geo.setMaterial(cube2Mat);
    rootNode.attachChild(cube2Geo);

I want it just to affect the red cube but it affects the blue ones too.

From Paul’s Image: new BloomFilter(GlowMode.Objects); is missing in your code

Yeah I put that in it didnt make a difference. Any idea on how to select a specific object for glow? Like to make only boxMat glow?

At least in one point the tutorial is broken (and Paul’s image too):
There is no “SolidColor.j3md” anymore.
A couple of days ago I found that there are still some implementations on the web.
Does “Unshaded.j3md” replace “SolidColor.j3md” ? And if so, should we change the Wiki ? A test would be needed to confirm, that things still work as intended.

Edit: Here I read, that ColoredTextured.j3md was a predecessor of Unshaded.j3md: jmonkeyengine/ColoredTextured.j3md at master · jMonkeyEngine/jmonkeyengine · GitHub

You still haven’t read the tutorial, or the replies.

It clearly says “mat.setColor(“GlowColor”, ColorRGBA.Green);”
I copy pasted this line into your code and voila

DAFAQ!!! I did that thing like 10 times and it didnt work it wasnt glowing and now it seems to work…
I literally had
boxMat.setColor(“Color”, ColorRGBA.Red);
boxMat.setColor(“GlowColor”, ColorRGBA.Red);

and then I started messing around trying different ways to do it…
Sorry guys its either Im stupid or my JMonkey was bugged for a while cos im pretty sure for some random reason it was making all of my objects glow even though I had only assigned the glow to one material.

Apologies guys it seems to work properly now guys I thought I was doing something wrong but it appears my computer was funky. Sorry again.

Marked as [SOLVED].

Ohh I learned something new. Didn’t know anything about that glow feature.