Jump to content

Recommended Posts

Posted

This work is not mine, I copy paste what the dude (Maya on discord) wrote on the discord bug channel so his work attracts attention from ED.

"Hi, has anyone thought that the sunrises & sunsets in DCS are a bit too purple?

I'm a graphics programmer who's familiar with Eric Bruneton's (which is used in DCS) and Sebastien Hillaire's atmosphere models and I found a "bug" in their implementation which causes the sky to be too purple and developed a tool called ARPC which allows accurately calculating the atmosphere parameters.

Basically both Bruneton's and Hillaire's models pick 3 primary wavelengths for red, green and blue to determine Rayleigh scattering and Ozone absorption coefficients, but this method simply doesn't have enough precision to take especially the Ozone absorption spectrum into account. ARPC on the other hand uses CIE 1931 XYZ color matching functions to take a weighted average of the coefficients for all wavelengths when calculating the coefficients for red, green and blue. This approach gets much closer the spectrally rendered path-traced reference, which has more blue-tinted sunrises / sunsets. It also calculates a few other parameters such as the scale height and ozone distribution more accurately, by using ISA instead of the constant temperature atmosphere used in Bruneton's and Hillaire's models.

If anyone's from ED is interested, I can provide more technical details regarding how ARPC works. It's already open source (MIT licensed, so can be integrated to any commercial project without any royalties) and available on GitHub: https://github.com/FarukEroglu2048/ARPC 

Here's a quick comparison with the ARPC coefficients, I changed the coefficients in the shader code for it:

Default Coefficients:

Screen_231002_171357.png

ARPC Coefficients:

Screen_231002_170957.png

Here's another comparison using a ShaderToy implementation of Hillaire's atmosphere model:

Hillaire's Original Coefficients:

b96e330ec0aeebb559198296614f6e3f16078a48.png

ARPC Coefficients:

d434d01707f13150e4d1381ccb919a4ae7190b23.png

To validate my approach with ARPC, I used a root finding algorithm which tried to find the scattering and absorption coefficients which minimized the error between the spectrally rendered reference and also converted a reference spectral light source and the transmitted light spectrum after it passes through the atmosphere into sRGB to solve for the coefficients. In both cases, the expected coefficients almost perfectly matched the coefficients calculated by my approach:

1fd46292678a41a9eb3e7f3fafe834b1f9737295.png

Under the spectrum calculations section, the first line is Rayleigh scattering coefficients and the next line is Ozone absorption coefficients for red, green and blue, calculated using ARPC. And below them, the array shown by “x” contains the Rayleigh scattering and Ozone absorption coefficients that match the spectrally rendered reference the best, found by the root finding algorithm. You can see that they are in great agreement with the ARPC coefficients. Even without more rigorous tests like that, the results with the ARPC coefficients are visually very close to the spectrally rendered path-traced reference."

  • Like 8
  • Thanks 6
Posted

Finally.  This amazing work and hopefully ED sees this and implements it or changes it.  The sky is waaay too purple in the SIM. 

  • Like 1

My PC: GPU-AMD 6800XT OC / CPU- AMD RYZEN 5800X OC / 32 GB RAM 3200Mhz / 1TB SSD / 2TB HDD / 500GB M.2 / Monitor: 34" Ultrawide Samsung 1000R Curve / WinWing F16EX HOTAS / TM Cougar MFDs / TM TPR Rudder Pedals / TrackIR5 / ICP

  • 2 years later...
Posted (edited)

Wow, such a small tweak but a huge visual change! Unfortunately, it's throwing an IC check fail 😕

@BIGNEWY Its just a change in one line and the team has been checking that for 2 years already.

Quote

Firstly go to DCS root folder and find Bazar/Shaders/enlight/atmDefinitions.hlsl Create a backup of it at somewhere safe, such as your desktop Open it with a text editor and find the line that says atmosphere.absorption_extinction = gAtmBetaAExt; Replace it with atmosphere.absorption_extinction = float3(2.29e-3, 1.54e-3, 0.0); and save the file

Can we have this finally implemented? 

Edit: A drawback is that many new shader files are being generated when starting new maps for the first time. Not sure if ED can optimize that.

Blueish sky is with the tweaked value:

Screen_251217_155235.jpg

Screen_251217_161020.jpg

Screen_251217_155302.jpg

Screen_251217_161030.jpg

Screen_251217_152722.jpg

Screen_251217_155843.jpg

Edited by Bazz_Mulder
  • Like 5
  • Thanks 3

Kowalsky

- "Fox 3" simply means that you have commitment issues

Posted
On 12/17/2025 at 4:21 PM, Bazz_Mulder said:

Wow, such a small tweak but a huge visual change! Unfortunately, it's throwing an IC check fail 😕

@BIGNEWY Its just a change in one line and the team has been checking that for 2 years already.

Can we have this finally implemented? 

 

I wanted to try it out but unfortunately my DCS just hangs when loading a mission in the ME when using the modified atmDefinitions.hlsl file.
Nevada map. Specs in my signature.

Br,

Mud

Spoiler

W10 Enterprise LTSC | B650E Gigabyte Aorus Master | AMD Ryzen 7 7800X3D | Noctua NH-D15

G.Skill Trident ZS Neo DDR5-6000 64Gb | MSI RTX 5080 Gaming Trio OC

Asus Xonar AE | VPforce Rhino + TM Hotas Warthog

MFG Crosswind pedals | Valve Index

 

Posted (edited)

Same on my end; a lot of new shader files are compiled when starting each map which takes some time. You can see that in the growing file's number in the saved "FXO" folder. Not sure if ED can optimize that.

Edited by Bazz_Mulder

Kowalsky

- "Fox 3" simply means that you have commitment issues

Posted
15 hours ago, Bazz_Mulder said:

a lot of new shader files are compiled when starting each map which takes some time. You can see that in the growing file's number in the saved "FXO" folder. Not sure if ED can optimize that.

This is normal. If something in rendering code changes the shader files have to be compiled again.

🖥️ Win10  i7-10700KF  32GB  RTX4070S   🥽 Quest 3   🕹️ T16000M  VPC CDT-VMAX  TFRP   ✈️ FC3  MiG-29A  F-14A/B  F-15E  C-130J   ⚙️ CA   🚢 SC   🌐 NTTR  PG  Syria

Posted
On 12/18/2025 at 7:25 PM, Bazz_Mulder said:

Same on my end; a lot of new shader files are compiled when starting each map which takes some time. You can see that in the growing file's number in the saved "FXO" folder. Not sure if ED can optimize that.

Yeah indeed. I gave it another shot with a solid dose of patience and eventually the map loaded fine. I ended up with around twice as much shader files (511) in the fxo folder.
Does anyone know if this modification also impacts performance once in the pit?

Cheers,

Mud

Spoiler

W10 Enterprise LTSC | B650E Gigabyte Aorus Master | AMD Ryzen 7 7800X3D | Noctua NH-D15

G.Skill Trident ZS Neo DDR5-6000 64Gb | MSI RTX 5080 Gaming Trio OC

Asus Xonar AE | VPforce Rhino + TM Hotas Warthog

MFG Crosswind pedals | Valve Index

 

Posted (edited)
2 hours ago, Mud said:

Yeah indeed. I gave it another shot with a solid dose of patience and eventually the map loaded fine. I ended up with around twice as much shader files (511) in the fxo folder.
Does anyone know if this modification also impacts performance once in the pit?

Cheers,

Mud

I was unable to see any performance drop.

Edited by Bazz_Mulder
  • Like 1

Kowalsky

- "Fox 3" simply means that you have commitment issues

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...