I have troubles understanding how fog works in JMonkeyEngine.
In the previous technologies i used, i had to define the color and distance of fog:
- if it was configured to 100 meters, objects at 10 meters were almost untouched.
- at 50 meters they were half fog color and half normal color.
- at 90 meters they were almost fog colored.
- at 100 and further, they were invisible because at full fog color.
In some technologies, i had possibility to also define a start distance (fog color start at start distance instead of 0) or also the final density (if 0.5 for instance, objects at 100 and further were just half fog color, half normal color).
In JME, there is a distance and a density as parameter of a fog filter. But when i tried several values, nothing looks like what i would expect:
- With density of 1.0 and distance of 100, it look like i look at my game behind a (dirty) windows: everything is affected equally by fog color, like 50%, distance almost don’t play a role.
- with density of 0.5 and distance of 1000, there is a slight fog around.
Is there something i didn’t understand or something i did wrong ?
Here is the code i use:
fpp = new FilterPostProcessor(assetManager); fog = new FogFilter(new ColorRGBA(0.9f, 0.9f, 0.9f, 1.0f), 1.0f, 100f); fpp.addFilter(fog);
Thanks in advance,