Feature Request - Tweakable Fog Distance/Density

Talk about the mods you'd like to see in Daggerfall Unity. Give mod creators some ideas!
Post Reply
Arcadian
Posts: 1
Joined: Wed Jun 29, 2022 10:44 pm

Feature Request - Tweakable Fog Distance/Density

Post by Arcadian »

Hello there! I've run into a bit of a snag recently, in that I've been seeing a lot of foggy weather in-game and while I do like it conceptually, I'm also beginning to feel as though the return to near-classic or Eye of Argonia levels of visibility a bit claustrophobic and limiting, especially when one is running enhanced visibility mods.

I'm no coder at all, so I can't speak from a position of knowledge here, but I do believe that a variable fog distance/density setting would go a long way in helping people to get more out of the weather system, especially when I've experienced becoming totally lost in cities or falling to my death thanks to some terrain mods!

User avatar
BadLuckBurt
Posts: 887
Joined: Sun Nov 05, 2017 8:30 pm

Re: Feature Request - Tweakable Fog Distance/Density

Post by BadLuckBurt »

Hi and welcome to the forums :)

I wouldn't mind making a mod for this as changing the fog settings through a mod is pretty easy, I've done it before for my classic view distance / fog mod.

Unity offers 3 types of fog: Linear, Exponential and Exponential Squared. Exponential is used by DFU normally.
Linear
- This uses linear interpolation to evenly thicken the fog along the distance from the Camera. This is the only option that allows the user to control the start and end distances, though fog density is controlled by the distance from the Camera. Negative Start values can be used to have the fog start behind the Camera, useful for making especially thick fog.
Exponential
- This gives a softer transition into the fog, but the fog begins sooner. Unlike Linear, density is user controllable.
Exponential Squared
- This gives less fog in the area immediately around the Camera, but the transition to full fog begins sooner than with Exponential, and is sharper. Density is user controllable.
The mod would let you choose which fog type you want to use and also allow you to tweak the settings for each of the 6 weathers per fog type (tweak here means you punch in a number :D, the mod setting sliders aren't accurate enough to accommodate these values). Then using the console command

Code: Select all

set_weather X
where X is a number from 1 to 6 you can test the settings in-game fairly quick.
Daggerfall Unity on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
Daggerfall Unity on Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

User avatar
Hazelnut
Posts: 2970
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Feature Request - Tweakable Fog Distance/Density

Post by Hazelnut »

BadLuckBurt wrote: Thu Jun 30, 2022 2:53 pm I wouldn't mind making a mod for this as changing the fog settings through a mod is pretty easy, I've done it before for my classic view distance / fog mod.
Sounds good Burt. Maybe enhance that mod so it has settings to configure view distance and weather effects as well?
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
BadLuckBurt
Posts: 887
Joined: Sun Nov 05, 2017 8:30 pm

Re: Feature Request - Tweakable Fog Distance/Density

Post by BadLuckBurt »

Hazelnut wrote: Fri Jul 01, 2022 11:57 am Sounds good Burt. Maybe enhance that mod so it has settings to configure view distance and weather effects as well?
I can expose the particle system settings for rain and snow, I assume that's what you mean by weather effects.

Buuuut, view distance is trickier:

With normal DFU, view distance is mostly determined by the camera settings + terrain view distance combined with the exponential fog density. I know they have a correlation but I've never figured out a reliable calculation to make them cooperate with each other. I experimented with that a bit when I made the fog interact with the skybox but ended up just passing a static distance in meters to the skybox shader with the distance depending on the weather type. I use linear fog in my own DFU because I can set an explicit start and end distance which makes it much easier to control.

The camera's far clip plane is set to 2600 meters by default. With a terrain view distance of 4, you have 3200 meters of terrain around you in all directions so with Sunny weather there's only about 600 meters that you won't be able to see.

The terrain view distance is hard capped at 4 because of [Range] declaration for the property so you can't even force it to go above with a mod. Since I build my own DFU I just changed the Range limit to 6 which results in 4800 meters of terrain in all directions. I cranked up my camera's far clip plane to 5600 meters to try and eliminate disappearing terrain / models on the edges of my screen.

It all runs well on my end but I don't use a whole lot of mods and certainly no hi-res texture replacers. I do use Real Grass and toned down the settings a fair bit to make it run smooth. I also have no idea how it would perform with Travel Options as I haven't really sat down and played in a while but I've seen little to no stuttering when running around the world at high speeds.

Cara has tried my build too and had no trouble running it but we're both a few levels above potato when it comes to PCs.

I've been meaning to bring this up after beta to ask if that Range cap could be removed (not in the settings perse but just to allow a mod to override the max view distance). I understand why it's there and I doubt that anyone who runs a large amount of graphical mods would have a smooth experience but having the option to do it would be nice.
Daggerfall Unity on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
Daggerfall Unity on Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

User avatar
Hazelnut
Posts: 2970
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Feature Request - Tweakable Fog Distance/Density

Post by Hazelnut »

I think it's limited to 4 because there's not that much benefit above that and since users can change it in settings it's protection against people cranking it up to max and then having a sub-par experience. TD = 4 is 81 map pixel terrain tiles, 5 would be 121 and 6 would be 169 so a lot more work for the PC to handle. Distant Terrain mod adds more but at a cut-down level of detail making it more lightweight to run. I think the mod needs some attention as Nystul has been busy/absent for a while now. I don't use it myself but have heard reports that it has issues with more recent DFU versions.

Taking over development of that mod may be a better route to getting terrain displayed above dist 4 maybe? just throwing it out there. :)
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
BadLuckBurt
Posts: 887
Joined: Sun Nov 05, 2017 8:30 pm

