Edit: newest version: https://gitlab.com/vrresto/openmw/tree/ ... er-cleanup
This comes probably a bit late with the port to OSG taking place now - anyway here it is.
Probably some of it can be used/ported.
This patch adds a more realistic looking fog shader where the fog density decreases with increasing altitude.
Some screenshots: Feel free to ask questions, but please not about the mathematical basis of the calculations - this was mostly guesswork + try & error.
Edit: add patch against 0.36.0 and patchless version
For this to look good you also need to set "distant land = true" and "viewing distance" to a high value (e.g. 500000 for 5km) in settings.cfg.
Extract this into your resources/materials folder - apparently the location of this can vary.
You also may need to empty your openmw cache directory (~/.cache/openmw on my system) for the changes to take effect.jirka642 wrote: On my Linux PC is correct folder located in /usr/share/games/openmw/resources/materials/ , but it can be at the same place as your openmw executable depending on how you installed openmw.
Since this version takes no density parameter from the engine you have to manually edit the parameters at the beginning of fog.h to change the density etc.