Page 2 of 3

Re: Fog Visibility Range

Posted: Fri Dec 16, 2011 9:42 pm
by Zax
The RTS side of the game demands fog of war, which is achieved through distance fog and radar range.

Re: Fog Visibility Range

Posted: Tue Jun 26, 2012 2:50 pm
by jaydenbz2
You can also set the fogrange and visibilityrange to negative values, one of slaors posts said that if you do say fogrange -250 800, that gives a good gloomy feel to the map as the fog is denser, the visibilityrange should always be above the fogrange or ugliness will occur.

Re: Fog Visibility Range

Posted: Tue Jun 26, 2012 4:23 pm
by Zero Angel
Negative fogrange would work better if the fogbreak command was fixed (fogbreak originally controlled how gradually the fog levels ramped up from the start of the fog range to the end of the fog range instead of in the linear way it does now)

Re: Fog Visibility Range

Posted: Tue Jun 26, 2012 4:29 pm
by Nielk1
One main issue was no one could effectively describe WTF fog break did. Does it ramp from 0 to 50 at the break and 50 to 100 after? Or does it work some other way?

Re: Fog Visibility Range

Posted: Tue Jun 26, 2012 4:36 pm
by GSH
I've got (effectively) a code branch at 1.3pb4a sitting on my HD at home. I can quickly load it up, search that code, and see how things worked. However, the old graphics code is so confusing, it takes a while to figure out. The programmer who did it sometimes seems to abide by the philosophy of "if it was hard to write this code, it should be hard to read, too."

-- GSH

Re: Fog Visibility Range

Posted: Tue Jun 26, 2012 4:40 pm
by APCs r Evil
jaydenbz2 wrote:one of slaors posts said that if you do say fogrange -250 800, that gives a good gloomy feel to the map as the fog is denser
:shock: Brilliant!

Re: Fog Visibility Range

Posted: Tue Jun 26, 2012 4:49 pm
by MrTwosheds
In pb6 onwards I find it best to always set the max fogrange and the visibility distance to the same value, seems to be the best way to blend the terrain and sky with fog.

I have also used alpha channel faded skydomes to reduce sudden looming by terrain coming into the visibility range, good for foggy maps, not much good for those who like horizons.

Re: Fog Visibility Range

Posted: Tue Jun 26, 2012 4:50 pm
by Red Devil
i started doing that after Slaor posted about that; works great ::thumbsup::

Re: Fog Visibility Range

Posted: Tue Jun 26, 2012 5:11 pm
by Zero Angel
The way I understood fogbreak is that it acted somewhat like the 'curves' control on photoshop -- and made adjustments to the fog density based on distance let's assume that if the fogbreak is set at 0.5 so that fog values ramped up in a linear fashion from the start of the fogrange to the end of the fogrange. And the fog range was set from 100 to 500.

Code: Select all

Distance     100m 200m 300m 400m 500m
Fog Density  0%   25%  50%  75%  100%
Using a fogbreak of, say 0.35 would change the fog values to something like this

Code: Select all

Distance     100m 200m 300m 400m 500m
Fog Density  0%   12%  35%  60%  100%
Allowing the fog to ramp up more gradually.

I don't know exactly whether fogbreak moved the midpoint of the fog or whether it affected some kind of algorithm that affected the 'curve' of the fog density but it did allow mapmakers to create interesting looking effects using fog (like having a very subtle pervading fog on the map which then faded out more suddenly near the end of the range) or to simply create a nicer transition towards the end of the visibility range.

Re: Fog Visibility Range

Posted: Wed Jun 27, 2012 5:01 am
by jaydenbz2
@Red DEvil, me too, it was such a good idea.
And we REALLY should have some kind of fix if possible, to allow the fogbreak thing, maps could be so much nicer with it I think, instead of the sometimes ugly default fogbreak.

Re: Fog Visibility Range

Posted: Wed Jun 27, 2012 5:09 am
by Nielk1
Would be nice if we could make terrain fade in from 0 alpha instead of just BOOM there at visual range too.

Re: Fog Visibility Range

Posted: Wed Jun 27, 2012 6:19 am
by MrTwosheds
Have discussed that, fading terrain is a very process intensive way to go, fading the sky is much more efficient. Maybe there is another process cheap solution we haven't thought of.

Re: Fog Visibility Range

Posted: Wed Jun 27, 2012 7:09 am
by jaydenbz2
There is a sky.renderbeforeterrain feature in the console, this can be nice with some maps and it closely follows what 1.2 done.

Re: Fog Visibility Range

Posted: Wed Jun 27, 2012 2:09 pm
by Nielk1
jaydenbz2 wrote:There is a sky.renderbeforeterrain feature in the console, this can be nice with some maps and it closely follows what 1.2 done.
This was added with the comment it probably wouldst do what we think, and really it doesn't. It looks quite ugly most of the time and would only work in a very select few situations.

Re: Fog Visibility Range

Posted: Wed Jun 27, 2012 4:52 pm
by Zero Angel
sky.renderbeforeterrain sort of allows terrain to fade out similar to pre-1.3 but it's glitchy and not practical for normal usage.