[SOLVED] How to add GlowColor in j3m file?

I’m a little confused on how to add glow in j3m file. The last chapter in Bloom and Glow doc (Bloom and Glow :: jMonkeyEngine Docs) seems related with home brewed material definition, not default material file. However simply adding GlowColor doesn’t work for me:

Material SensorLight : Common/MatDefs/Light/Lighting.j3md {
    MaterialParameters : {
        UseMaterialColors : true
        Ambient : 0.0 0.9 0.0 1.0
        Diffuse : 0.0 0.9 0.0 1.0
        GlowColor: 0.0 0.9 0.0 1.0
    }
}

No Green glow color observed.

Just clarify that I have following filter added and it does work if I put GlowColor in Material programtically.

		FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
		BloomFilter objectBloom = new BloomFilter(BloomFilter.GlowMode.Objects);
		fpp.addFilter(objectBloom);
		viewPort.addProcessor(fpp);

Thanks!

Did you use the SDK to generate your material?

This part is coded incorrectly.

MaterialParameters : {
...
}

The parameters of a material are defined as follows:

Material MyMaterial : Common/MatDefs/Light/Lighting.j3md {
     MaterialParameters {
         // your parameters
     }
}

No, I don’t use SDK. I use IntelliJ in development and edit j3m file in plain text.

Yes, you’re right. There should be no colon after MaterialParameters. Although having it seems work as well.

So back to my original question. No, it doesn’t fix my problem.

1 Like

I don’t know how you’re loading it, because if it works…

[ Screenshots ]



[ Material ]

Material SensorLight : Common/MatDefs/Light/Lighting.j3md {
     MaterialParameters {
		UseMaterialColors : true
        Ambient : 0.937 0.224 0.779 1.0
        Diffuse : 0.937 0.224 0.779 1.0
        GlowColor: 0.224 0.412 0.937 1.0
     }
}

[ Java - JME3]

final Material groundMaterial = assetManager.loadMaterial("MatDefs/SensorLight.j3m");
geometry.setMaterial(groundMaterial);

@SwiftWolf Thanks for the demo :+1:. Now I found where the problem was. A piece of code somewhere else clears the GlowColor incorrectly.

How may I mark the issue solved, just modify the topic title?

3 Likes

Yes, click on the pencil icon to the right of to the topic title.