Volumetric Fog modding help - devs please help

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
User avatar
Shuulo
Posts: 1629
Joined: Mon, 14. Apr 08, 17:03
x4

Volumetric Fog modding help - devs please help

Post by Shuulo » Sat, 8. Jan 22, 20:24

Hi all, I'm currently trying to wrap my head around volumetric fog thing and plan to use it mostly in generator to create random fog for certain sectors.
It turns to be out quite tricky as there is no explanation for how things in volumetricfog node interact, even XSD is quite empty with notes like "Defaults to 0" or "TODO:@Markus/Timon document".
If there are some rules for how those parameters should be set up to make the fog more or less fine and not kill your CPU that would help, so if someone has any insight on how these things interact please share, your input will be really appreciated.
This is an example of the node:

Code: Select all

<volumetricfog multiplier="2.0" medium="fog_grey" texture="assets/textures/environments/fog_patterncloud_07" lodrule="nebula" size="160000" sizevariation="0.75" densityfactor="0.0025" rotation="0" rotationvariation="0.5" noisescale="50000" seed="666" minnoisevalue="0.8" maxnoisevalue="1.0" distancefactor="0.8"/>
and another one with quite different parameters

Code: Select all

<volumetricfog multiplier="0.205" medium="fog_burgundy" texture="assets/textures/environments/volumefog/vf_structured_01_diff" lodrule="nebulafar" size="28000" sizevariation="1.95" densityfactor="0.035150" rotation="0" rotationvariation="0.50" noisescale="50000" seed="666" minnoisevalue="0.40" maxnoisevalue="1.0" distancefactor="0.60"/>
I find it very sensitive on how those parameters interact and I failed to grasp how some of them interact, mostly I need the help with:
multiplier - does it multiply fog based on densityfactor?
medium - how does it impact the performance
texture - how does it interact with medium?
size and sizevariation - what it is and how to make sense of it?
densityfactor - is it just the density of the fog? how it interacts with multiplier? setting it high usually kills CPU, but low values are barely noticeable
distancefactor - what does it really impact?

If there is some correlation between numbers e.g. multiplier and densityfactor or size , that I can use in the generator script that would help immensely.
Thank you for your time!

Dr Reed
Posts: 76
Joined: Fri, 30. Nov 18, 00:05
x4

Re: Volumetric Fog modding help - devs please help

Post by Dr Reed » Mon, 10. Jan 22, 17:54

I've been messing around with volumetric fog a fair bit the past while expanding my sector mod some more and might be able to answer some of your queries.


Multiplier is how strong the fog effect is.

Medium is the entry from the medium_library.xml. this file defines the colours of the fog and how light reacts with it. You can easily make new entries to make new colours of fog.

Texture is the structure that the fog takes and is determined by the defined texture.

Size and size variation is how big each blob of gas is and the variation of sizes. This can be a real fps killer.

Density factor seems to work the same as asteroid density factor. So if the density is high and the size of the gas pocket is high, you get too much overlap and everything gets a bit framey.

Distance factor, not too sure. I think it's a lod thing. I have not really messed around with it.


I could be wrong on some of it but that's my understanding on how it works.
Hope this helps.

Realspace
Posts: 1371
Joined: Wed, 15. Nov 06, 10:21
x4

Re: Volumetric Fog modding help - devs please help

Post by Realspace » Sat, 12. Mar 22, 12:04

I've just started messing with fog values too. Not for fps only, but because I feel those clouds in the middle of space are totally immersion-breaking.
What I want to accomplish is not to remove them, that's easy, but to make them barely visible from the distance (not LOD but... transparency?), and fully visible when inside.
Any guess what parameter it is?
DENSITYFACTOR seems to accomplish it a bit, still they are too much intrusive from the distance

Post Reply

Return to “X4: Foundations - Scripts and Modding”