Re: Feature Request - Tweakable Fog Distance/Density

Post by BadLuckBurt »

Hazelnut wrote: Fri Jul 01, 2022 2:08 pm Taking over development of that mod may be a better route to getting terrain displayed above dist 4 maybe? just throwing it out there. :)
Not in my opinion, I'm perfectly content with my altered build, I just thought I 'd ask so others could have the same experience. And I'm not going to pretend that I understand how the Distant Terrain mod works :lol: but I do know it's incompatible with my terrain sampler because of my climate usage.
Daggerfall Unity on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
Daggerfall Unity on Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

User avatar
Ralzar
Posts: 2163
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Feature Request - Tweakable Fog Distance/Density

Post by Ralzar »

BadLuckBurt wrote: Fri Jul 01, 2022 3:17 pm
Hazelnut wrote: Fri Jul 01, 2022 2:08 pm Taking over development of that mod may be a better route to getting terrain displayed above dist 4 maybe? just throwing it out there. :)
Not in my opinion, I'm perfectly content with my altered build, I just thought I 'd ask so others could have the same experience. And I'm not going to pretend that I understand how the Distant Terrain mod works :lol: but I do know it's incompatible with my terrain sampler because of my climate usage.
These days Distant Terrain seems to be incompatible with DFU itself. A lot of GOG Cut users have fixed their crash-during-load problems by disabling it.

User avatar
BadLuckBurt
Posts: 887
Joined: Sun Nov 05, 2017 8:30 pm

Re: Feature Request - Tweakable Fog Distance/Density

Post by BadLuckBurt »

Ralzar wrote: Fri Jul 01, 2022 8:15 pm These days Distant Terrain seems to be incompatible with DFU itself. A lot of GOG Cut users have fixed their crash-during-load problems by disabling it.
I think that's just the mod combinations / settings in the GOG Cut causing instability and if no-one provides any logs then you can't really conclude that it's incompatible either. I had 4FPS for the brief time I loaded into the GOG cut when I tested the uninstall process, with normal DFU I run in the 200FPS so yeah, somebody should maybe go through that and come up with some more optimal settings than Zakh did. His own setup is probably beefy enough to run it but if there are that many problems with it, he should consider doing a lite-version maybe or rethink the entire approach.

Out of curiosity, I downloaded the 0.14 preview build and loaded with only Distant Terrain, no issue whatsoever. The Improved Terrain stuff still works too, when it's off I do have seams even with that pixel error value set to 1 in the INI but that may be due to me using an oversampled screen resolution because it's not as visible as I've seen it be for others.

This is very off-topic for this thread so if you want to discuss it further just post in the DT thread and I'll reply there.

@OP: I'll probably have the mod ready sometime next week so stay tuned!
Daggerfall Unity on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
Daggerfall Unity on Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

Post Reply