Particle effects disapear in front of fog

I have combined the fire effect tutorial with the fog sample and my fire looks good as long as nearby rocks are behind it. If the backdrop is the fog background color, the effects dissappear. I presume this is because the particles color mode is additive, and the fog sets the maximum value for the pixels, so the fire effect disappears as it is trying to add to the maximum. Somehow the code is not recognizing that the fire is in the foreground. Is this expected behavior and is there a way around this? I tried changing the color mode to alpha but that resulted in terrible blockiness and the fire still disappeared.

I also note that the transparency of the fog is inversely proportional to the lightness of the fog color - a black fog (e.g night) is nearly transparent, while a white daytime fog is opaque.

If you use a sky this should not happen.

I have already added the sky box from the fog tutorial and it didn’t help. I have fog density set to 2 - would that be too high?

A similar issuse happened to me when building the Cove… while using fog, the bubble particles could been seen when there was geometry behind them, but were not visible when the skybox was behind them… moving them into the translucent bucket got around the problem for me.

1 Like

Now you mention it, it’s obvious. I’ll try this solution tomorrow. Thanks.

Did you add the particles to the translucent bucket?

Also if you use post process filters you have to add a translucentBucketFilter at the end of your filter stack

1 Like

I added the particles to the translucent bucket and I added a translucent bucket filter to the post processing. The fire still disappears against the sky background. I tried various combinations of the options but no luck so far. I’ll keep trying though. My fog demons were going to be 90% particle, not so sure now :frowning:

On the subject of fog, is there a way in JME to do fog that doesn’t involve post-processing? Such as something that invoked the GL fog function?

:slight_smile: :slight_smile: :slight_smile:



I was confused between the Transparent bucket and the Translucent bucket. Using the translucent bucket, it all works. Also the fog looks better for some reason.



I do still have one quibble - the fog no longer fogs out my fire, if I zoom back a million miles (ok, several hundred meters), I can still see the fire. That’s probably a big problem, as my fog demons will always be visible, instead of emerging suddenly from the fog. I can fix that though - particles should only switch on when they are near the camera, and I can also manipulate the color of the particles to soften the sudden switch-on of the particles. I can even make the particle switch-on ‘make sense’ in game logic - the demons are waking up, getting angry.



Thanks everyone. By the way, JME has brilliant documentation - I should know, I’m a technical writer (and now you know why I am an obtuse programmer - Dilbert comes to mind).