"ScatterFog" - Simple Sunset Fix

Discussion in 'Ideas and Suggestions' started by Occam's Razer, Mar 12, 2018.

  1. Occam's Razer

    Occam's Razer
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    1,048
    Hi, all.

    As I've made mention of before, BeamNG's current sky irks me. The sky looks pretty good around noon and at night, but at low sun angles, it just lacks something. Long after making the thread hyperlinked in the sentence with which this paragraph began, I noticed that my requested atmospheric scattering* was actually partly present in Torque's ScatterSky. Now, it's not a perfect implementation (it doesn't seem to have the rich range of colors that an actual sky, or most simulated skies, for that matter, have), but it's a solid enough foundation. The big problem is actually the fog.

    Fog is presently uniform: it's the same color, everywhere you look. Take this image:

    original.png

    Now, near as I can tell, Torque samples or simulates what colors the fog should be, and sets them universally. That is, I believe we're seeing an average of the colors of a sunset/sunrise**, instead of the full suite.

    So, my proposition: allow the fog to present a second color channel, specific to the sun angle. Interpolate that color with the regular fog in a radius around it. Adjust the sampling source for each fog, or even hand-pick appropriate colors during or nearing twilight. Slightly multiply the density of the fog within the radius, to simulate haze. Put that together, and you get this:

    proposed.png

    Still no museum piece, but it's a huge improvement. To work, the scattersky would be given a few extra exposed variables, including:
    • The daytime scatterFog color
    • The nighttime scatterFog color
    • The scalar for scatterFog vs standard Fog density
    • The radius (in degrees) to draw the scatterFog around the sun/moon
    Edit: I should probably clarify: the second image was a Photoshopped blend of two images, not a functional proof-of-concept.


    *A full atmospheric scattering solution wouldn't just be tougher to implement, but would also lose the user/content creator some much needed control. With the new proposition, the user could still choose their sky's/fog's colors.

    **A little further reading: https://www.livescience.com/34065-sunrise-sunset.html
     
    #1 Occam's Razer, Mar 12, 2018
    Last edited: Mar 12, 2018
    • Like Like x 5
  2. Brother_Dave

    Brother_Dave
    Expand Collapse

    Joined:
    Aug 16, 2012
    Messages:
    1,511
    Ive been playing around with the sky settings to achieve the same thing, not there yet but one thing i always change is the Sun size, it gets so tiny at noon and sunset.
     
  3. Dr. Death

    Dr. Death
    Expand Collapse

    Joined:
    May 12, 2016
    Messages:
    1,919
    It looks better but i think the obvious issue with the game's twilight setting is that it looks like a bright light in a night sky. IRL twilights have late day sky in one side and early night black with visible stars on the other side. The area all around the sun should be almost day-sky. I think that's the main issue.
     
  4. LuisAntonRebollo

    LuisAntonRebollo
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Feb 25, 2014
    Messages:
    114
    Thx, i will check it :)

    Is in my ToDo list.
     
    • Like Like x 2
  5. Brother_Dave

    Brother_Dave
    Expand Collapse

    Joined:
    Aug 16, 2012
    Messages:
    1,511
    This is what i managed while playing around with the sky and tod settings tonight. Atleast it gives a steady orange glow over it all. MIND you though that its with my reshade on, enhances the colors so its a bit more pale with it off. Can be increased with the reighleieighsomethingscattering for the sky if one dont use reshade.
     

    Attached Files:

    • screenshot_00071.png
    • screenshot_00072.png
    • screenshot_00073.png
    • screenshot_00074.png
    • screenshot_00075.png
    • screenshot_00076.png
    • screenshot_00077.png
  6. Occam's Razer

    Occam's Razer
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    1,048
    Yeah, I've noticed this, too. I'm thinking the sun should be smaller than it is now at the zenith, but not really change size overall, just intensity. One idea I had was to give the sun a sprite, not unlike the one the moon has now, and just layer the sunflare over it. It would make the sun a tiny bit better-defined at noon and much better at sunset/sunrise.

    I had a lot of little ideas about improving this stuff, like adjusting the sun's path to match the intended season/latitude, or adjusting how the fog gets denser with depth. However, I had meant my post to pretty much just sum up a relatively quick and easy solution, so I kept the post brief. Too ambitious, and the devs wouldn't have time to work on it. But, y'know, baby steps.

    That is part of it, yeah. I'm not really sure how the atmospheric scattering shader works on the sky, but it doesn't seem to be taking the sun's position into account, just its elevation. Another little issue is illustrated in Brother_Dave's second-to-last image. The sun's effect on the sky ends when the sun hits the horizon, which is to say, there's no twilight: https://en.wikipedia.org/wiki/Twilight

    That actually looks pretty good, all things considered. Colors seem pretty well spot-on. Shame the UI is getting the same treatment ;)
     
    • Agree Agree x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice