Search Unity

[released] Overcloud - Volumetric Sky And Lighting

Discussion in 'Assets and Asset Store' started by Fewes, Mar 25, 2019.

  1. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    Did you try increasing the camera far clip plane?
     
  2. tirarex

    tirarex

    Joined:
    Feb 19, 2015
    Posts:
    8
    I am thinking of requesting a refund. Awful optimization.
    The demo with an empty world and an airplane goes fine, but any slightly loaded project becomes slow.
    My game runs at 60 fps in the Nvidia 2080 super loading by about 30%, but after turning on the sky, 80-99% with the same FPS.

    UniStorm (ver 4) take about 10-20% of gpu
     
  3. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    Please check the documentation for information on how to best tweak the asset to your performance needs. If you are still unhappy with how it runs, send me a PM and we'll discuss a refund. Did increasing the far clip plane fix the clouds not appearing?
     
  4. tirarex

    tirarex

    Joined:
    Feb 19, 2015
    Posts:
    8
    No.
    Standart SteamVR plugin, Unity 2018.4.8
    i5 8400 / 16gb ram / Nvidia rtx 2080 super

    i just grab Overcloud prefab from demo, add overcloud camera to camera entitiy of standart steamVR rig.
    Buying a package is 3 times more expensive than analogs, you expect that it will work at least normally (not perfect), right out of the box

    I sent you an email but you did not reply
     
  5. Realiz3D

    Realiz3D

    Joined:
    Jul 17, 2018
    Posts:
    2
    Hello,
    I bought your asset, and I wanted to tell you how awesome it was. One of the best solutions for generating skies and atmosphere.

    On the other hand, in my current project, I'm running into a bit of a problem. Not with your asset, but with the settings of my project. Is there a solution to inverse the sun path ?

    The project doesn't have the good orientation, I can't rotate it due to some constraint, and I was wondering, will there be in the future a way to turn the rotation of the sun, or is it not on your roadmap?

    In any case, really good job man, you did one hell of an asset!
    Looking forward to your help, and your future project.
    Best regard.
    Theo Barthelemy
     
    Last edited: Sep 25, 2019
  6. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    Hi there, and thanks. I'm a little unsure of what you mean. Do you mean the sun points in the exact opposite direction of what it should?
     
    Last edited: Nov 28, 2019
  7. Realiz3D

    Realiz3D

    Joined:
    Jul 17, 2018
    Posts:
    2
    Sorry, for the confusion, I mean with my coordinate, the sun goes from right side to left side. It's the real sun path, but because of my constraint, I would need to have it go left to right.

    I had the same issue with Usky, and I had to use their "Unrealistic" mode to change it manually.
    I don't know if there is an easy way to inverse it ?

    thanks for your quick reaction.
     
  8. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    454
    Still waiting on RAM 2019 integration? I asked in the nature manufacture discord but Bart said you would have to contact him if you wanted to integrate together the same way RAM 2019 is integrated with the latest Enviro. Alot of people are using Overcloud and RAM 2019 something to think about.
     
  9. wwg

    wwg

    Joined:
    Apr 2, 2014
    Posts:
    121
    Hi @Fewes ,
    I love OverCloud!

    1. How can I lower the horizon brightness?
    overcloud_brightness1.png
    2. I'd like to steadily increase the fog level as the player gets farther from the level center (0,0,0). How would you recommend I do that?
    3. I still think that star intensity should lower during the day and increase at night . I know it doesn't work that way in reality, but that is the end effect.
    4. Do you have any performance improvements planned for future releases?
    5. The sun intensity parameter doesn't seem to change anything.

    Thanks!
     
  10. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    I think your best bet is to control the sun position manually via a script of your own. If you uncheck "Enable" under "Time Of Day" on the main OverCloud component, you can control everything manually. OverCloud will still use your rotations when calculating all effects.

    Yes this is definitely on my end. It is coming!

    Hi, glad to hear!

    1. Your image appears very over-exposed. I would really recommend you use a tonemapping post-effect of some sort (Such As "Color Grading" in the post-processing stack V2). OverCloud comes with a very simple tonemap effect which you can add to your camera if you do not wish to use the full post-processing stack. (called Tonemap.cs)
    2. You can control the fog density manually from script using the beforeShaderParametersUpdate event:
    Code (CSharp):
    1. void Awake ()
    2. {
    3.     // Register event delegate
    4.     OverCloud.beforeShaderParametersUpdate += OverCloud_BeforeShaderParametersUpdate;
    5. }
    6.  
    7. void OverCloud_BeforeShaderParametersUpdate ()
    8. {
    9.     // Calculate this from distance to origin
    10.     float myFogValue;
    11.     // Manually override the fog value
    12.     OverCloud.current.m_CurrentPreset = myFogValue;
    13. }
    3. You can also controls this via script:
    Code (CSharp):
    1. void Awake ()
    2. {
    3.     // Register event delegate
    4.     OverCloud.beforeShaderParametersUpdate += OverCloud_BeforeShaderParametersUpdate;
    5. }
    6.  
    7. void OverCloud_BeforeShaderParametersUpdate ()
    8. {
    9.     // Change this according to the time of day, or the position of the sun etc.
    10.     float myStarsIntensity;
    11.  
    12.     // Manually override the stars intensity
    13.     OverCloud.atmosphere.starsIntensity = myStarsIntensity;
    14. }
    4. Not really. I've been thinking about swapping the fog from analytic to ray-marched (without 3D noise), but this has a lot of knock-on effects so I'm not sure. The perf gain of this might also not be that great.
    5. The sun intensity parameter does not change the intensity of the directional light (this is controlled by the light itself), but rather changes the appearance of the sun in the sky. If it does not however, that is a bug I'll have to take a look at.
     
  11. wwg

    wwg

    Joined:
    Apr 2, 2014
    Posts:
    121
    @Fewes
    The Broken weather preset no longer works. When it is selected I get this error:
    IndexOutOfRangeException: Index was outside the bounds of the array.
    OC.WeatherPreset.Lerp (OC.WeatherPreset a, OC.WeatherPreset b, System.Single t) (at Assets/OverCloud/Scripts/OverCloud.cs:359)
    OC.OverCloud.UpdateWeather (UnityEngine.Camera camera) (at Assets/OverCloud/Scripts/OverCloud.cs:3904)
    OC.OverCloud.CameraUpdate (UnityEngine.Camera camera) (at Assets/OverCloud/Scripts/OverCloud.cs:3443)
    OC.OverCloudCamera.OnPreRender () (at Assets/OverCloud/Scripts/OverCloudCamera.cs:117)
    I've had this happen several times when using Overcloud, but I'm not sure what is causing it. I think it might happen when I accidentally rename one of the preset the same as an existing preset and the array gets messed up. I can fix it by removing and then re-adding Overcloud to the project, but then I lose all my presets. Any suggestions?

    Thanks!
     
  12. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    I suspect the preset has gotten corrupted somehow. Can you try deleting it from the preset list and re-adding one with the same parameters? That should fix it I think.
     
  13. KarlLakner

    KarlLakner

    Joined:
    Jan 30, 2019
    Posts:
    16
    Hey,

    First off: I am a super super satisfied customer, Overcloud is by far the best cloud/sky system I've worked with, and the results both run AND look spectacular :)

    Now:

    I have a problem with rendering cloud shadows and Lux, the water shader system. (Am posting here first, will post over in the Lux forums as well.)

    Overcloud renders fine, I've applied the compatibility tweaks, and the water renders the way it should, except it doesn't receive any shadows. I am not certain if this is a limitation of Lux and the transparent material/shader, or if there is a workaround? FWIW I don't actually need transparency on the water, if that helps. Have tweaked camera draw distance and shadows, and assets sitting on the waterplane are definitely receiving the shadows, so I know they're being rendered and reaching the area etc.

    Has anyone else here managed to solve this, or is it just a limitation of the Lux shaders?
     
    Fewes likes this.
  14. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    Hi Karl, glad you are happy with OverCloud!

    The shader on the compatibility page is not set up to receive cloud shadows, but this is a really simple addition.
    In LuxWater_Core.cginc, around line 940, just after the line
    Code (CSharp):
    1. UNITY_LIGHT_ATTENUATION(atten, i, worldPos);
    add the code
    Code (CSharp):
    1. atten *= CloudShadows(worldPos);
    Let me know if this works for you! If it does, I'll update the compatibility page.
     
    KarlLakner likes this.
  15. KarlLakner

    KarlLakner

    Joined:
    Jan 30, 2019
    Posts:
    16
    Well, the good news is the changes compile with no errors, and it happily rebuilds the shader, BUT it doesn't produce any shadows...

    Am trying something very hacky atm (a very crap workaround for demoing purposes), will let you know how it goes, but feel free to experiment, as shaders & materials are definitely not my area of expertise :)
     
  16. happyrobotstudio

    happyrobotstudio

    Joined:
    Apr 13, 2019
    Posts:
    14
    Hi,

    Justing having some trouble with URP and 2019.3 getting anything to show up in the demo,

    Done the standard upgrade materials, and re-imported shaders, but no luck,

    Any advice?
     
  17. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    Hi,
    OverCloud only supports the default rendering pipeline (so no HDRP, LWRP, URP or SRPs in general). If you feel you bought the asset in error, you can contact me for a refund.
     
  18. happyrobotstudio

    happyrobotstudio

    Joined:
    Apr 13, 2019
    Posts:
    14
    Ahh I see,

    Apologies! I had been trying to work out LWRP for a while, damn, your clouds look awesome in the vids.

    Ok, thanks
     
  19. wwg

    wwg

    Joined:
    Apr 2, 2014
    Posts:
    121
    @Fewes - After I posted this original message, I removed Overcoud from the scene and re-added it. Everything was fine for a while, then the error appeared again and the "Broken" preset stopped working. Deleting the preset array element and creating a new one (with a different name) doesn't fix the problem. I'm not sure what would be corrupting the preset, but it happens very frequently and is a real pain.
     
    Last edited: Oct 10, 2019
  20. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    That's definitely an issue then. Are you using the custom floats functionality or does it happen regardless?
     
  21. wwg

    wwg

    Joined:
    Apr 2, 2014
    Posts:
    121
    Not using custom floats...not sure I even understand that feature! :)

    Update: after I removed the corrupted preset and then restarted Unity, it seems to be working again.
     
    Fewes likes this.
  22. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    416
    Hey. What would be roughly the effort/price for an Overcloud HDRP port.)
     
  23. lizkin

    lizkin

    Joined:
    Jun 22, 2013
    Posts:
    11
    Hello @Fewes,

    I purchased the asset a few days ago. Overall I really like it, thank you for your good efforts.

    I have a minor issue.

    Whenever I move the camera to the exact cloud altitude, I see noise like in the attached screenshot. When I move 1 unit below or over, there is no problem as in the other screenshot.

    How can I solve this problem ?

    (I use AQUAS as water solution in case if it is related)
     

    Attached Files:

  24. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    Great to hear you got it working. I'll take a look at the floats system again for the next patch.

    I don't really have an estimate but it is not something I'm able to put on my plate at the moment, sorry.

    Hi,

    I'll try replicating this on my end, it looks like a shader is outputting an INF value. Does it happen if you turn the volumetric clouds off? (I don't mean that's a solution, but it might help me pinpoint the issue.) Thanks!
     
    Last edited: Oct 14, 2019
  25. lizkin

    lizkin

    Joined:
    Jun 22, 2013
    Posts:
    11
    Thanks for the response @Fewes.

    For pinpointing, I discovered that when I only insert Overcloud to a fresh scene (nothing but only a camera). Add OverCloudCamera to the camera and set the camera Y coordinate to the cloud altitude I obtain the noise.

    scr001.PNG scr002.PNG
     
  26. lizkin

    lizkin

    Joined:
    Jun 22, 2013
    Posts:
    11
    Can you reproduce the problem on your system ?
     
  27. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    Yes, thanks to your detailed info I was able to. The bug is caused by a precision issue with the fallback 2D clouds. I will upload the fix in a patch, but for now if you would like to implement it directly, go to OverCloud/Resources/Shaders/Atmosphere.shader. Find the shader pass labeled "// Pass 6: Volumetric cloud LOD plane" and in the fragment function (fixed4 frag (v2f i) : SV_Target), at the very top, add:
    Code (CSharp):
    1. float3 camera = _WorldCamera;
    2. if (abs(camera.y - _OC_CloudAltitude) < 1)
    3.     camera.y += 2;
    Then, replace any other instance of "_WorldCamera" inside the fragment function with "camera" and you should be good. Let me know if you try it and if it works!
     
    KarlLakner likes this.
  28. lizkin

    lizkin

    Joined:
    Jun 22, 2013
    Posts:
    11
    I tried and the noise disappear, thank you very much :)
     
    KarlLakner and Fewes like this.
  29. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    486
    This looks nice. Do the clouds cast shadows onto themselves and the terrain?
     
  30. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    They do, yes. Terrain shadows depend on the rendering path a little. In Deferred, you can use a replacement shader (included with the asset) which will give you shadows for as far as OverCloud can render. In Forward, they are injected into the screenspace mask, and as such are limited by your cascaded Shadow Distance. If you use custom shaders, you can use a global function to add cloud shadows anywhere.
     
  31. BATTLEKOT

    BATTLEKOT

    Joined:
    Oct 2, 2016
    Posts:
    85
    Any plans for HDRP/LWRP support???
    Just in next 1-2 year everyone will switch from standart render to LWRP or HDRP
     
    look001 and iddqd like this.
  32. zeusroyo

    zeusroyo

    Joined:
    May 20, 2019
    Posts:
    2
    http://overcloud.me/compatibility.html : Last line
     
  33. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,289

    I'm trying overcloud in my Mac ( radeon vii ) Unity 2018.4.11f1 on metal renderer
    and will try also on iPad Pro 10.5

    First when running the demo scene in the editor I get one error:

    Unsupported texture format - needs to be ARGB32, RGBA32, BGRA32, RGB24, R8, Alpha8, RGBAFloat, RGBAHalf or one of supported compressed formats.
    UnityEngine.Texture2D:GetPixelBilinear(Single, Single)
    OC.OverCloud:GetDensity2D(Vector3) (at Assets/OverCloud/Scripts/OverCloud.cs:4528)
    OC.OverCloud:GetDensity3D(Vector3, Single&) (at Assets/OverCloud/Scripts/OverCloud.cs:4575)
    OC.OverCloud:GetDensity(Vector3) (at Assets/OverCloud/Scripts/OverCloud.cs:4631)
    OC.OverCloudProbe:Update() (at Assets/OverCloud/Scripts/OverCloudProbe.cs:30)
     
    Last edited: Oct 27, 2019
  34. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    Hmm, strange. The error is thrown because the density fuction fails to sample the cloud noise texture. If you select the cloud noise texture (Volumetric Clouds > Noise Texture), what does it look like in the inspector? Can you try switching around the format/compression and see if that fixes it?
     
    Lars-Steenhoff likes this.
  35. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,289
    I got rid of the unity console error by setting the cloud textures to 32 bit RGBA.
    It now works inside the unity editor

    Now I made a build for iOS and tried to run on my iPhone 7 plus.

    The screen was black and I got the following errors:

    2019-10-28 14:47:48.472925+0100 clouds[2640:413037] Built from '2018.4/staging' branch, Version '2018.4.11f1 (7098af2f11ea)', Build type 'Release', Scripting Backend 'il2cpp'

    2019-10-28 14:47:48.484761+0100 clouds[2640:413037] -> registered mono modules 0x1058d9630

    -> applicationDidFinishLaunching()

    2019-10-28 14:47:49.578709+0100 clouds[2640:413037] [Warning] Trying to set delaysTouchesBegan to NO on a system gate gesture recognizer - this is unsupported and will have undesired side effects

    -> applicationDidBecomeActive()

    GfxDevice: creating device client; threaded=1

    Initializing Metal device caps: Apple A10 GPU

    Initialize engine version: 2018.4.11f1 (7098af2f11ea)

    2019-10-28 14:47:53.820490+0100 clouds[2640:413037] [Common] _BSMachError: port b203; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND"

    2019-10-28 14:47:53.824058+0100 clouds[2640:413037] Unbalanced calls to begin/end appearance transitions for <SplashScreenController: 0x10845bdc0>.

    UnloadTime: 5.483500 ms

    Compilation succeeded with:


    program_source:283:8: warning: variable 'u_xlati81' is used uninitialized whenever 'if' condition is false

    if((uint(u_xlati57))!=uint(0)){

    ^~~~~~~~~~~~~~~~~~~~~~~~~~

    program_source:308:26: note: uninitialized use occurs here

    u_xlati81 = int(uint(u_xlati81) & uint(u_xlati57));

    ^~~~~~~~~

    program_source:283:5: note: remove the 'if' if its condition is always true

    if((uint(u_xlati57))!=uint(0)){

    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    program_source:212:18: note: initialize the variable 'u_xlati81' to silence this warning

    int u_xlati81;

    ^

    = 0




    #include <metal_stdlib>

    #include <metal_texture>

    using namespace metal;

    #if !(__HAVE_FMA__)

    #define fma(a,b,c) ((a) * (b) + (c))

    #endif

    #ifndef XLT_REMAP_O

    #define XLT_REMAP_O {0, 1, 2, 3, 4, 5, 6, 7}

    #endif

    constexpr constant uint xlt_remap_o[] = XLT_REMAP_O;

    struct FGlobals_Type

    {

    float3 _WorldSpaceCameraPos;

    float4 _ProjectionParams;

    float4 _ZBufferParams;

    float3 _OverCloudOriginOffset;

    float _OC_EarthRadius;

    float _OC_AtmHeightInv;

    float3 _OC_EarthColor;

    float _OC_NightScattering;

    float4 _OC_MieScatteringParams;

    float _OC_FarClipInv;

    float3 _OC_LightDir;

    float3 _OC_LightColor;

    float4 _OC_FogParams;

    float _OC_FogBlend;

    float4 _OC_FogColor;

    float _OC_FogHeight;

    float2 _OC_FogFalloffParams;

    float _OC_AtmosphereExposure;

    float _OC_AtmosphereDensity;

    float _OC_AtmosphereFarClipFade;

    float3 _OC_ActualSunDir;

    float3 _OC_ActualMoonDir;

    float4 _OC_ActualSunColor;

    float4 _OC_ActualMoonColor;

    float _SkySunSize;

    float _SkyMoonSize;

    float _SkySunIntensity;

    float _SkyMoonIntensity;

    float _SkyStarsIntensity;

    float4 _SkySolarEclipse;

    float4 _SkyLunarEclipse;

    float _LunarEclipseLightingInfluence;

    float3 _ScattEarthCenter;

    float4 hlslcc_mtx4x4_WorldFromView[4];

    float4 hlslcc_mtx4x4_ViewFromScreen[4];

    int TRANSMITTANCE_TEXTURE_WIDTH;

    int TRANSMITTANCE_TEXTURE_HEIGHT;

    int SCATTERING_TEXTURE_R_SIZE;

    int SCATTERING_TEXTURE_MU_SIZE;

    int SCATTERING_TEXTURE_MU_S_SIZE;

    int SCATTERING_TEXTURE_NU_SIZE;

    float3 SKY_SPECTRAL_RADIANCE_TO_LUMINANCE;

    float bottom_radius;

    float top_radius;

    float mu_s_min;

    };

    struct Mtl_FragmentIn

    {

    float4 TEXCOORD0 [[ user(TEXCOORD0) ]] ;

    };

    struct Mtl_FragmentOut

    {

    half4 SV_Target0 [[ color(xlt_remap_o[0]) ]];

    };

    fragment Mtl_FragmentOut xlatMtlMain(

    constant FGlobals_Type& FGlobals [[ buffer(0) ]],

    sampler sampler_OC_ScatteringMask [[ sampler (0) ]],

    sampler sampler_SkyMoonCubemap [[ sampler (1) ]],

    sampler sampler_SkyStarsCubemap [[ sampler (2) ]],

    sampler samplertransmittance_texture [[ sampler (3) ]],

    sampler samplerscattering_texture [[ sampler (4) ]],

    sampler sampler_BackBuffer [[ sampler (5) ]],

    sampler sampler_CameraDepthTexture [[ sampler (6) ]],

    texture2d<float, access::sample > _CameraDepthTexture [[ texture(0) ]] ,

    texture2d<half, access::sample > transmittance_texture [[ texture(1) ]] ,

    texture3d<half, access::sample > scattering_texture [[ texture(2) ]] ,

    texture2d<half, access::sample > _OC_ScatteringMask [[ texture(3) ]] ,

    texturecube<half, access::sample > _SkyMoonCubemap [[ texture(4) ]] ,

    texturecube<half, access::sample > _SkyStarsCubemap [[ texture(5) ]] ,

    texture2d<half, access::sample > _BackBuffer [[ texture(6) ]] ,

    Mtl_FragmentIn input [[ stage_in ]])

    {

    Mtl_FragmentOut output;

    float3 u_xlat0;

    half3 u_xlat16_0;

    int u_xlati0;

    bool u_xlatb0;

    float4 u_xlat1;

    half3 u_xlat16_1;

    float u_xlat2;

    float4 u_xlat3;

    half4 u_xlat16_3;

    bool u_xlatb3;

    float4 u_xlat4;

    half3 u_xlat16_4;

    float4 u_xlat5;

    bool u_xlatb5;

    float4 u_xlat6;

    half3 u_xlat16_6;

    bool2 u_xlatb6;

    float3 u_xlat7;

    half3 u_xlat16_7;

    float4 u_xlat8;

    half3 u_xlat16_8;

    float4 u_xlat9;

    half3 u_xlat16_9;

    float2 u_xlat10;

    bool2 u_xlatb10;

    float3 u_xlat11;

    half3 u_xlat16_11;

    float4 u_xlat12;

    half4 u_xlat16_12;

    float4 u_xlat13;

    half3 u_xlat16_13;

    float4 u_xlat14;

    float4 u_xlat15;

    half3 u_xlat16_15;

    bool2 u_xlatb15;

    float3 u_xlat16;

    half3 u_xlat16_16;

    float4 u_xlat17;

    bool u_xlatb17;

    float4 u_xlat18;

    half3 u_xlat16_18;

    bool u_xlatb18;

    float4 u_xlat19;

    half4 u_xlat16_19;

    bool u_xlatb19;

    float4 u_xlat20;

    half3 u_xlat16_20;

    float3 u_xlat21;

    float4 u_xlat22;

    half3 u_xlat16_22;

    float4 u_xlat23;


    half3 u_xlat16_23;

    float4 u_xlat24;

    half3 u_xlat16_24;

    float4 u_xlat25;

    half3 u_xlat16_25;

    float3 u_xlat26;

    float u_xlat27;

    float3 u_xlat28;

    float u_xlat29;

    half u_xlat16_29;

    float3 u_xlat31;

    half3 u_xlat16_31;

    float3 u_xlat32;

    half3 u_xlat16_32;

    int u_xlati32;

    bool2 u_xlatb32;

    float u_xlat34;

    bool u_xlatb34;

    float2 u_xlat35;

    float u_xlat36;

    float u_xlat37;

    float u_xlat38;

    float u_xlat39;

    float u_xlat40;

    bool u_xlatb40;

    float3 u_xlat41;

    float2 u_xlat42;

    float u_xlat44;

    float u_xlat45;

    float u_xlat46;

    float3 u_xlat47;

    bool u_xlatb47;

    float3 u_xlat48;

    float u_xlat49;

    bool u_xlatb49;

    bool u_xlatb53;

    float u_xlat55;

    bool u_xlatb55;

    float u_xlat57;

    half u_xlat16_57;

    int u_xlati57;

    bool u_xlatb57;

    float2 u_xlat58;

    float u_xlat59;

    float2 u_xlat60;

    float2 u_xlat61;

    bool u_xlatb61;

    float2 u_xlat62;

    float u_xlat63;

    bool u_xlatb63;

    float u_xlat64;

    bool u_xlatb64;

    bool u_xlatb65;

    float2 u_xlat66;

    float u_xlat67;

    bool u_xlatb67;

    float2 u_xlat68;

    float2 u_xlat69;

    float u_xlat70;

    bool u_xlatb70;

    float u_xlat71;

    int u_xlati71;

    float2 u_xlat72;

    float u_xlat73;

    bool u_xlatb73;

    float2 u_xlat75;

    float u_xlat78;

    float u_xlat79;

    bool u_xlatb79;

    float u_xlat81;

    int u_xlati81;

    bool u_xlatb81;

    float u_xlat82;

    bool u_xlatb82;

    float u_xlat83;

    int u_xlati83;

    bool u_xlatb83;

    float u_xlat84;

    int u_xlati84;

    bool u_xlatb84;

    float u_xlat85;

    bool u_xlatb85;

    float u_xlat86;

    bool u_xlatb86;

    float u_xlat87;

    bool u_xlatb87;

    float u_xlat89;

    float u_xlat90;

    float u_xlat91;

    bool u_xlatb91;

    float u_xlat92;

    float u_xlat93;

    float u_xlat94;

    float u_xlat96;

    float u_xlat97;

    int u_xlati97;

    float u_xlat98;

    float u_xlat99;

    bool u_xlatb99;

    float u_xlat100;

    float u_xlat101;

    u_xlat0.x = _CameraDepthTexture.sample(sampler_CameraDepthTexture, input.TEXCOORD0.zw).x;

    u_xlat26.xy = fma(input.TEXCOORD0.xy, float2(2.0, 2.0), float2(-1.0, -1.0));

    u_xlat1 = u_xlat26.yyyy * FGlobals.hlslcc_mtx4x4_ViewFromScreen[1];

    u_xlat1 = fma(FGlobals.hlslcc_mtx4x4_ViewFromScreen[0], u_xlat26.xxxx, u_xlat1);

    u_xlat1 = fma(FGlobals.hlslcc_mtx4x4_ViewFromScreen[2], u_xlat0.xxxx, u_xlat1);

    u_xlat1 = u_xlat1 + FGlobals.hlslcc_mtx4x4_ViewFromScreen[3];

    u_xlat1 = u_xlat1 / u_xlat1.wwww;

    u_xlat26.xyz = u_xlat1.yyy * FGlobals.hlslcc_mtx4x4_WorldFromView[1].xyz;

    u_xlat26.xyz = fma(FGlobals.hlslcc_mtx4x4_WorldFromView[0].xyz, u_xlat1.xxx, u_xlat26.xyz);

    u_xlat26.xyz = fma(FGlobals.hlslcc_mtx4x4_WorldFromView[2].xyz, u_xlat1.zzz, u_xlat26.xyz);

    u_xlat1.xyz = fma(FGlobals.hlslcc_mtx4x4_WorldFromView[3].xyz, u_xlat1.www, u_xlat26.xyz);

    u_xlat26.xyz = u_xlat1.xyz + (-FGlobals._WorldSpaceCameraPos.xyzx.xyz);

    u_xlat2 = dot(u_xlat26.xyz, u_xlat26.xyz);

    u_xlat2 = sqrt(u_xlat2);

    u_xlat26.xyz = u_xlat26.xyz / float3(u_xlat2);

    u_xlat28.xyz = fma(u_xlat26.xyz, float3(9999999.0, 9999999.0, 9999999.0), FGlobals._WorldSpaceCameraPos.xyzx.xyz);

    u_xlat28.xyz = u_xlat28.xyz + FGlobals._OverCloudOriginOffset.xyzx.xyz;

    u_xlat3.xyz = FGlobals._WorldSpaceCameraPos.xyzx.xyz + FGlobals._OverCloudOriginOffset.xyzx.xyz;

    u_xlat4.xyz = u_xlat28.xyz + (-u_xlat3.xyz);

    u_xlat82 = dot(u_xlat4.xyz, u_xlat4.xyz);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat4.xyz = u_xlat4.xyz / float3(u_xlat82);

    u_xlat5.x = (-u_xlat3.y) + (-FGlobals._OC_EarthRadius);

    u_xlat31.x = u_xlat4.y * u_xlat5.x;

    u_xlat57 = FGlobals._OC_EarthRadius * FGlobals._OC_EarthRadius;

    u_xlat31.x = u_xlat31.x * u_xlat31.x;

    u_xlat31.x = fma(u_xlat5.x, u_xlat5.x, (-u_xlat31.x));

    u_xlatb57 = u_xlat57>=u_xlat31.x;

    u_xlat31.x = fma(FGlobals._OC_EarthRadius, FGlobals._OC_EarthRadius, (-u_xlat31.x));

    u_xlat31.x = sqrt(u_xlat31.x);

    u_xlat6.y = fma(u_xlat5.x, u_xlat4.y, (-u_xlat31.x));

    u_xlat6.x = fma(u_xlat5.x, u_xlat4.y, u_xlat31.x);

    u_xlatb5 = u_xlat6.x<u_xlat6.y;

    u_xlat5.xy = (bool(u_xlatb5)) ? u_xlat6.xy : u_xlat6.yx;

    u_xlatb6.xy = (u_xlat5.xy<float2(0.0, 0.0));

    u_xlatb83 = u_xlatb6.y && u_xlatb6.x;

    u_xlati83 = ~(int(u_xlatb83) * int(0xffffffffu));

    u_xlati57 = u_xlatb57 ? u_xlati83 : int(0);

    u_xlatb83 = u_xlat4.y<0.0;

    u_xlati57 = u_xlatb83 ? u_xlati57 : int(0);

    if((uint(u_xlati57))!=uint(0)){

    u_xlat5.x = (u_xlatb6.x) ? u_xlat5.y : u_xlat5.x;

    u_xlat6.xzw = fma(u_xlat4.xzy, u_xlat5.xxx, u_xlat3.xzy);

    u_xlat3.w = (-FGlobals._OC_EarthRadius);

    u_xlat6.y = u_xlat6.w + 1.0;

    u_xlat5.xyw = (-u_xlat3.xwz) + u_xlat6.xyz;

    u_xlat81 = dot(u_xlat5.xyw, u_xlat5.xyw);

    u_xlat81 = rsqrt(u_xlat81);

    u_xlat5.xyw = float3(u_xlat81) * u_xlat5.xyw;

    u_xlat81 = dot(u_xlat5.xyw, (-FGlobals._OC_ActualSunDir.xyzx.xyz));

    u_xlat81 = max(u_xlat81, 0.0);

    u_xlat5.x = dot(u_xlat5.xyw, (-FGlobals._OC_ActualMoonDir.xyzx.xyz));

    u_xlat5.x = max(u_xlat5.x, 0.0);

    u_xlat5.xyw = u_xlat5.xxx * FGlobals._OC_ActualMoonColor.xyz;

    u_xlat5.xyw = fma(float3(u_xlat81), FGlobals._OC_ActualSunColor.xyz, u_xlat5.xyw);

    u_xlat5.xyw = u_xlat5.xyw * FGlobals._OC_EarthColor.xyzx.xyz;

    u_xlati81 = int(0xffffffffu);

    } else {

    u_xlat6.x = float(0.0);

    u_xlat6.y = float(0.0);

    u_xlat6.z = float(0.0);

    u_xlat5.x = float(0.0);

    u_xlat5.y = float(0.0);

    u_xlat5.w = float(0.0);

    }

    u_xlati81 = int(uint(u_xlati81) & uint(u_xlati57));

    u_xlat7.xyz = (-FGlobals._OC_ActualSunColor.xyz) + FGlobals._SkySolarEclipse.xyz;

    u_xlat7.xyz = fma(FGlobals._SkySolarEclipse.www, u_xlat7.xyz, FGlobals._OC_ActualSunColor.xyz);

    u_xlat8.z = 0.0;

    u_xlat8.w = u_xlat3.y;

    u_xlat9.xyz = u_xlat8.zwz + (-FGlobals._ScattEarthCenter.xxyz.yzw);

    u_xlat29 = dot(u_xlat9.xyz, u_xlat9.xyz);

    u_xlat10.y = sqrt(u_xlat29);

    u_xlat10.x = dot(u_xlat9.xyz, u_xlat4.xyz);

    u_xlat29 = fma(u_xlat10.x, u_xlat10.x, (-u_xlat29));

    u_xlat62.xy = float2(FGlobals.bottom_radius, FGlobals.top_radius) * float2(FGlobals.bottom_radius, FGlobals.top_radius);

    u_xlat29 = fma(FGlobals.top_radius, FGlobals.top_radius, u_xlat29);

    u_xlat29 = sqrt(u_xlat29);

    u_xlat11.x = (-u_xlat29);

    u_xlat29 = (-u_xlat10.x) + u_xlat11.x;

    u_xlatb57 = 0.0<u_xlat29;

    u_xlati84 = int((FGlobals.top_radius>=u_xlat10.y) ? 0xFFFFFFFFu : uint(0));

    u_xlati84 = (u_xlatb57) ? int(0xffffffffu) : u_xlati84;

    if((uint(u_xlati84))!=uint(0)){

    u_xlat12.xyz = fma(u_xlat4.xyz, float3(u_xlat29), u_xlat9.xyz);

    u_xlat9.xyz = (bool(u_xlatb57)) ? u_xlat12.xyz : u_xlat9.xyz;

    u_xlat11.y = FGlobals.top_radius;

    u_xlat10.xy = (bool(u_xlatb57)) ? u_xlat11.xy : u_xlat10.xy;

    u_xlat29 = u_xlat10.x / u_xlat10.y;

    u_xlat57 = dot(u_xlat9.xyz, (-FGlobals._OC_ActualSunDir.xyzx.xyz));

    u_xlat57 = u_xlat57 / u_xlat10.y;

    u_xlat84 = dot(u_xlat4.xyz, (-FGlobals._OC_ActualSunDir.xyzx.xyz));

    u_xlatb85 = u_xlat29<0.0;

    u_xlat9.x = u_xlat10.y * u_xlat10.y;

    u_xlat29 = fma(u_xlat29, u_xlat29, -1.0);

    u_xlat35.x = FGlobals.bottom_radius * FGlobals.bottom_radius;

    u_xlat61.x = fma(u_xlat9.x, u_xlat29, u_xlat35.x);

    u_xlatb61 = u_xlat61.x>=0.0;

    u_xlatb85 = u_xlatb85 && u_xlatb61;

    u_xlat61.x = fma(FGlobals.top_radius, FGlobals.top_radius, (-u_xlat35.x));

    u_xlat87 = fma(u_xlat10.y, u_xlat10.y, (-u_xlat35.x));

    u_xlat61.y = max(u_xlat87, 0.0);

    u_xlat9.zw = sqrt(u_xlat61.xy);

    u_xlat29 = fma(u_xlat9.x, u_xlat29, u_xlat62.y);

    u_xlat29 = max(u_xlat29, 0.0);

    u_xlat29 = sqrt(u_xlat29);

    u_xlat29 = u_xlat29 + (-u_xlat10.x);

    u_xlat29 = max(u_xlat29, 0.0);

    u_xlat11.x = (-u_xlat10.y) + FGlobals.top_radius;

    u_xlat37 = u_xlat9.z + u_xlat9.w;

    u_xlat29 = u_xlat29 + (-u_xlat11.x);

    u_xlat37 = (-u_xlat11.x) + u_xlat37;

    u_xlat29 = u_xlat29 / u_xlat37;

    u_xlat63 = u_xlat9.w / u_xlat9.z;

    u_xlat12 = float4(int4(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT, FGlobals.SCATTERING_TEXTURE_R_SIZE, FGlobals.SCATTERING_TEXTURE_MU_SIZE));

    u_xlat13.xyz = float3(0.5, 0.5, 0.5) / u_xlat12.xyz;

    u_xlat12.xyz = float3(1.0, 1.0, 1.0) / u_xlat12.xyz;

    u_xlat12.xyz = (-u_xlat12.xyz) + float3(1.0, 1.0, 1.0);

    u_xlat14.x = fma(u_xlat29, u_xlat12.x, u_xlat13.x);

    u_xlat14.yw = fma(float2(u_xlat63), u_xlat12.yz, u_xlat13.yz);

    u_xlat12.xyz = float3(transmittance_texture.sample(samplertransmittance_texture, u_xlat14.xy, level(0.0)).xyz);

    u_xlat12.xyz = (bool(u_xlatb85)) ? float3(0.0, 0.0, 0.0) : u_xlat12.xyz;

    u_xlat29 = fma(u_xlat10.x, u_xlat10.x, (-u_xlat9.x));

    u_xlat29 = fma(FGlobals.bottom_radius, FGlobals.bottom_radius, u_xlat29);

    u_xlat9.x = max(u_xlat29, 0.0);

    u_xlat9.x = sqrt(u_xlat9.x);

    u_xlat9.x = (-u_xlat9.x) + (-u_xlat10.x);

    u_xlat36 = u_xlat10.y + (-FGlobals.bottom_radius);

    u_xlatb63 = u_xlat9.w==u_xlat36;

    u_xlat9.xw = u_xlat9.xw + (-float2(u_xlat36));

    u_xlat9.x = u_xlat9.x / u_xlat9.w;

    u_xlat9.x = (u_xlatb63) ? 0.0 : u_xlat9.x;

    u_xlat87 = u_xlat12.w * 0.5;

    u_xlat87 = trunc(u_xlat87);

    u_xlat36 = 0.5 / u_xlat87;

    u_xlat87 = float(1.0) / u_xlat87;

    u_xlat87 = (-u_xlat87) + 1.0;

    u_xlat9.x = fma(u_xlat9.x, u_xlat87, u_xlat36);

    u_xlat9.x = fma((-u_xlat9.x), 0.5, 0.5);

    u_xlat29 = fma(u_xlat9.z, u_xlat9.z, u_xlat29);

    u_xlat29 = max(u_xlat29, 0.0);

    u_xlat29 = sqrt(u_xlat29);

    u_xlat29 = u_xlat29 + (-u_xlat10.x);

    u_xlat29 = (-u_xlat11.x) + u_xlat29;

    u_xlat29 = u_xlat29 / u_xlat37;

    u_xlat29 = fma(u_xlat29, u_xlat87, u_xlat36);

    u_xlat29 = fma(u_xlat29, 0.5, 0.5);

    u_xlat14.z = (u_xlatb85) ? u_xlat9.x : u_xlat29;

    u_xlat29 = fma(u_xlat57, u_xlat57, -1.0);

    u_xlat29 = fma(u_xlat35.x, u_xlat29, u_xlat62.y);

    u_xlat29 = max(u_xlat29, 0.0);

    u_xlat29 = sqrt(u_xlat29);

    u_xlat29 = fma((-FGlobals.bottom_radius), u_xlat57, u_xlat29);

    u_xlat29 = max(u_xlat29, 0.0);

    u_xlat57 = (-FGlobals.bottom_radius) + FGlobals.top_radius;

    u_xlat29 = u_xlat29 + (-u_xlat57);

    u_xlat57 = (-u_xlat57) + u_xlat9.z;

    u_xlat29 = u_xlat29 / u_xlat57;

    u_xlat85 = FGlobals.bottom_radius * FGlobals.mu_s_min;

    u_xlat85 = u_xlat85 * -2.0;

    u_xlat57 = u_xlat85 / u_xlat57;

    u_xlat57 = u_xlat29 / u_xlat57;

    u_xlat57 = (-u_xlat57) + 1.0;

    u_xlat57 = max(u_xlat57, 0.0);

    u_xlat29 = u_xlat29 + 1.0;

    u_xlat29 = u_xlat57 / u_xlat29;

    u_xlat9.xy = float2(int2(FGlobals.SCATTERING_TEXTURE_MU_S_SIZE, FGlobals.SCATTERING_TEXTURE_NU_SIZE));

    u_xlat57 = 0.5 / u_xlat9.x;

    u_xlat85 = float(1.0) / u_xlat9.x;

    u_xlat85 = (-u_xlat85) + 1.0;

    u_xlat29 = fma(u_xlat29, u_xlat85, u_xlat57);

    u_xlat57 = u_xlat84 + 1.0;

    u_xlat57 = u_xlat57 * 0.5;

    u_xlat85 = u_xlat9.y + -1.0;

    u_xlat9.x = u_xlat57 * u_xlat85;

    u_xlat9.x = floor(u_xlat9.x);

    u_xlat57 = fma(u_xlat57, u_xlat85, (-u_xlat9.x));

    u_xlat29 = u_xlat29 + u_xlat9.x;

    u_xlat14.y = u_xlat29 / u_xlat9.y;

    u_xlat29 = u_xlat29 + 1.0;

    u_xlat14.x = u_xlat29 / u_xlat9.y;

    u_xlat16_9.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat14.yzw, level(1.0)).xyz;

    u_xlat29 = (-u_xlat57) + 1.0;

    u_xlat16_11.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat14.xzw, level(1.0)).xyz;

    u_xlat11.xyz = float3(u_xlat57) * float3(u_xlat16_11.xyz);

    u_xlat9.xyz = fma(float3(u_xlat16_9.xyz), float3(u_xlat29), u_xlat11.xyz);

    u_xlat29 = fma(u_xlat84, u_xlat84, 1.0);

    u_xlat29 = u_xlat29 * 0.0596831031;

    u_xlat9.xyz = float3(u_xlat29) * u_xlat9.xyz;

    } else {

    u_xlat12.x = float(1.0);

    u_xlat12.y = float(1.0);

    u_xlat12.z = float(1.0);

    u_xlat9.x = float(0.0);

    u_xlat9.y = float(0.0);

    u_xlat9.z = float(0.0);

    }

    u_xlat9.xyz = u_xlat9.xyz * FGlobals.SKY_SPECTRAL_RADIANCE_TO_LUMINANCE.xyzx.xyz;

    u_xlat9.xyz = u_xlat7.xyz * u_xlat9.xyz;

    u_xlat9.xyz = u_xlat9.xyz * FGlobals._OC_ActualSunColor.www;

    u_xlat16_29 = _OC_ScatteringMask.sample(sampler_OC_ScatteringMask, input.TEXCOORD0.zw).x;

    u_xlat16_57 = (-u_xlat16_29) + half(1.0);

    u_xlat16_57 = fma(u_xlat16_57, half(0.25), u_xlat16_29);

    u_xlat9.xyz = float3(u_xlat16_57) * u_xlat9.xyz;

    u_xlat11.xyz = (-FGlobals._OC_ActualMoonColor.xyz) + FGlobals._SkyLunarEclipse.xyz;

    u_xlat13.xyz = FGlobals._OC_ActualMoonDir.xyzx.xyz * float3(-384400000.0, -384400000.0, -384400000.0);

    u_xlat10.xy = float2(FGlobals._SkyMoonSize, FGlobals._SkySunSize) * float2(1737000.0, 695507968.0);

    u_xlat57 = dot(u_xlat13.xyz, u_xlat4.xyz);

    u_xlat14.xy = u_xlat10.xy * u_xlat10.xy;

    u_xlat84 = dot(u_xlat13.xyz, u_xlat13.xyz);

    u_xlat84 = fma((-u_xlat57), u_xlat57, u_xlat84);

    u_xlatb85 = u_xlat14.x>=u_xlat84;

    u_xlat84 = fma(u_xlat10.x, u_xlat10.x, (-u_xlat84));

    u_xlat84 = sqrt(u_xlat84);

    u_xlat15.y = u_xlat57 + (-u_xlat84);

    u_xlat15.x = u_xlat57 + u_xlat84;

    u_xlatb57 = u_xlat15.x<u_xlat15.y;

    u_xlat14.xz = (bool(u_xlatb57)) ? u_xlat15.xy : u_xlat15.yx;

    u_xlatb15.xy = (u_xlat14.xz<float2(0.0, 0.0));

    u_xlatb57 = u_xlatb15.y && u_xlatb15.x;

    u_xlati57 = ~(int(u_xlatb57) * int(0xffffffffu));

    u_xlati57 = u_xlatb85 ? u_xlati57 : int(0);

    u_xlat84 = dot(u_xlat4.xyz, (-FGlobals._OC_ActualMoonDir.xyzx.xyz));

    u_xlatb84 = 0.0<u_xlat84;

    u_xlati57 = u_xlatb84 ? u_xlati57 : int(0);

    if((uint(u_xlati57))!=uint(0)){

    u_xlat41.xyz = fma(FGlobals._SkyLunarEclipse.www, u_xlat11.xyz, FGlobals._OC_ActualMoonColor.xyz);

    u_xlat84 = (u_xlatb15.x) ? u_xlat14.z : u_xlat14.x;

    u_xlat14.xzw = u_xlat4.xyz * float3(u_xlat84);

    u_xlat13.xyz = fma(u_xlat4.xyz, float3(u_xlat84), (-u_xlat13.xyz));

    u_xlat84 = dot(u_xlat13.xyz, u_xlat13.xyz);

    u_xlat84 = rsqrt(u_xlat84);

    u_xlat13.xyz = float3(u_xlat84) * u_xlat13.xyz;

    u_xlat84 = FGlobals._OC_EarthRadius * 1.10000002;

    u_xlat85 = dot((-u_xlat14.xzw), FGlobals._OC_ActualSunDir.xyzx.xyz);

    u_xlat87 = u_xlat84 * u_xlat84;

    u_xlat10.x = dot((-u_xlat14.xzw), (-u_xlat14.xzw));

    u_xlat10.x = fma((-u_xlat85), u_xlat85, u_xlat10.x);

    u_xlatb87 = u_xlat87>=u_xlat10.x;

    u_xlat84 = fma(u_xlat84, u_xlat84, (-u_xlat10.x));

    u_xlat84 = sqrt(u_xlat84);

    u_xlat16.y = (-u_xlat84) + u_xlat85;

    u_xlat16.x = u_xlat84 + u_xlat85;

    u_xlatb84 = u_xlat16.x<u_xlat16.y;

    u_xlat14.xz = (bool(u_xlatb84)) ? u_xlat16.xy : u_xlat16.yx;

    u_xlat14.xz = as_type<float2>(uint2((u_xlat14.xz<float2(0.0, 0.0))) * 0xFFFFFFFFu);

    u_xlati84 = int(as_type<uint>(u_xlat14.z) & as_type<uint>(u_xlat14.x));

    u_xlati84 = ~u_xlati84;

    u_xlati84 = u_xlatb87 ? u_xlati84 : int(0);

    u_xlat85 = dot(FGlobals._OC_ActualSunDir.xyzx.xyz, (-FGlobals._OC_ActualMoonDir.xyzx.xyz));

    u_xlatb85 = 0.0<u_xlat85;

    u_xlati84 = u_xlatb85 ? u_xlati84 : int(0);

    u_xlat84 = (u_xlati84 != 0) ? FGlobals._SkyLunarEclipse.w : 1.0;

    u_xlat85 = dot((-FGlobals._OC_ActualSunDir.xyzx.xyz), u_xlat13.xyz);

    u_xlat85 = max(u_xlat85, 0.0);

    u_xlat85 = (-u_xlat85) + 1.0;

    u_xlat87 = u_xlat85 * u_xlat85;

    u_xlat85 = fma((-u_xlat87), u_xlat85, 1.0);

    u_xlat84 = u_xlat84 * u_xlat85;

    u_xlat84 = u_xlat84 * 0.75;

    u_xlat16_13.xyz = _SkyMoonCubemap.sample(sampler_SkyMoonCubemap, u_xlat13.xyz).xyz;

    u_xlat13.xyz = float3(u_xlat84) * float3(u_xlat16_13.xyz);

    u_xlat13.xyz = u_xlat41.xyz * u_xlat13.xyz;

    u_xlat13.xyz = u_xlat13.xyz * float3(FGlobals._SkyMoonIntensity);

    u_xlat13.w = 1.0;

    }

    u_xlat13 = as_type<float4>(uint4(u_xlati57) & as_type<uint4>(u_xlat13));

    u_xlat13.xyz = u_xlat12.xyz * u_xlat13.xyz;

    u_xlat13.xyz = u_xlat13.xyz * u_xlat13.www;

    u_xlat9.xyz = fma(u_xlat9.xyz, float3(FGlobals._OC_AtmosphereExposure), u_xlat13.xyz);

    u_xlat13.xyz = FGlobals._OC_ActualSunDir.xyzx.xyz * float3(-1.4960001e+11, -1.4960001e+11, -1.4960001e+11);

    u_xlat57 = dot(u_xlat13.xyz, u_xlat4.xyz);

    u_xlat84 = dot(u_xlat13.xyz, u_xlat13.xyz);

    u_xlat84 = fma((-u_xlat57), u_xlat57, u_xlat84);

    u_xlatb85 = u_xlat14.y>=u_xlat84;

    u_xlat84 = fma(u_xlat10.y, u_xlat10.y, (-u_xlat84));

    u_xlat84 = sqrt(u_xlat84);

    u_xlat10.y = u_xlat57 + (-u_xlat84);

    u_xlat10.x = u_xlat57 + u_xlat84;

    u_xlatb57 = u_xlat10.x<u_xlat10.y;

    u_xlat10.xy = (bool(u_xlatb57)) ? u_xlat10.xy : u_xlat10.yx;

    u_xlat14.xy = as_type<float2>(uint2((u_xlat10.xy<float2(0.0, 0.0))) * 0xFFFFFFFFu);

    u_xlati57 = int(as_type<uint>(u_xlat14.y) & as_type<uint>(u_xlat14.x));

    u_xlati57 = ~u_xlati57;

    u_xlati57 = u_xlatb85 ? u_xlati57 : int(0);

    u_xlat84 = dot(u_xlat4.xyz, (-FGlobals._OC_ActualSunDir.xyzx.xyz));

    u_xlatb84 = 0.0<u_xlat84;

    u_xlati57 = u_xlatb84 ? u_xlati57 : int(0);

    if((uint(u_xlati57))!=uint(0)){

    u_xlat84 = (as_type<int>(u_xlat14.x) != 0) ? u_xlat10.y : u_xlat10.x;

    u_xlat13.xyz = fma(u_xlat4.xyz, float3(u_xlat84), (-u_xlat13.xyz));

    u_xlat84 = dot(u_xlat13.xyz, u_xlat13.xyz);

    u_xlat84 = rsqrt(u_xlat84);

    u_xlat13.xyz = float3(u_xlat84) * u_xlat13.xyz;

    u_xlat84 = dot(u_xlat13.xyz, FGlobals._OC_ActualSunDir.xyzx.xyz);

    u_xlat84 = fma(u_xlat84, 0.5, 0.5);

    u_xlat84 = u_xlat84 * u_xlat84;

    u_xlat13.xyz = fma(float3(u_xlat84), float3(0.779999971, 0.850000024, 0.920000017), float3(0.219999999, 0.150000006, 0.0799999982));

    u_xlat13.xyz = u_xlat13.xyz * FGlobals._OC_ActualSunColor.xyz;

    u_xlat14.xyz = u_xlat13.xyz * float3(FGlobals._SkySunIntensity);

    u_xlat14.w = 1.0;

    }

    u_xlat14 = as_type<float4>(uint4(u_xlati57) & as_type<uint4>(u_xlat14));

    u_xlat13.xyz = u_xlat12.xyz * u_xlat14.xyz;

    u_xlat57 = (-u_xlat13.w) + 1.0;

    u_xlat84 = u_xlat57 * u_xlat14.w;

    u_xlat9.xyz = fma(float3(u_xlat84), u_xlat13.xyz, u_xlat9.xyz);

    if((uint(u_xlati81))==uint(0)){

    u_xlat84 = FGlobals._SkyLunarEclipse.w * FGlobals._LunarEclipseLightingInfluence;

    u_xlat13.xyz = fma(float3(u_xlat84), u_xlat11.xyz, FGlobals._OC_ActualMoonColor.xyz);

    u_xlat84 = dot(u_xlat12.xyz, float3(0.300000012, 0.589999974, 0.109999999));

    u_xlat84 = (-u_xlat84) + 1.0;

    u_xlat84 = u_xlat84 * 0.349999994;

    u_xlat13.xyz = u_xlat13.xyz * float3(u_xlat84);

    u_xlat9.xyz = fma(u_xlat13.xyz, float3(FGlobals._OC_NightScattering), u_xlat9.xyz);

    }

    u_xlat16_13.xyz = _SkyStarsCubemap.sample(sampler_SkyStarsCubemap, u_xlat4.xyz).xyz;

    u_xlat12.xyz = u_xlat12.xyz * float3(u_xlat16_13.xyz);

    u_xlat12.xyz = u_xlat12.xyz * float3(FGlobals._SkyStarsIntensity);

    u_xlat12.xyz = float3(u_xlat57) * u_xlat12.xyz;

    u_xlat57 = (-u_xlat14.w) + 1.0;

    u_xlat9.xyz = fma(u_xlat12.xyz, float3(u_xlat57), u_xlat9.xyz);

    u_xlat6.yzw = (int(u_xlati81) != 0) ? u_xlat6.xyz : u_xlat28.xyz;

    u_xlat28.xyz = (int(u_xlati81) != 0) ? u_xlat5.xyw : u_xlat9.xyz;

    u_xlat5.xyz = u_xlat6.yzw + (-FGlobals._OverCloudOriginOffset.xyzx.xyz);

    u_xlat5.xyz = u_xlat5.xyz + (-FGlobals._WorldSpaceCameraPos.xyzx.xyz);

    u_xlat83 = dot(u_xlat5.xyz, u_xlat5.xyz);

    u_xlat6.x = sqrt(u_xlat83);

    u_xlat5.xyz = u_xlat5.xyz / u_xlat6.xxx;

    u_xlat9.xz = (-u_xlat3.xz) + u_xlat6.yw;

    u_xlat83 = u_xlat8.w + (-FGlobals._OC_FogHeight);

    u_xlatb83 = abs(u_xlat83)<1.0;

    u_xlat32.x = FGlobals._OC_FogHeight + -1.0;

    u_xlat12.x = (u_xlatb83) ? u_xlat32.x : u_xlat8.w;

    u_xlatb83 = u_xlat12.x<FGlobals._OC_FogHeight;

    if(u_xlatb83){

    u_xlat32.x = FGlobals._OC_EarthRadius + FGlobals._OC_FogHeight;

    u_xlat84 = (-u_xlat12.x) + (-FGlobals._OC_EarthRadius);

    u_xlat85 = u_xlat5.y * u_xlat84;

    u_xlat87 = u_xlat32.x * u_xlat32.x;

    u_xlat85 = u_xlat85 * u_xlat85;

    u_xlat85 = fma(u_xlat84, u_xlat84, (-u_xlat85));

    u_xlatb87 = u_xlat87>=u_xlat85;

    u_xlat32.x = fma(u_xlat32.x, u_xlat32.x, (-u_xlat85));

    u_xlat32.x = sqrt(u_xlat32.x);

    u_xlat10.y = fma(u_xlat84, u_xlat5.y, (-u_xlat32.x));

    u_xlat10.x = fma(u_xlat84, u_xlat5.y, u_xlat32.x);

    u_xlatb32.x = u_xlat10.x<u_xlat10.y;

    u_xlat32.xz = (u_xlatb32.x) ? u_xlat10.xy : u_xlat10.yx;

    u_xlatb10.xy = (u_xlat32.xz<float2(0.0, 0.0));

    u_xlat13.x = (u_xlatb10.x) ? u_xlat32.z : u_xlat32.x;

    u_xlatb32.x = u_xlatb10.y && u_xlatb10.x;

    u_xlati32 = ~(int(u_xlatb32.x) * int(0xffffffffu));

    u_xlati32 = u_xlatb87 ? u_xlati32 : int(0);

    u_xlatb84 = u_xlat13.x<u_xlat6.x;

    u_xlat13.y = fma(u_xlat5.y, u_xlat13.x, u_xlat12.x);

    u_xlat10.xy = (bool(u_xlatb84)) ? u_xlat13.xy : u_xlat6.xz;

    u_xlat13.x = float(0.0);

    u_xlat13.w = float(0.0);

    u_xlat13.y = u_xlat6.z;

    u_xlat13.xz = (int(u_xlati32) != 0) ? u_xlat10.yx : u_xlat13.yx;

    u_xlat8.y = u_xlat13.x;

    u_xlat13.xy = u_xlat8.wy;

    } else {

    u_xlat32.x = FGlobals._OC_EarthRadius + FGlobals._OC_FogHeight;

    u_xlat84 = (-u_xlat12.x) + (-FGlobals._OC_EarthRadius);

    u_xlat85 = u_xlat5.y * u_xlat84;

    u_xlat87 = u_xlat32.x * u_xlat32.x;

    u_xlat85 = u_xlat85 * u_xlat85;

    u_xlat85 = fma(u_xlat84, u_xlat84, (-u_xlat85));

    u_xlatb87 = u_xlat87>=u_xlat85;

    u_xlat32.x = fma(u_xlat32.x, u_xlat32.x, (-u_xlat85));

    u_xlat32.x = sqrt(u_xlat32.x);

    u_xlat66.x = fma(u_xlat84, u_xlat5.y, (-u_xlat32.x));

    u_xlat66.y = fma(u_xlat84, u_xlat5.y, u_xlat32.x);

    u_xlatb32.x = u_xlat66.y<u_xlat66.x;

    u_xlat32.xz = (u_xlatb32.x) ? u_xlat66.xy : u_xlat66.yx;

    u_xlatb10.xy = (u_xlat32.zx<float2(0.0, 0.0));

    u_xlat14.zw = (u_xlatb10.x) ? u_xlat32.xz : u_xlat32.zx;

    u_xlatb32.x = u_xlatb10.y && u_xlatb10.x;

    u_xlati32 = ~(int(u_xlatb32.x) * int(0xffffffffu));

    u_xlati32 = u_xlatb87 ? u_xlati32 : int(0);

    u_xlat84 = min(u_xlat6.x, u_xlat14.w);

    u_xlat14.x = (-u_xlat14.z) + u_xlat84;

    u_xlatb84 = u_xlat14.x<u_xlat6.x;

    u_xlat14.y = fma(u_xlat5.y, u_xlat14.z, u_xlat12.x);

    u_xlat8.x = u_xlat6.x;

    u_xlat14.xyz = (bool(u_xlatb84)) ? u_xlat14.xyz : u_xlat8.xwz;

    u_xlat13.xzw = (int(u_xlati32) != 0) ? u_xlat14.yxz : u_xlat8.wzz;

    u_xlat13.y = u_xlat6.z;

    }

    u_xlat32.x = max(u_xlat13.z, 0.0);

    u_xlat84 = u_xlat13.y + u_xlat13.x;

    u_xlat84 = fma((-u_xlat84), 0.5, FGlobals._OC_FogHeight);

    u_xlat84 = max(u_xlat84, 0.0);

    u_xlat84 = u_xlat84 * FGlobals._OC_FogFalloffParams.xxyx.z;

    u_xlat84 = min(u_xlat84, 1.0);

    u_xlat32.x = u_xlat32.x * (-FGlobals._OC_FogParams.x);

    u_xlat32.x = u_xlat84 * u_xlat32.x;

    u_xlat32.x = exp2(u_xlat32.x);

    u_xlat84 = max(u_xlat13.w, FGlobals._OC_FogBlend);

    u_xlat6.w = min(u_xlat84, u_xlat6.x);

    u_xlat12.y = 0.0;

    u_xlat13.xyz = fma(u_xlat5.xyz, u_xlat6.www, u_xlat12.yxy);

    u_xlatb85 = u_xlat6.x<FGlobals._ProjectionParams.z;

    u_xlat14.y = max(u_xlat13.y, 1.0);

    u_xlat14.x = max(u_xlat12.x, 1.0);

    u_xlat12.z = u_xlat13.y;

    u_xlat15.xy = (bool(u_xlatb85)) ? u_xlat14.xy : u_xlat12.xz;

    u_xlat15.z = 0.0;

    u_xlat15.xzw = u_xlat15.zxz + (-FGlobals._ScattEarthCenter.xxyz.yzw);

    u_xlat13.w = u_xlat15.y;

    u_xlat13.xyz = u_xlat13.xwz + (-FGlobals._ScattEarthCenter.xxyz.yzw);

    u_xlat16.xyz = (-u_xlat15.xzw) + u_xlat13.xyz;

    u_xlat85 = dot(u_xlat16.xyz, u_xlat16.xyz);

    u_xlat85 = rsqrt(u_xlat85);

    u_xlat16.xyz = float3(u_xlat85) * u_xlat16.xyz;

    u_xlat85 = dot(u_xlat15.xzw, u_xlat15.xzw);

    u_xlat10.y = sqrt(u_xlat85);

    u_xlat10.x = dot(u_xlat15.xzw, u_xlat16.xyz);

    u_xlat85 = fma(u_xlat10.x, u_xlat10.x, (-u_xlat85));

    u_xlat85 = fma(FGlobals.top_radius, FGlobals.top_radius, u_xlat85);

    u_xlat85 = sqrt(u_xlat85);

    u_xlat17.x = (-u_xlat85);

    u_xlat85 = (-u_xlat10.x) + u_xlat17.x;

    u_xlatb87 = 0.0<u_xlat85;

    u_xlat18.xyz = fma(u_xlat16.xyz, float3(u_xlat85), u_xlat15.xzw);

    u_xlat15.xyz = (bool(u_xlatb87)) ? u_xlat18.xyz : u_xlat15.xzw;

    u_xlat17.yw = float2(FGlobals.top_radius);

    u_xlat10.xy = (bool(u_xlatb87)) ? u_xlat17.xy : u_xlat10.xy;

    u_xlat85 = u_xlat10.x / u_xlat10.y;

    u_xlat87 = dot(u_xlat15.xyz, (-FGlobals._OC_ActualSunDir.xyzx.xyz));

    u_xlat89 = u_xlat87 / u_xlat10.y;

    u_xlat64 = dot(u_xlat16.xyz, (-FGlobals._OC_ActualSunDir.xyzx.xyz));

    u_xlat13.xyz = u_xlat13.xyz + (-u_xlat15.xyz);

    u_xlat13.x = dot(u_xlat13.xyz, u_xlat13.xyz);

    u_xlat39 = sqrt(u_xlat13.x);

    u_xlatb65 = u_xlat85<0.0;

    u_xlat91 = u_xlat10.y * u_xlat10.y;

    u_xlat85 = fma(u_xlat85, u_xlat85, -1.0);

    u_xlat40 = fma(u_xlat91, u_xlat85, u_xlat62.x);

    u_xlatb40 = u_xlat40>=0.0;

    u_xlatb65 = u_xlatb65 && u_xlatb40;

    u_xlat40 = dot(u_xlat10.xx, float2(u_xlat39));

    u_xlat13.x = u_xlat13.x + u_xlat40;

    u_xlat13.x = fma(u_xlat10.y, u_xlat10.y, u_xlat13.x);

    u_xlat13.x = sqrt(u_xlat13.x);

    u_xlat13.x = max(u_xlat13.x, FGlobals.bottom_radius);

    u_xlat13.x = min(u_xlat13.x, FGlobals.top_radius);

    u_xlat40 = u_xlat10.x + u_xlat39;

    u_xlat92 = u_xlat40 / u_xlat13.x;

    u_xlat92 = max(u_xlat92, -1.0);

    u_xlat92 = min(u_xlat92, 1.0);

    if(u_xlatb65){

    u_xlat15.x = FGlobals.bottom_radius * FGlobals.bottom_radius;

    u_xlat41.x = fma(FGlobals.top_radius, FGlobals.top_radius, (-u_xlat15.x));

    u_xlat67 = u_xlat13.x * u_xlat13.x;

    u_xlat93 = fma(u_xlat13.x, u_xlat13.x, (-u_xlat15.x));

    u_xlat41.z = max(u_xlat93, 0.0);

    u_xlat16.x = fma(u_xlat92, u_xlat92, -1.0);

    u_xlat67 = fma(u_xlat67, u_xlat16.x, u_xlat62.y);

    u_xlat41.y = max(u_xlat67, 0.0);

    u_xlat41.xyz = sqrt(u_xlat41.xyz);

    u_xlat67 = fma(u_xlat13.x, u_xlat92, u_xlat41.y);

    u_xlat67 = max(u_xlat67, 0.0);

    u_xlat16.x = (-u_xlat13.x) + FGlobals.top_radius;

    u_xlat42.x = u_xlat41.x + u_xlat41.z;

    u_xlat67 = u_xlat67 + (-u_xlat16.x);

    u_xlat16.x = (-u_xlat16.x) + u_xlat42.x;

    u_xlat67 = u_xlat67 / u_xlat16.x;

    u_xlat93 = u_xlat41.z / u_xlat41.x;

    u_xlat16.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat68.xy = float2(0.5, 0.5) / u_xlat16.xy;

    u_xlat16.xy = float2(1.0, 1.0) / u_xlat16.xy;

    u_xlat16.xy = (-u_xlat16.xy) + float2(1.0, 1.0);

    u_xlat17.x = fma(u_xlat67, u_xlat16.x, u_xlat68.x);

    u_xlat17.y = fma(u_xlat93, u_xlat16.y, u_xlat68.y);

    u_xlat16_18.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat17.xy, level(0.0)).xyz;

    u_xlat15.x = fma(u_xlat10.y, u_xlat10.y, (-u_xlat15.x));

    u_xlat15.x = max(u_xlat15.x, 0.0);

    u_xlat67 = fma(u_xlat91, u_xlat85, u_xlat62.y);

    u_xlat15.z = max(u_xlat67, 0.0);

    u_xlat15.xz = sqrt(u_xlat15.xz);

    u_xlat67 = u_xlat10.x + u_xlat15.z;

    u_xlat67 = max(u_xlat67, 0.0);

    u_xlat93 = (-u_xlat10.y) + FGlobals.top_radius;

    u_xlat17.x = u_xlat41.x + u_xlat15.x;

    u_xlat15.z = (-u_xlat93) + u_xlat67;

    u_xlat41.z = (-u_xlat93) + u_xlat17.x;

    u_xlat15.xz = u_xlat15.xz / u_xlat41.xz;

    u_xlat17.x = fma(u_xlat15.z, u_xlat16.x, u_xlat68.x);

    u_xlat17.y = fma(u_xlat15.x, u_xlat16.y, u_xlat68.y);

    u_xlat16_15.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat17.xy, level(0.0)).xyz;

    u_xlat16_15.xyz = u_xlat16_18.xyz / u_xlat16_15.xyz;

    u_xlat15.xyz = min(float3(u_xlat16_15.xyz), float3(1.0, 1.0, 1.0));

    } else {

    u_xlat93 = fma(FGlobals.top_radius, FGlobals.top_radius, (-u_xlat62.x));

    u_xlat93 = sqrt(u_xlat93);

    u_xlat16.x = fma(u_xlat10.y, u_xlat10.y, (-u_xlat62.x));

    u_xlat16.x = max(u_xlat16.x, 0.0);

    u_xlat16.x = sqrt(u_xlat16.x);

    u_xlat85 = fma(u_xlat91, u_xlat85, u_xlat62.y);

    u_xlat85 = max(u_xlat85, 0.0);

    u_xlat85 = sqrt(u_xlat85);

    u_xlat85 = u_xlat85 + (-u_xlat10.x);

    u_xlat85 = max(u_xlat85, 0.0);

    u_xlat42.x = (-u_xlat10.y) + FGlobals.top_radius;

    u_xlat68.x = u_xlat93 + u_xlat16.x;

    u_xlat85 = u_xlat85 + (-u_xlat42.x);

    u_xlat42.x = (-u_xlat42.x) + u_xlat68.x;

    u_xlat85 = u_xlat85 / u_xlat42.x;

    u_xlat16.x = u_xlat16.x / u_xlat93;

    u_xlat42.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat17.xy = float2(0.5, 0.5) / u_xlat42.xy;

    u_xlat42.xy = float2(1.0, 1.0) / u_xlat42.xy;

    u_xlat42.xy = (-u_xlat42.xy) + float2(1.0, 1.0);

    u_xlat18.x = fma(u_xlat85, u_xlat42.x, u_xlat17.x);

    u_xlat18.y = fma(u_xlat16.x, u_xlat42.y, u_xlat17.y);

    u_xlat16_18.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat18.xy, level(0.0)).xyz;

    u_xlat85 = u_xlat13.x * u_xlat13.x;

    u_xlat16.x = fma(u_xlat13.x, u_xlat13.x, (-u_xlat62.x));

    u_xlat16.x = max(u_xlat16.x, 0.0);

    u_xlat16.x = sqrt(u_xlat16.x);

    u_xlat94 = fma(u_xlat92, u_xlat92, -1.0);

    u_xlat85 = fma(u_xlat85, u_xlat94, u_xlat62.y);

    u_xlat85 = max(u_xlat85, 0.0);

    u_xlat85 = sqrt(u_xlat85);

    u_xlat85 = fma((-u_xlat13.x), u_xlat92, u_xlat85);

    u_xlat85 = max(u_xlat85, 0.0);

    u_xlat92 = (-u_xlat13.x) + FGlobals.top_radius;

    u_xlat94 = u_xlat93 + u_xlat16.x;

    u_xlat85 = u_xlat85 + (-u_xlat92);

    u_xlat92 = (-u_xlat92) + u_xlat94;

    u_xlat85 = u_xlat85 / u_xlat92;

    u_xlat92 = u_xlat16.x / u_xlat93;

    u_xlat16.x = fma(u_xlat85, u_xlat42.x, u_xlat17.x);

    u_xlat16.y = fma(u_xlat92, u_xlat42.y, u_xlat17.y);

    u_xlat16_16.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat16.xy, level(0.0)).xyz;

    u_xlat16_16.xyz = u_xlat16_18.xyz / u_xlat16_16.xyz;

    u_xlat15.xyz = min(float3(u_xlat16_16.xyz), float3(1.0, 1.0, 1.0));

    }

    u_xlat85 = fma(FGlobals.top_radius, FGlobals.top_radius, (-u_xlat62.x));

    u_xlat85 = sqrt(u_xlat85);

    u_xlat92 = fma(u_xlat10.y, u_xlat10.y, (-u_xlat62.x));

    u_xlat92 = max(u_xlat92, 0.0);

    u_xlat92 = sqrt(u_xlat92);

    u_xlat93 = u_xlat92 / u_xlat85;

    u_xlat16.xy = float2(int2(FGlobals.SCATTERING_TEXTURE_R_SIZE, FGlobals.SCATTERING_TEXTURE_MU_SIZE));

    u_xlat68.x = 0.5 / u_xlat16.x;

    u_xlat16.x = float(1.0) / u_xlat16.x;

    u_xlat16.x = (-u_xlat16.x) + 1.0;

    u_xlat18.w = fma(u_xlat93, u_xlat16.x, u_xlat68.x);

    u_xlat91 = fma(u_xlat10.x, u_xlat10.x, (-u_xlat91));

    u_xlat91 = fma(FGlobals.bottom_radius, FGlobals.bottom_radius, u_xlat91);

    u_xlat93 = max(u_xlat91, 0.0);

    u_xlat93 = sqrt(u_xlat93);

    u_xlat93 = (-u_xlat10.x) + (-u_xlat93);

    u_xlat94 = u_xlat10.y + (-FGlobals.bottom_radius);

    u_xlatb17 = u_xlat92==u_xlat94;

    u_xlat93 = u_xlat93 + (-u_xlat94);

    u_xlat94 = u_xlat92 + (-u_xlat94);

    u_xlat93 = u_xlat93 / u_xlat94;

    u_xlat93 = (u_xlatb17) ? 0.0 : u_xlat93;

    u_xlat42.x = u_xlat16.y * 0.5;

    u_xlat42.x = trunc(u_xlat42.x);

    u_xlat94 = 0.5 / u_xlat42.x;

    u_xlat42.x = float(1.0) / u_xlat42.x;

    u_xlat42.x = (-u_xlat42.x) + 1.0;

    u_xlat93 = fma(u_xlat93, u_xlat42.x, u_xlat94);

    u_xlat93 = fma((-u_xlat93), 0.5, 0.5);

    u_xlat91 = fma(u_xlat85, u_xlat85, u_xlat91);

    u_xlat91 = max(u_xlat91, 0.0);

    u_xlat91 = sqrt(u_xlat91);

    u_xlat10.x = (-u_xlat10.x) + u_xlat91;

    u_xlat36 = (-u_xlat10.y) + FGlobals.top_radius;

    u_xlat91 = u_xlat85 + u_xlat92;

    u_xlat10.x = (-u_xlat36) + u_xlat10.x;

    u_xlat36 = (-u_xlat36) + u_xlat91;

    u_xlat10.x = u_xlat10.x / u_xlat36;

    u_xlat10.x = fma(u_xlat10.x, u_xlat42.x, u_xlat94);

    u_xlat10.x = fma(u_xlat10.x, 0.5, 0.5);

    u_xlat18.z = (u_xlatb65) ? u_xlat93 : u_xlat10.x;

    u_xlat10.x = fma(u_xlat89, u_xlat89, -1.0);

    u_xlat10.x = fma(u_xlat62.x, u_xlat10.x, u_xlat62.y);

    u_xlat10.x = max(u_xlat10.x, 0.0);

    u_xlat10.x = sqrt(u_xlat10.x);

    u_xlat10.x = fma((-FGlobals.bottom_radius), u_xlat89, u_xlat10.x);

    u_xlat10.x = max(u_xlat10.x, 0.0);

    u_xlat36 = (-FGlobals.bottom_radius) + FGlobals.top_radius;

    u_xlat10.x = (-u_xlat36) + u_xlat10.x;

    u_xlat89 = u_xlat85 + (-u_xlat36);

    u_xlat10.x = u_xlat10.x / u_xlat89;

    u_xlat91 = FGlobals.bottom_radius * FGlobals.mu_s_min;

    u_xlat91 = u_xlat91 * -2.0;

    u_xlat92 = u_xlat91 / u_xlat89;

    u_xlat93 = u_xlat10.x / u_xlat92;

    u_xlat93 = (-u_xlat93) + 1.0;

    u_xlat93 = max(u_xlat93, 0.0);

    u_xlat10.x = u_xlat10.x + 1.0;

    u_xlat10.x = u_xlat93 / u_xlat10.x;

    u_xlat17.xy = float2(int2(FGlobals.SCATTERING_TEXTURE_MU_S_SIZE, FGlobals.SCATTERING_TEXTURE_NU_SIZE));

    u_xlat93 = 0.5 / u_xlat17.x;

    u_xlat17.x = float(1.0) / u_xlat17.x;

    u_xlat17.x = (-u_xlat17.x) + 1.0;

    u_xlat10.x = fma(u_xlat10.x, u_xlat17.x, u_xlat93);

    u_xlat19.x = u_xlat64 + 1.0;

    u_xlat19.x = u_xlat19.x * 0.5;

    u_xlat45 = u_xlat17.y + -1.0;

    u_xlat71 = u_xlat45 * u_xlat19.x;

    u_xlat71 = floor(u_xlat71);

    u_xlat19.x = fma(u_xlat19.x, u_xlat45, (-u_xlat71));

    u_xlat97 = u_xlat10.x + u_xlat71;

    u_xlat18.y = u_xlat97 / u_xlat17.y;

    u_xlat97 = u_xlat71 + 1.0;

    u_xlat10.x = u_xlat10.x + u_xlat97;

    u_xlat18.x = u_xlat10.x / u_xlat17.y;

    u_xlat16_20.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat18.yzw, level(1.0)).xyz;

    u_xlat10.x = (-u_xlat19.x) + 1.0;

    u_xlat16_18.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat18.xzw, level(1.0)).xyz;

    u_xlat18.xyz = u_xlat19.xxx * float3(u_xlat16_18.xyz);

    u_xlat18.xyz = fma(float3(u_xlat16_20.xyz), u_xlat10.xxx, u_xlat18.xyz);

    u_xlat87 = fma(u_xlat39, u_xlat64, u_xlat87);

    u_xlat87 = u_xlat87 / u_xlat13.x;

    u_xlat39 = u_xlat13.x * u_xlat13.x;

    u_xlat96 = fma(u_xlat13.x, u_xlat13.x, (-u_xlat62.x));

    u_xlat96 = max(u_xlat96, 0.0);

    u_xlat96 = sqrt(u_xlat96);

    u_xlat20.x = u_xlat96 / u_xlat85;

    u_xlat20.w = fma(u_xlat20.x, u_xlat16.x, u_xlat68.x);

    u_xlat39 = fma(u_xlat40, u_xlat40, (-u_xlat39));

    u_xlat39 = fma(FGlobals.bottom_radius, FGlobals.bottom_radius, u_xlat39);

    u_xlat21.x = max(u_xlat39, 0.0);

    u_xlat21.x = sqrt(u_xlat21.x);

    u_xlat21.x = (-u_xlat40) + (-u_xlat21.x);

    u_xlat47.x = u_xlat13.x + (-FGlobals.bottom_radius);

    u_xlatb73 = u_xlat96==u_xlat47.x;

    u_xlat21.x = (-u_xlat47.x) + u_xlat21.x;

    u_xlat47.x = u_xlat96 + (-u_xlat47.x);

    u_xlat21.x = u_xlat21.x / u_xlat47.x;

    u_xlat21.x = (u_xlatb73) ? 0.0 : u_xlat21.x;

    u_xlat21.x = fma(u_xlat21.x, u_xlat42.x, u_xlat94);

    u_xlat21.x = fma((-u_xlat21.x), 0.5, 0.5);

    u_xlat39 = fma(u_xlat85, u_xlat85, u_xlat39);

    u_xlat39 = max(u_xlat39, 0.0);

    u_xlat39 = sqrt(u_xlat39);

    u_xlat39 = u_xlat39 + (-u_xlat40);

    u_xlat13.x = (-u_xlat13.x) + FGlobals.top_radius;

    u_xlat40 = u_xlat85 + u_xlat96;

    u_xlat39 = (-u_xlat13.x) + u_xlat39;

    u_xlat13.x = (-u_xlat13.x) + u_xlat40;

    u_xlat13.x = u_xlat39 / u_xlat13.x;

    u_xlat13.x = fma(u_xlat13.x, u_xlat42.x, u_xlat94);

    u_xlat13.x = fma(u_xlat13.x, 0.5, 0.5);

    u_xlat20.z = (u_xlatb65) ? u_xlat21.x : u_xlat13.x;

    u_xlat13.x = fma(u_xlat87, u_xlat87, -1.0);

    u_xlat13.x = fma(u_xlat62.x, u_xlat13.x, u_xlat62.y);

    u_xlat13.x = max(u_xlat13.x, 0.0);

    u_xlat13.x = sqrt(u_xlat13.x);

    u_xlat87 = fma((-FGlobals.bottom_radius), u_xlat87, u_xlat13.x);

    u_xlat87 = max(u_xlat87, 0.0);

    u_xlat87 = (-u_xlat36) + u_xlat87;

    u_xlat87 = u_xlat87 / u_xlat89;

    u_xlat13.x = u_xlat87 / u_xlat92;

    u_xlat13.x = (-u_xlat13.x) + 1.0;

    u_xlat13.x = max(u_xlat13.x, 0.0);

    u_xlat87 = u_xlat87 + 1.0;

    u_xlat87 = u_xlat13.x / u_xlat87;

    u_xlat87 = fma(u_xlat87, u_xlat17.x, u_xlat93);

    u_xlat13.x = u_xlat87 + u_xlat71;

    u_xlat20.y = u_xlat13.x / u_xlat17.y;

    u_xlat87 = u_xlat87 + u_xlat97;

    u_xlat20.x = u_xlat87 / u_xlat17.y;

    u_xlat16_13.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat20.yzw, level(1.0)).xyz;

    u_xlat16_20.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat20.xzw, level(1.0)).xyz;

    u_xlat19.xzw = u_xlat19.xxx * float3(u_xlat16_20.xyz);

    u_xlat13.xyz = fma(float3(u_xlat16_13.xyz), u_xlat10.xxx, u_xlat19.xzw);

    u_xlat13.xyz = fma((-u_xlat15.xyz), u_xlat13.xyz, u_xlat18.xyz);

    u_xlat87 = fma(u_xlat64, u_xlat64, 1.0);

    u_xlat87 = u_xlat87 * 0.0596831031;

    u_xlat13.xyz = float3(u_xlat87) * u_xlat13.xyz;

    u_xlat13.xyz = u_xlat13.xyz * FGlobals.SKY_SPECTRAL_RADIANCE_TO_LUMINANCE.xyzx.xyz;

    u_xlat13.xyz = u_xlat7.xyz * u_xlat13.xyz;

    u_xlat13.xyz = u_xlat13.xyz * FGlobals._OC_ActualSunColor.www;

    u_xlat13.xyz = u_xlat13.xyz * float3(FGlobals._OC_AtmosphereExposure);

    u_xlat13.xyz = max(u_xlat13.xyz, float3(0.0, 0.0, 0.0));

    u_xlat87 = FGlobals._SkyLunarEclipse.w * FGlobals._LunarEclipseLightingInfluence;

    u_xlat11.xyz = fma(float3(u_xlat87), u_xlat11.xyz, FGlobals._OC_ActualMoonColor.xyz);

    u_xlat87 = dot(u_xlat15.xyz, float3(0.300000012, 0.589999974, 0.109999999));

    u_xlat87 = (-u_xlat87) + 1.0;

    u_xlat87 = u_xlat87 * 0.349999994;

    u_xlat18.xyz = u_xlat11.xyz * float3(u_xlat87);

    u_xlat13.xyz = fma(u_xlat18.xyz, float3(FGlobals._OC_NightScattering), u_xlat13.xyz);

    u_xlat6.xw = (-u_xlat6.xw) * FGlobals._OC_MieScatteringParams.ww;

    u_xlat32.z = exp2(u_xlat6.w);

    u_xlat32.xz = (-u_xlat32.xz) + float2(1.0, 1.0);

    u_xlat84 = u_xlat32.z * u_xlat32.z;

    u_xlat84 = u_xlat84 * u_xlat84;

    u_xlat87 = u_xlat8.w * FGlobals._OC_AtmHeightInv;

    u_xlat87 = min(u_xlat87, 1.0);

    u_xlat87 = (-u_xlat87) + 1.0;

    u_xlat87 = u_xlat87 * u_xlat87;

    u_xlat18.xyz = FGlobals._WorldSpaceCameraPos.xyzx.xyz + (-FGlobals._ScattEarthCenter.xxyz.yzw);

    u_xlat19.xzw = fma((-FGlobals._OC_ActualSunDir.xyzx.xyz), float3(9999999.0, 9999999.0, 9999999.0), FGlobals._WorldSpaceCameraPos.xyzx.xyz);

    u_xlat19.xzw = u_xlat19.xzw + (-FGlobals._ScattEarthCenter.xxyz.yzw);

    u_xlat20.xyz = (-u_xlat18.xyz) + u_xlat19.xzw;

    u_xlat10.x = dot(u_xlat20.xyz, u_xlat20.xyz);

    u_xlat10.x = rsqrt(u_xlat10.x);

    u_xlat20.xyz = u_xlat10.xxx * u_xlat20.xyz;

    u_xlat10.x = dot(u_xlat18.xyz, u_xlat18.xyz);

    u_xlat21.y = sqrt(u_xlat10.x);

    u_xlat21.x = dot(u_xlat18.xyz, u_xlat20.xyz);

    u_xlat10.x = fma(u_xlat21.x, u_xlat21.x, (-u_xlat10.x));

    u_xlat10.x = fma(FGlobals.top_radius, FGlobals.top_radius, u_xlat10.x);

    u_xlat10.x = sqrt(u_xlat10.x);

    u_xlat17.z = (-u_xlat10.x);

    u_xlat10.x = u_xlat17.z + (-u_xlat21.x);

    u_xlatb64 = 0.0<u_xlat10.x;

    u_xlat20.xyz = fma(u_xlat20.xyz, u_xlat10.xxx, u_xlat18.xyz);

    u_xlat18.xyz = (bool(u_xlatb64)) ? u_xlat20.xyz : u_xlat18.xyz;

    u_xlat69.xy = (bool(u_xlatb64)) ? u_xlat17.zw : u_xlat21.xy;

    u_xlat10.x = u_xlat69.x / u_xlat69.y;

    u_xlat18.xyz = (-u_xlat18.xyz) + u_xlat19.xzw;

    u_xlat64 = dot(u_xlat18.xyz, u_xlat18.xyz);

    u_xlat40 = sqrt(u_xlat64);

    u_xlatb18 = u_xlat10.x<0.0;

    u_xlat44 = u_xlat69.y * u_xlat69.y;

    u_xlat10.x = fma(u_xlat10.x, u_xlat10.x, -1.0);

    u_xlat70 = fma(u_xlat44, u_xlat10.x, u_xlat62.x);

    u_xlatb70 = u_xlat70>=0.0;

    u_xlatb18 = u_xlatb70 && u_xlatb18;

    u_xlat70 = dot(u_xlat69.xx, float2(u_xlat40));

    u_xlat64 = u_xlat64 + u_xlat70;

    u_xlat64 = fma(u_xlat69.y, u_xlat69.y, u_xlat64);

    u_xlat64 = sqrt(u_xlat64);

    u_xlat64 = max(u_xlat64, FGlobals.bottom_radius);

    u_xlat64 = min(u_xlat64, FGlobals.top_radius);

    u_xlat40 = u_xlat40 + u_xlat69.x;

    u_xlat40 = u_xlat40 / u_xlat64;

    u_xlat40 = max(u_xlat40, -1.0);

    u_xlat40 = min(u_xlat40, 1.0);

    if(u_xlatb18){

    u_xlat70 = FGlobals.bottom_radius * FGlobals.bottom_radius;

    u_xlat96 = fma(FGlobals.top_radius, FGlobals.top_radius, (-u_xlat70));

    u_xlat96 = sqrt(u_xlat96);

    u_xlat19.x = u_xlat64 * u_xlat64;

    u_xlat19.z = fma(u_xlat64, u_xlat64, (-u_xlat70));

    u_xlat97 = fma(u_xlat40, u_xlat40, -1.0);

    u_xlat19.x = fma(u_xlat19.x, u_xlat97, u_xlat62.y);

    u_xlat19.xz = max(u_xlat19.xz, float2(0.0, 0.0));

    u_xlat19.xz = sqrt(u_xlat19.xz);

    u_xlat19.x = fma(u_xlat64, u_xlat40, u_xlat19.x);

    u_xlat19.x = max(u_xlat19.x, 0.0);

    u_xlat97 = (-u_xlat64) + FGlobals.top_radius;

    u_xlat20.x = u_xlat96 + u_xlat19.z;

    u_xlat19.x = (-u_xlat97) + u_xlat19.x;

    u_xlat97 = (-u_xlat97) + u_xlat20.x;

    u_xlat19.x = u_xlat19.x / u_xlat97;

    u_xlat71 = u_xlat19.z / u_xlat96;

    u_xlat20.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat72.xy = float2(0.5, 0.5) / u_xlat20.xy;

    u_xlat20.xy = float2(1.0, 1.0) / u_xlat20.xy;

    u_xlat20.xy = (-u_xlat20.xy) + float2(1.0, 1.0);

    u_xlat21.x = fma(u_xlat19.x, u_xlat20.x, u_xlat72.x);

    u_xlat21.y = fma(u_xlat71, u_xlat20.y, u_xlat72.y);

    u_xlat16_19.xzw = transmittance_texture.sample(samplertransmittance_texture, u_xlat21.xy, level(0.0)).xyz;

    u_xlat70 = fma(u_xlat69.y, u_xlat69.y, (-u_xlat70));

    u_xlat70 = max(u_xlat70, 0.0);

    u_xlat70 = sqrt(u_xlat70);

    u_xlat21.x = fma(u_xlat44, u_xlat10.x, u_xlat62.y);

    u_xlat21.x = max(u_xlat21.x, 0.0);

    u_xlat21.x = sqrt(u_xlat21.x);

    u_xlat21.x = u_xlat69.x + u_xlat21.x;

    u_xlat21.x = max(u_xlat21.x, 0.0);

    u_xlat47.x = (-u_xlat69.y) + FGlobals.top_radius;

    u_xlat73 = u_xlat96 + u_xlat70;

    u_xlat21.x = (-u_xlat47.x) + u_xlat21.x;

    u_xlat47.x = (-u_xlat47.x) + u_xlat73;

    u_xlat21.x = u_xlat21.x / u_xlat47.x;

    u_xlat70 = u_xlat70 / u_xlat96;

    u_xlat21.x = fma(u_xlat21.x, u_xlat20.x, u_xlat72.x);

    u_xlat21.y = fma(u_xlat70, u_xlat20.y, u_xlat72.y);

    u_xlat16_20.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat21.xy, level(0.0)).xyz;

    u_xlat16_19.xzw = u_xlat16_19.xzw / u_xlat16_20.xyz;

    u_xlat19.xzw = min(float3(u_xlat16_19.xzw), float3(1.0, 1.0, 1.0));

    } else {

    u_xlat70 = FGlobals.bottom_radius * FGlobals.bottom_radius;

    u_xlat96 = fma(FGlobals.top_radius, FGlobals.top_radius, (-u_xlat70));

    u_xlat96 = sqrt(u_xlat96);

    u_xlat20.x = fma(u_xlat69.y, u_xlat69.y, (-u_xlat70));

    u_xlat20.y = fma(u_xlat44, u_xlat10.x, u_xlat62.y);

    u_xlat20.xy = max(u_xlat20.xy, float2(0.0, 0.0));

    u_xlat20.xy = sqrt(u_xlat20.xy);

    u_xlat46 = (-u_xlat69.x) + u_xlat20.y;

    u_xlat46 = max(u_xlat46, 0.0);

    u_xlat72.x = (-u_xlat69.y) + FGlobals.top_radius;

    u_xlat98 = u_xlat96 + u_xlat20.x;

    u_xlat46 = (-u_xlat72.x) + u_xlat46;

    u_xlat72.x = (-u_xlat72.x) + u_xlat98;

    u_xlat46 = u_xlat46 / u_xlat72.x;

    u_xlat20.x = u_xlat20.x / u_xlat96;

    u_xlat72.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat21.xy = float2(0.5, 0.5) / u_xlat72.xy;

    u_xlat72.xy = float2(1.0, 1.0) / u_xlat72.xy;

    u_xlat72.xy = (-u_xlat72.xy) + float2(1.0, 1.0);

    u_xlat22.x = fma(u_xlat46, u_xlat72.x, u_xlat21.x);

    u_xlat22.y = fma(u_xlat20.x, u_xlat72.y, u_xlat21.y);

    u_xlat16_22.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat22.xy, level(0.0)).xyz;

    u_xlat20.x = u_xlat64 * u_xlat64;

    u_xlat70 = fma(u_xlat64, u_xlat64, (-u_xlat70));

    u_xlat70 = max(u_xlat70, 0.0);

    u_xlat70 = sqrt(u_xlat70);

    u_xlat46 = fma(u_xlat40, u_xlat40, -1.0);

    u_xlat20.x = fma(u_xlat20.x, u_xlat46, u_xlat62.y);

    u_xlat20.x = max(u_xlat20.x, 0.0);

    u_xlat20.x = sqrt(u_xlat20.x);

    u_xlat20.x = fma((-u_xlat64), u_xlat40, u_xlat20.x);

    u_xlat20.x = max(u_xlat20.x, 0.0);

    u_xlat46 = (-u_xlat64) + FGlobals.top_radius;

    u_xlat73 = u_xlat96 + u_xlat70;

    u_xlat20.x = (-u_xlat46) + u_xlat20.x;

    u_xlat46 = (-u_xlat46) + u_xlat73;

    u_xlat20.x = u_xlat20.x / u_xlat46;

    u_xlat70 = u_xlat70 / u_xlat96;

    u_xlat20.x = fma(u_xlat20.x, u_xlat72.x, u_xlat21.x);

    u_xlat20.y = fma(u_xlat70, u_xlat72.y, u_xlat21.y);

    u_xlat16_20.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat20.xy, level(0.0)).xyz;

    u_xlat16_20.xyz = u_xlat16_22.xyz / u_xlat16_20.xyz;

    u_xlat19.xzw = min(float3(u_xlat16_20.xyz), float3(1.0, 1.0, 1.0));

    }

    u_xlat19.xzw = u_xlat19.xzw + float3(-1.0, -1.0, -1.0);

    u_xlat19.xzw = fma(u_xlat19.xzw, float3(0.5, 0.5, 0.5), float3(1.0, 1.0, 1.0));

    u_xlat70 = FGlobals._OC_LightDir.xyzx.y * -10.0;

    u_xlat70 = clamp(u_xlat70, 0.0f, 1.0f);

    u_xlat96 = dot((-u_xlat5.xyz), FGlobals._OC_LightDir.xyzx.xyz);

    u_xlat96 = fma(u_xlat96, 0.5, 0.5);

    u_xlat20.x = min(FGlobals._OC_MieScatteringParams.y, 0.93809998);

    u_xlat46 = u_xlat20.x * u_xlat20.x;

    u_xlat46 = u_xlat20.x * u_xlat46;

    u_xlat46 = u_xlat46 * 0.550000012;

    u_xlat20.x = fma(u_xlat20.x, 1.54999995, (-u_xlat46));

    u_xlat46 = fma((-u_xlat20.x), u_xlat20.x, 1.0);

    u_xlat96 = fma((-u_xlat20.x), u_xlat96, 1.0);

    u_xlat96 = u_xlat96 * u_xlat96;

    u_xlat96 = u_xlat96 * 12.566371;

    u_xlat96 = u_xlat46 / u_xlat96;

    u_xlat96 = u_xlat96 * FGlobals._OC_MieScatteringParams.x;

    u_xlat21.xyz = float3(u_xlat96) * FGlobals._OC_LightColor.xyzx.xyz;

    u_xlat22.xyz = float3(u_xlat84) * u_xlat21.xyz;

    u_xlat22.xyz = float3(u_xlat87) * u_xlat22.xyz;

    u_xlat22.xyz = float3(u_xlat70) * u_xlat22.xyz;

    u_xlat13.xyz = fma(u_xlat22.xyz, u_xlat19.xzw, u_xlat13.xyz);

    u_xlat32.x = u_xlat32.x * FGlobals._OC_FogColor.w;

    u_xlat5.xyz = u_xlat5.xyz * float3(1.0, 0.0, 1.0);

    u_xlat84 = dot((-FGlobals._ScattEarthCenter.xxyz.yzw), (-FGlobals._ScattEarthCenter.xxyz.yzw));

    u_xlat22.x = sqrt(u_xlat84);

    u_xlat22.y = dot((-FGlobals._ScattEarthCenter.xxyz.yw), u_xlat5.xz);

    u_xlat96 = fma(u_xlat22.y, u_xlat22.y, (-u_xlat84));

    u_xlat96 = fma(FGlobals.top_radius, FGlobals.top_radius, u_xlat96);

    u_xlat96 = sqrt(u_xlat96);

    u_xlat23.x = (-u_xlat96);

    u_xlat96 = (-u_xlat22.y) + u_xlat23.x;

    u_xlatb19 = 0.0<u_xlat96;

    u_xlati71 = int((FGlobals.top_radius>=u_xlat22.x) ? 0xFFFFFFFFu : uint(0));

    u_xlati97 = (u_xlatb19) ? int(0xffffffffu) : u_xlati71;

    if((uint(u_xlati97))!=uint(0)){

    u_xlat24.xyz = fma(u_xlat5.xyz, float3(u_xlat96), (-FGlobals._ScattEarthCenter.xxyz.yzw));

    u_xlat24.xyz = (bool(u_xlatb19)) ? u_xlat24.xyz : (-FGlobals._ScattEarthCenter.xxyz.yzw);

    u_xlat23.y = FGlobals.top_radius;

    u_xlat19.xw = (bool(u_xlatb19)) ? u_xlat23.xy : u_xlat22.yx;

    u_xlat31.x = u_xlat19.x / u_xlat19.w;

    u_xlat96 = dot(u_xlat24.xyz, (-FGlobals._OC_ActualSunDir.xyzx.xyz));

    u_xlat96 = u_xlat96 / u_xlat19.w;

    u_xlat5.x = dot(u_xlat5.xz, (-FGlobals._OC_ActualSunDir.xyzx.xz));

    u_xlatb57 = u_xlat31.x<0.0;

    u_xlat72.x = u_xlat19.w * u_xlat19.w;

    u_xlat31.x = fma(u_xlat31.x, u_xlat31.x, -1.0);

    u_xlat98 = FGlobals.bottom_radius * FGlobals.bottom_radius;

    u_xlat99 = fma(u_xlat72.x, u_xlat31.x, u_xlat98);

    u_xlatb99 = u_xlat99>=0.0;

    u_xlatb57 = u_xlatb57 && u_xlatb99;

    u_xlat99 = fma(FGlobals.top_radius, FGlobals.top_radius, (-u_xlat98));

    u_xlat99 = sqrt(u_xlat99);

    u_xlat48.x = fma(u_xlat19.w, u_xlat19.w, (-u_xlat98));

    u_xlat48.x = max(u_xlat48.x, 0.0);

    u_xlat48.x = sqrt(u_xlat48.x);

    u_xlat31.x = fma(u_xlat72.x, u_xlat31.x, u_xlat62.y);

    u_xlat31.x = max(u_xlat31.x, 0.0);

    u_xlat31.x = sqrt(u_xlat31.x);

    u_xlat31.x = u_xlat31.x + (-u_xlat19.x);

    u_xlat31.x = max(u_xlat31.x, 0.0);

    u_xlat100 = (-u_xlat19.w) + FGlobals.top_radius;

    u_xlat23.x = u_xlat99 + u_xlat48.x;

    u_xlat31.x = u_xlat31.x + (-u_xlat100);

    u_xlat23.x = (-u_xlat100) + u_xlat23.x;

    u_xlat31.x = u_xlat31.x / u_xlat23.x;

    u_xlat49 = u_xlat48.x / u_xlat99;

    u_xlat75.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat24.xy = float2(0.5, 0.5) / u_xlat75.xy;

    u_xlat75.xy = float2(1.0, 1.0) / u_xlat75.xy;

    u_xlat75.xy = (-u_xlat75.xy) + float2(1.0, 1.0);

    u_xlat25.x = fma(u_xlat31.x, u_xlat75.x, u_xlat24.x);

    u_xlat25.y = fma(u_xlat49, u_xlat75.y, u_xlat24.y);

    u_xlat24.xyz = float3(transmittance_texture.sample(samplertransmittance_texture, u_xlat25.xy, level(0.0)).xyz);

    u_xlat24.xyz = (bool(u_xlatb57)) ? float3(0.0, 0.0, 0.0) : u_xlat24.xyz;

    u_xlat25.w = fma(u_xlat49, u_xlat16.x, u_xlat68.x);

    u_xlat31.x = fma(u_xlat19.x, u_xlat19.x, (-u_xlat72.x));

    u_xlat31.x = fma(FGlobals.bottom_radius, FGlobals.bottom_radius, u_xlat31.x);

    u_xlat72.x = max(u_xlat31.x, 0.0);

    u_xlat72.x = sqrt(u_xlat72.x);

    u_xlat72.x = (-u_xlat19.x) + (-u_xlat72.x);

    u_xlat97 = u_xlat19.w + (-FGlobals.bottom_radius);

    u_xlatb49 = u_xlat97==u_xlat48.x;

    u_xlat72.x = (-u_xlat97) + u_xlat72.x;

    u_xlat97 = (-u_xlat97) + u_xlat48.x;

    u_xlat97 = u_xlat72.x / u_xlat97;

    u_xlat97 = (u_xlatb49) ? 0.0 : u_xlat97;

    u_xlat97 = fma(u_xlat97, u_xlat42.x, u_xlat94);

    u_xlat97 = fma((-u_xlat97), 0.5, 0.5);

    u_xlat31.x = fma(u_xlat99, u_xlat99, u_xlat31.x);

    u_xlat31.x = max(u_xlat31.x, 0.0);

    u_xlat31.x = sqrt(u_xlat31.x);

    u_xlat31.x = u_xlat31.x + (-u_xlat19.x);

    u_xlat31.x = (-u_xlat100) + u_xlat31.x;

    u_xlat31.x = u_xlat31.x / u_xlat23.x;

    u_xlat31.x = fma(u_xlat31.x, u_xlat42.x, u_xlat94);

    u_xlat31.x = fma(u_xlat31.x, 0.5, 0.5);

    u_xlat25.z = (u_xlatb57) ? u_xlat97 : u_xlat31.x;

    u_xlat31.x = fma(u_xlat96, u_xlat96, -1.0);

    u_xlat31.x = fma(u_xlat98, u_xlat31.x, u_xlat62.y);

    u_xlat31.x = max(u_xlat31.x, 0.0);

    u_xlat31.x = sqrt(u_xlat31.x);

    u_xlat31.x = fma((-FGlobals.bottom_radius), u_xlat96, u_xlat31.x);

    u_xlat31.x = max(u_xlat31.x, 0.0);

    u_xlat31.x = (-u_xlat36) + u_xlat31.x;

    u_xlat57 = (-u_xlat36) + u_xlat99;

    u_xlat31.x = u_xlat31.x / u_xlat57;

    u_xlat57 = u_xlat91 / u_xlat57;

    u_xlat57 = u_xlat31.x / u_xlat57;

    u_xlat57 = (-u_xlat57) + 1.0;

    u_xlat57 = max(u_xlat57, 0.0);

    u_xlat31.x = u_xlat31.x + 1.0;

    u_xlat31.x = u_xlat57 / u_xlat31.x;

    u_xlat31.x = fma(u_xlat31.x, u_xlat17.x, u_xlat93);

    u_xlat57 = u_xlat5.x + 1.0;

    u_xlat57 = u_xlat45 * u_xlat57;

    u_xlat91 = u_xlat57 * 0.5;

    u_xlat91 = floor(u_xlat91);

    u_xlat57 = fma(u_xlat57, 0.5, (-u_xlat91));

    u_xlat31.x = u_xlat31.x + u_xlat91;

    u_xlat25.y = u_xlat31.x / u_xlat17.y;

    u_xlat31.x = u_xlat31.x + 1.0;

    u_xlat25.x = u_xlat31.x / u_xlat17.y;

    u_xlat16_23.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat25.yzw, level(1.0)).xyz;

    u_xlat31.x = (-u_xlat57) + 1.0;

    u_xlat16_25.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat25.xzw, level(1.0)).xyz;

    u_xlat25.xyz = float3(u_xlat57) * float3(u_xlat16_25.xyz);

    u_xlat23.xyz = fma(float3(u_xlat16_23.xyz), u_xlat31.xxx, u_xlat25.xyz);

    u_xlat5.x = fma(u_xlat5.x, u_xlat5.x, 1.0);

    u_xlat5.x = u_xlat5.x * 0.0596831031;

    u_xlat5.xyz = u_xlat5.xxx * u_xlat23.xyz;

    } else {

    u_xlat24.x = float(1.0);

    u_xlat24.y = float(1.0);

    u_xlat24.z = float(1.0);

    u_xlat5.x = float(0.0);

    u_xlat5.y = float(0.0);

    u_xlat5.z = float(0.0);

    }

    u_xlat5.xyz = u_xlat5.xyz * FGlobals.SKY_SPECTRAL_RADIANCE_TO_LUMINANCE.xyzx.xyz;

    u_xlat91 = dot(u_xlat24.xyz, float3(0.300000012, 0.589999974, 0.109999999));

    u_xlat91 = (-u_xlat91) + 1.0;

    u_xlat91 = u_xlat91 * 0.349999994;

    u_xlat23.xyz = u_xlat11.xyz * float3(u_xlat91);

    u_xlat23.xyz = u_xlat23.xyz * float3(FGlobals._OC_NightScattering);

    u_xlat5.xyz = fma(u_xlat5.xyz, float3(FGlobals._OC_AtmosphereExposure), u_xlat23.xyz);

    u_xlat6.x = exp2(u_xlat6.x);

    u_xlat6.x = (-u_xlat6.x) + 1.0;

    u_xlat6.x = u_xlat6.x * u_xlat6.x;

    u_xlat6.x = u_xlat6.x * u_xlat6.x;

    if(u_xlatb18){

    u_xlat91 = FGlobals.bottom_radius * FGlobals.bottom_radius;

    u_xlat96 = fma(FGlobals.top_radius, FGlobals.top_radius, (-u_xlat91));

    u_xlat96 = sqrt(u_xlat96);

    u_xlat19.x = u_xlat64 * u_xlat64;

    u_xlat97 = fma(u_xlat64, u_xlat64, (-u_xlat91));

    u_xlat19.w = max(u_xlat97, 0.0);

    u_xlat72.x = fma(u_xlat40, u_xlat40, -1.0);

    u_xlat19.x = fma(u_xlat19.x, u_xlat72.x, u_xlat62.y);

    u_xlat19.x = max(u_xlat19.x, 0.0);

    u_xlat19.xw = sqrt(u_xlat19.xw);

    u_xlat19.x = fma(u_xlat64, u_xlat40, u_xlat19.x);

    u_xlat19.x = max(u_xlat19.x, 0.0);

    u_xlat72.x = (-u_xlat64) + FGlobals.top_radius;

    u_xlat98 = u_xlat96 + u_xlat19.w;

    u_xlat19.x = u_xlat19.x + (-u_xlat72.x);

    u_xlat72.x = (-u_xlat72.x) + u_xlat98;

    u_xlat19.x = u_xlat19.x / u_xlat72.x;

    u_xlat97 = u_xlat19.w / u_xlat96;

    u_xlat72.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat48.xz = float2(0.5, 0.5) / u_xlat72.xy;

    u_xlat72.xy = float2(1.0, 1.0) / u_xlat72.xy;

    u_xlat72.xy = (-u_xlat72.xy) + float2(1.0, 1.0);

    u_xlat23.x = fma(u_xlat19.x, u_xlat72.x, u_xlat48.x);

    u_xlat23.y = fma(u_xlat97, u_xlat72.y, u_xlat48.z);

    u_xlat16_23.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat23.xy, level(0.0)).xyz;

    u_xlat91 = fma(u_xlat69.y, u_xlat69.y, (-u_xlat91));

    u_xlat91 = max(u_xlat91, 0.0);

    u_xlat91 = sqrt(u_xlat91);

    u_xlat19.x = fma(u_xlat44, u_xlat10.x, u_xlat62.y);

    u_xlat19.x = max(u_xlat19.x, 0.0);

    u_xlat19.x = sqrt(u_xlat19.x);

    u_xlat19.x = u_xlat69.x + u_xlat19.x;

    u_xlat19.x = max(u_xlat19.x, 0.0);

    u_xlat97 = (-u_xlat69.y) + FGlobals.top_radius;

    u_xlat99 = u_xlat96 + u_xlat91;

    u_xlat19.x = (-u_xlat97) + u_xlat19.x;

    u_xlat97 = (-u_xlat97) + u_xlat99;

    u_xlat19.x = u_xlat19.x / u_xlat97;

    u_xlat91 = u_xlat91 / u_xlat96;

    u_xlat24.x = fma(u_xlat19.x, u_xlat72.x, u_xlat48.x);

    u_xlat24.y = fma(u_xlat91, u_xlat72.y, u_xlat48.z);

    u_xlat16_24.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat24.xy, level(0.0)).xyz;

    u_xlat16_23.xyz = u_xlat16_23.xyz / u_xlat16_24.xyz;

    u_xlat23.xyz = min(float3(u_xlat16_23.xyz), float3(1.0, 1.0, 1.0));

    } else {

    u_xlat91 = FGlobals.bottom_radius * FGlobals.bottom_radius;

    u_xlat96 = fma(FGlobals.top_radius, FGlobals.top_radius, (-u_xlat91));

    u_xlat96 = sqrt(u_xlat96);

    u_xlat19.x = fma(u_xlat69.y, u_xlat69.y, (-u_xlat91));

    u_xlat19.x = max(u_xlat19.x, 0.0);

    u_xlat97 = fma(u_xlat44, u_xlat10.x, u_xlat62.y);

    u_xlat19.w = max(u_xlat97, 0.0);

    u_xlat19.xw = sqrt(u_xlat19.xw);

    u_xlat97 = (-u_xlat69.x) + u_xlat19.w;

    u_xlat97 = max(u_xlat97, 0.0);

    u_xlat72.x = (-u_xlat69.y) + FGlobals.top_radius;

    u_xlat98 = u_xlat96 + u_xlat19.x;


    u_xlat97 = u_xlat97 + (-u_xlat72.x);

    u_xlat72.x = (-u_xlat72.x) + u_xlat98;

    u_xlat97 = u_xlat97 / u_xlat72.x;

    u_xlat19.x = u_xlat19.x / u_xlat96;

    u_xlat72.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat48.xz = float2(0.5, 0.5) / u_xlat72.xy;

    u_xlat72.xy = float2(1.0, 1.0) / u_xlat72.xy;

    u_xlat72.xy = (-u_xlat72.xy) + float2(1.0, 1.0);

    u_xlat24.x = fma(u_xlat97, u_xlat72.x, u_xlat48.x);

    u_xlat24.y = fma(u_xlat19.x, u_xlat72.y, u_xlat48.z);

    u_xlat16_24.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat24.xy, level(0.0)).xyz;

    u_xlat19.x = u_xlat64 * u_xlat64;

    u_xlat91 = fma(u_xlat64, u_xlat64, (-u_xlat91));

    u_xlat91 = max(u_xlat91, 0.0);

    u_xlat91 = sqrt(u_xlat91);

    u_xlat97 = fma(u_xlat40, u_xlat40, -1.0);

    u_xlat19.x = fma(u_xlat19.x, u_xlat97, u_xlat62.y);

    u_xlat19.x = max(u_xlat19.x, 0.0);

    u_xlat19.x = sqrt(u_xlat19.x);

    u_xlat19.x = fma((-u_xlat64), u_xlat40, u_xlat19.x);

    u_xlat19.x = max(u_xlat19.x, 0.0);

    u_xlat97 = (-u_xlat64) + FGlobals.top_radius;

    u_xlat99 = u_xlat96 + u_xlat91;

    u_xlat19.x = (-u_xlat97) + u_xlat19.x;

    u_xlat97 = (-u_xlat97) + u_xlat99;

    u_xlat19.x = u_xlat19.x / u_xlat97;

    u_xlat91 = u_xlat91 / u_xlat96;

    u_xlat25.x = fma(u_xlat19.x, u_xlat72.x, u_xlat48.x);

    u_xlat25.y = fma(u_xlat91, u_xlat72.y, u_xlat48.z);

    u_xlat16_25.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat25.xy, level(0.0)).xyz;

    u_xlat16_24.xyz = u_xlat16_24.xyz / u_xlat16_25.xyz;

    u_xlat23.xyz = min(float3(u_xlat16_24.xyz), float3(1.0, 1.0, 1.0));

    }

    u_xlat23.xyz = u_xlat23.xyz + float3(-1.0, -1.0, -1.0);

    u_xlat23.xyz = fma(u_xlat23.xyz, float3(0.5, 0.5, 0.5), float3(1.0, 1.0, 1.0));

    u_xlat21.xyz = u_xlat6.xxx * u_xlat21.xyz;

    u_xlat21.xyz = float3(u_xlat87) * u_xlat21.xyz;

    u_xlat21.xyz = float3(u_xlat70) * u_xlat21.xyz;

    u_xlat5.xyz = fma(u_xlat21.xyz, u_xlat23.xyz, u_xlat5.xyz);

    u_xlat5.xyz = u_xlat5.xyz * FGlobals._OC_FogColor.xyz;

    u_xlat5.xyz = fma(u_xlat5.xyz, u_xlat15.xyz, u_xlat13.xyz);

    u_xlat13.y = max(u_xlat8.w, 1.0);

    u_xlat13.x = float(0.0);

    u_xlat13.z = float(0.0);

    u_xlat13.xyz = u_xlat13.xyz + (-FGlobals._ScattEarthCenter.xxyz.yzw);

    u_xlat9.y = u_xlat6.z;

    u_xlat9.xyz = u_xlat9.xyz + (-FGlobals._ScattEarthCenter.xxyz.yzw);

    u_xlat15.xyz = (-u_xlat13.xyz) + u_xlat9.xyz;

    u_xlat6.x = dot(u_xlat15.xyz, u_xlat15.xyz);

    u_xlat6.x = rsqrt(u_xlat6.x);

    u_xlat15.xyz = u_xlat6.xxx * u_xlat15.xyz;

    u_xlat6.x = dot(u_xlat13.xyz, u_xlat13.xyz);

    u_xlat21.x = sqrt(u_xlat6.x);

    u_xlat21.y = dot(u_xlat13.xyz, u_xlat15.xyz);

    u_xlat58.x = fma(u_xlat21.y, u_xlat21.y, (-u_xlat6.x));

    u_xlat58.x = fma(FGlobals.top_radius, FGlobals.top_radius, u_xlat58.x);

    u_xlat58.x = sqrt(u_xlat58.x);

    u_xlat23.x = (-u_xlat58.x);

    u_xlat58.x = (-u_xlat21.y) + u_xlat23.x;

    u_xlatb91 = 0.0<u_xlat58.x;

    u_xlat24.xyz = fma(u_xlat15.xyz, u_xlat58.xxx, u_xlat13.xyz);

    u_xlat24.xyz = (bool(u_xlatb91)) ? u_xlat24.xyz : u_xlat13.xyz;

    u_xlat23.y = FGlobals.top_radius;

    u_xlat19.xw = (bool(u_xlatb91)) ? u_xlat23.xy : u_xlat21.yx;

    u_xlat58.x = u_xlat19.x / u_xlat19.w;

    u_xlat91 = dot(u_xlat24.xyz, (-FGlobals._OC_ActualSunDir.xyzx.xyz));

    u_xlat96 = u_xlat91 / u_xlat19.w;

    u_xlat15.x = dot(u_xlat15.xyz, (-FGlobals._OC_ActualSunDir.xyzx.xyz));

    u_xlat9.xyz = u_xlat9.xyz + (-u_xlat24.xyz);

    u_xlat9.x = dot(u_xlat9.xyz, u_xlat9.xyz);

    u_xlat35.x = sqrt(u_xlat9.x);

    u_xlatb61 = u_xlat58.x<0.0;

    u_xlat41.x = u_xlat19.w * u_xlat19.w;

    u_xlat58.x = fma(u_xlat58.x, u_xlat58.x, -1.0);

    u_xlat67 = fma(u_xlat41.x, u_xlat58.x, u_xlat62.x);

    u_xlatb67 = u_xlat67>=0.0;

    u_xlatb61 = u_xlatb61 && u_xlatb67;

    u_xlat67 = dot(u_xlat19.xx, u_xlat35.xx);

    u_xlat9.x = u_xlat9.x + u_xlat67;

    u_xlat9.x = fma(u_xlat19.w, u_xlat19.w, u_xlat9.x);

    u_xlat9.x = sqrt(u_xlat9.x);

    u_xlat9.x = max(u_xlat9.x, FGlobals.bottom_radius);

    u_xlat9.x = min(u_xlat9.x, FGlobals.top_radius);

    u_xlat67 = u_xlat35.x + u_xlat19.x;

    u_xlat72.x = u_xlat67 / u_xlat9.x;

    u_xlat72.x = max(u_xlat72.x, -1.0);

    u_xlat72.x = min(u_xlat72.x, 1.0);

    if(u_xlatb61){

    u_xlat98 = u_xlat9.x * u_xlat9.x;

    u_xlat47.x = fma(u_xlat9.x, u_xlat9.x, (-u_xlat62.x));

    u_xlat47.x = max(u_xlat47.x, 0.0);

    u_xlat47.x = sqrt(u_xlat47.x);

    u_xlat99 = fma(u_xlat72.x, u_xlat72.x, -1.0);

    u_xlat98 = fma(u_xlat98, u_xlat99, u_xlat62.y);

    u_xlat98 = max(u_xlat98, 0.0);

    u_xlat98 = sqrt(u_xlat98);

    u_xlat98 = fma(u_xlat9.x, u_xlat72.x, u_xlat98);

    u_xlat98 = max(u_xlat98, 0.0);

    u_xlat99 = (-u_xlat9.x) + FGlobals.top_radius;

    u_xlat48.x = u_xlat85 + u_xlat47.x;

    u_xlat98 = u_xlat98 + (-u_xlat99);

    u_xlat99 = (-u_xlat99) + u_xlat48.x;

    u_xlat98 = u_xlat98 / u_xlat99;

    u_xlat47.x = u_xlat47.x / u_xlat85;

    u_xlat48.xz = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat23.xy = float2(0.5, 0.5) / u_xlat48.xz;

    u_xlat48.xz = float2(1.0, 1.0) / u_xlat48.xz;

    u_xlat48.xz = (-u_xlat48.xz) + float2(1.0, 1.0);

    u_xlat24.x = fma(u_xlat98, u_xlat48.x, u_xlat23.x);

    u_xlat24.y = fma(u_xlat47.x, u_xlat48.z, u_xlat23.y);

    u_xlat16_24.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat24.xy, level(0.0)).xyz;

    u_xlat98 = fma(u_xlat19.w, u_xlat19.w, (-u_xlat62.x));

    u_xlat98 = max(u_xlat98, 0.0);

    u_xlat98 = sqrt(u_xlat98);

    u_xlat47.x = fma(u_xlat41.x, u_xlat58.x, u_xlat62.y);

    u_xlat47.x = max(u_xlat47.x, 0.0);

    u_xlat47.x = sqrt(u_xlat47.x);

    u_xlat47.x = u_xlat19.x + u_xlat47.x;

    u_xlat47.x = max(u_xlat47.x, 0.0);

    u_xlat99 = (-u_xlat19.w) + FGlobals.top_radius;

    u_xlat75.x = u_xlat85 + u_xlat98;

    u_xlat47.x = (-u_xlat99) + u_xlat47.x;

    u_xlat99 = (-u_xlat99) + u_xlat75.x;

    u_xlat47.x = u_xlat47.x / u_xlat99;

    u_xlat98 = u_xlat98 / u_xlat85;

    u_xlat25.x = fma(u_xlat47.x, u_xlat48.x, u_xlat23.x);

    u_xlat25.y = fma(u_xlat98, u_xlat48.z, u_xlat23.y);

    u_xlat16_23.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat25.xy, level(0.0)).xyz;

    u_xlat16_23.xyz = u_xlat16_24.xyz / u_xlat16_23.xyz;

    u_xlat23.xyz = min(float3(u_xlat16_23.xyz), float3(1.0, 1.0, 1.0));

    } else {

    u_xlat98 = fma(u_xlat19.w, u_xlat19.w, (-u_xlat62.x));

    u_xlat98 = max(u_xlat98, 0.0);

    u_xlat98 = sqrt(u_xlat98);

    u_xlat58.x = fma(u_xlat41.x, u_xlat58.x, u_xlat62.y);

    u_xlat58.x = max(u_xlat58.x, 0.0);

    u_xlat58.x = sqrt(u_xlat58.x);

    u_xlat58.x = u_xlat58.x + (-u_xlat19.x);

    u_xlat58.x = max(u_xlat58.x, 0.0);

    u_xlat47.x = (-u_xlat19.w) + FGlobals.top_radius;

    u_xlat99 = u_xlat85 + u_xlat98;

    u_xlat58.x = u_xlat58.x + (-u_xlat47.x);

    u_xlat47.x = (-u_xlat47.x) + u_xlat99;

    u_xlat58.x = u_xlat58.x / u_xlat47.x;

    u_xlat98 = u_xlat98 / u_xlat85;

    u_xlat47.xz = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat48.xz = float2(0.5, 0.5) / u_xlat47.xz;

    u_xlat47.xz = float2(1.0, 1.0) / u_xlat47.xz;

    u_xlat47.xz = (-u_xlat47.xz) + float2(1.0, 1.0);

    u_xlat24.x = fma(u_xlat58.x, u_xlat47.x, u_xlat48.x);

    u_xlat24.y = fma(u_xlat98, u_xlat47.z, u_xlat48.z);

    u_xlat16_24.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat24.xy, level(0.0)).xyz;

    u_xlat58.x = u_xlat9.x * u_xlat9.x;

    u_xlat98 = fma(u_xlat9.x, u_xlat9.x, (-u_xlat62.x));

    u_xlat98 = max(u_xlat98, 0.0);

    u_xlat98 = sqrt(u_xlat98);

    u_xlat101 = fma(u_xlat72.x, u_xlat72.x, -1.0);

    u_xlat58.x = fma(u_xlat58.x, u_xlat101, u_xlat62.y);

    u_xlat58.x = max(u_xlat58.x, 0.0);

    u_xlat58.x = sqrt(u_xlat58.x);

    u_xlat58.x = fma((-u_xlat9.x), u_xlat72.x, u_xlat58.x);

    u_xlat58.x = max(u_xlat58.x, 0.0);

    u_xlat72.x = (-u_xlat9.x) + FGlobals.top_radius;

    u_xlat101 = u_xlat85 + u_xlat98;

    u_xlat58.x = u_xlat58.x + (-u_xlat72.x);

    u_xlat72.x = (-u_xlat72.x) + u_xlat101;

    u_xlat58.x = u_xlat58.x / u_xlat72.x;

    u_xlat72.x = u_xlat98 / u_xlat85;

    u_xlat25.x = fma(u_xlat58.x, u_xlat47.x, u_xlat48.x);

    u_xlat25.y = fma(u_xlat72.x, u_xlat47.z, u_xlat48.z);

    u_xlat16_25.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat25.xy, level(0.0)).xyz;

    u_xlat16_24.xyz = u_xlat16_24.xyz / u_xlat16_25.xyz;

    u_xlat23.xyz = min(float3(u_xlat16_24.xyz), float3(1.0, 1.0, 1.0));

    }

    u_xlat58.x = fma(u_xlat19.w, u_xlat19.w, (-u_xlat62.x));

    u_xlat58.x = max(u_xlat58.x, 0.0);

    u_xlat58.x = sqrt(u_xlat58.x);

    u_xlat72.x = u_xlat58.x / u_xlat85;

    u_xlat24.w = fma(u_xlat72.x, u_xlat16.x, u_xlat68.x);

    u_xlat41.x = fma(u_xlat19.x, u_xlat19.x, (-u_xlat41.x));

    u_xlat41.x = fma(FGlobals.bottom_radius, FGlobals.bottom_radius, u_xlat41.x);

    u_xlat72.x = max(u_xlat41.x, 0.0);

    u_xlat72.x = sqrt(u_xlat72.x);

    u_xlat72.x = (-u_xlat19.x) + (-u_xlat72.x);

    u_xlat98 = u_xlat19.w + (-FGlobals.bottom_radius);

    u_xlatb47 = u_xlat58.x==u_xlat98;

    u_xlat72.x = (-u_xlat98) + u_xlat72.x;

    u_xlat98 = u_xlat58.x + (-u_xlat98);

    u_xlat72.x = u_xlat72.x / u_xlat98;

    u_xlat72.x = (u_xlatb47) ? 0.0 : u_xlat72.x;

    u_xlat72.x = fma(u_xlat72.x, u_xlat42.x, u_xlat94);

    u_xlat72.x = fma((-u_xlat72.x), 0.5, 0.5);

    u_xlat41.x = fma(u_xlat85, u_xlat85, u_xlat41.x);

    u_xlat41.x = max(u_xlat41.x, 0.0);

    u_xlat41.x = sqrt(u_xlat41.x);

    u_xlat41.x = u_xlat41.x + (-u_xlat19.x);

    u_xlat19.x = (-u_xlat19.w) + FGlobals.top_radius;

    u_xlat58.x = u_xlat85 + u_xlat58.x;

    u_xlat41.x = u_xlat41.x + (-u_xlat19.x);

    u_xlat58.x = (-u_xlat19.x) + u_xlat58.x;

    u_xlat58.x = u_xlat41.x / u_xlat58.x;

    u_xlat58.x = fma(u_xlat58.x, u_xlat42.x, u_xlat94);

    u_xlat58.x = fma(u_xlat58.x, 0.5, 0.5);

    u_xlat24.z = (u_xlatb61) ? u_xlat72.x : u_xlat58.x;

    u_xlat58.x = fma(u_xlat96, u_xlat96, -1.0);

    u_xlat58.x = fma(u_xlat62.x, u_xlat58.x, u_xlat62.y);

    u_xlat58.x = max(u_xlat58.x, 0.0);

    u_xlat58.x = sqrt(u_xlat58.x);

    u_xlat58.x = fma((-FGlobals.bottom_radius), u_xlat96, u_xlat58.x);

    u_xlat58.x = max(u_xlat58.x, 0.0);

    u_xlat58.x = (-u_xlat36) + u_xlat58.x;

    u_xlat58.x = u_xlat58.x / u_xlat89;

    u_xlat41.x = u_xlat58.x / u_xlat92;

    u_xlat41.x = (-u_xlat41.x) + 1.0;

    u_xlat41.x = max(u_xlat41.x, 0.0);

    u_xlat58.x = u_xlat58.x + 1.0;

    u_xlat58.x = u_xlat41.x / u_xlat58.x;

    u_xlat58.x = fma(u_xlat58.x, u_xlat17.x, u_xlat93);

    u_xlat41.x = u_xlat15.x + 1.0;

    u_xlat41.x = u_xlat45 * u_xlat41.x;

    u_xlat96 = u_xlat41.x * 0.5;

    u_xlat96 = floor(u_xlat96);

    u_xlat41.x = fma(u_xlat41.x, 0.5, (-u_xlat96));

    u_xlat19.x = u_xlat58.x + u_xlat96;

    u_xlat24.y = u_xlat19.x / u_xlat17.y;

    u_xlat19.x = u_xlat96 + 1.0;

    u_xlat58.x = u_xlat58.x + u_xlat19.x;

    u_xlat24.x = u_xlat58.x / u_xlat17.y;

    u_xlat16_25.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat24.yzw, level(1.0)).xyz;

    u_xlat58.x = (-u_xlat41.x) + 1.0;

    u_xlat16_24.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat24.xzw, level(1.0)).xyz;

    u_xlat24.xyz = u_xlat41.xxx * float3(u_xlat16_24.xyz);

    u_xlat24.xyz = fma(float3(u_xlat16_25.xyz), u_xlat58.xxx, u_xlat24.xyz);

    u_xlat35.x = fma(u_xlat35.x, u_xlat15.x, u_xlat91);

    u_xlat35.x = u_xlat35.x / u_xlat9.x;

    u_xlat91 = u_xlat9.x * u_xlat9.x;

    u_xlat97 = fma(u_xlat9.x, u_xlat9.x, (-u_xlat62.x));

    u_xlat97 = max(u_xlat97, 0.0);

    u_xlat97 = sqrt(u_xlat97);

    u_xlat72.x = u_xlat97 / u_xlat85;

    u_xlat25.w = fma(u_xlat72.x, u_xlat16.x, u_xlat68.x);

    u_xlat91 = fma(u_xlat67, u_xlat67, (-u_xlat91));

    u_xlat91 = fma(FGlobals.bottom_radius, FGlobals.bottom_radius, u_xlat91);

    u_xlat72.x = max(u_xlat91, 0.0);

    u_xlat72.x = sqrt(u_xlat72.x);

    u_xlat72.x = (-u_xlat67) + (-u_xlat72.x);

    u_xlat98 = u_xlat9.x + (-FGlobals.bottom_radius);

    u_xlatb47 = u_xlat97==u_xlat98;

    u_xlat72.x = (-u_xlat98) + u_xlat72.x;

    u_xlat98 = u_xlat97 + (-u_xlat98);

    u_xlat72.x = u_xlat72.x / u_xlat98;

    u_xlat72.x = (u_xlatb47) ? 0.0 : u_xlat72.x;

    u_xlat72.x = fma(u_xlat72.x, u_xlat42.x, u_xlat94);

    u_xlat72.x = fma((-u_xlat72.x), 0.5, 0.5);

    u_xlat91 = fma(u_xlat85, u_xlat85, u_xlat91);

    u_xlat91 = max(u_xlat91, 0.0);

    u_xlat91 = sqrt(u_xlat91);

    u_xlat91 = u_xlat91 + (-u_xlat67);

    u_xlat9.x = (-u_xlat9.x) + FGlobals.top_radius;

    u_xlat67 = u_xlat85 + u_xlat97;

    u_xlat91 = (-u_xlat9.x) + u_xlat91;

    u_xlat9.x = (-u_xlat9.x) + u_xlat67;

    u_xlat9.x = u_xlat91 / u_xlat9.x;

    u_xlat9.x = fma(u_xlat9.x, u_xlat42.x, u_xlat94);

    u_xlat9.x = fma(u_xlat9.x, 0.5, 0.5);

    u_xlat25.z = (u_xlatb61) ? u_xlat72.x : u_xlat9.x;

    u_xlat9.x = fma(u_xlat35.x, u_xlat35.x, -1.0);

    u_xlat9.x = fma(u_xlat62.x, u_xlat9.x, u_xlat62.y);

    u_xlat9.x = max(u_xlat9.x, 0.0);

    u_xlat9.x = sqrt(u_xlat9.x);

    u_xlat9.x = fma((-FGlobals.bottom_radius), u_xlat35.x, u_xlat9.x);

    u_xlat9.x = max(u_xlat9.x, 0.0);

    u_xlat9.x = (-u_xlat36) + u_xlat9.x;

    u_xlat9.x = u_xlat9.x / u_xlat89;

    u_xlat35.x = u_xlat9.x / u_xlat92;

    u_xlat35.x = (-u_xlat35.x) + 1.0;

    u_xlat35.x = max(u_xlat35.x, 0.0);

    u_xlat9.x = u_xlat9.x + 1.0;

    u_xlat9.x = u_xlat35.x / u_xlat9.x;

    u_xlat9.x = fma(u_xlat9.x, u_xlat17.x, u_xlat93);

    u_xlat9.y = u_xlat9.x + u_xlat96;

    u_xlat9.x = u_xlat9.x + u_xlat19.x;

    u_xlat25.xy = u_xlat9.xy / u_xlat17.yy;

    u_xlat16_9.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat25.yzw, level(1.0)).xyz;

    u_xlat16_25.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat25.xzw, level(1.0)).xyz;

    u_xlat25.xyz = u_xlat41.xxx * float3(u_xlat16_25.xyz);

    u_xlat9.xyz = fma(float3(u_xlat16_9.xyz), u_xlat58.xxx, u_xlat25.xyz);

    u_xlat9.xyz = fma((-u_xlat23.xyz), u_xlat9.xyz, u_xlat24.xyz);

    u_xlat58.x = fma(u_xlat15.x, u_xlat15.x, 1.0);

    u_xlat58.x = u_xlat58.x * 0.0596831031;

    u_xlat9.xyz = u_xlat58.xxx * u_xlat9.xyz;

    u_xlat9.xyz = u_xlat9.xyz * FGlobals.SKY_SPECTRAL_RADIANCE_TO_LUMINANCE.xyzx.xyz;

    u_xlat9.xyz = u_xlat7.xyz * u_xlat9.xyz;

    u_xlat9.xyz = u_xlat9.xyz * FGlobals._OC_ActualSunColor.www;

    u_xlat9.xyz = u_xlat9.xyz * float3(FGlobals._OC_AtmosphereExposure);

    u_xlat9.xyz = max(u_xlat9.xyz, float3(0.0, 0.0, 0.0));

    u_xlat58.x = dot(u_xlat23.xyz, float3(0.300000012, 0.589999974, 0.109999999));

    u_xlat58.x = (-u_xlat58.x) + 1.0;

    u_xlat58.x = u_xlat58.x * 0.349999994;

    u_xlat15.xyz = u_xlat11.xyz * u_xlat58.xxx;

    u_xlat9.xyz = fma(u_xlat15.xyz, float3(FGlobals._OC_NightScattering), u_xlat9.xyz);

    u_xlat15.xyz = u_xlat23.xyz + float3(-1.0, -1.0, -1.0);

    u_xlat15.xyz = fma(float3(FGlobals._OC_AtmosphereDensity), u_xlat15.xyz, float3(1.0, 1.0, 1.0));

    u_xlat9.xyz = u_xlat9.xyz * float3(FGlobals._OC_AtmosphereDensity);

    u_xlat9.xyz = float3(u_xlat16_29) * u_xlat9.xyz;

    u_xlat82 = (-u_xlat82) * FGlobals._OC_MieScatteringParams.w;

    u_xlat82 = exp2(u_xlat82);

    u_xlat82 = (-u_xlat82) + 1.0;

    u_xlat4.w = u_xlat82 * u_xlat82;

    if(u_xlatb18){

    u_xlat58.x = u_xlat64 * u_xlat64;

    u_xlat91 = fma(u_xlat64, u_xlat64, (-u_xlat62.x));

    u_xlat91 = max(u_xlat91, 0.0);

    u_xlat91 = sqrt(u_xlat91);

    u_xlat96 = fma(u_xlat40, u_xlat40, -1.0);

    u_xlat58.x = fma(u_xlat58.x, u_xlat96, u_xlat62.y);

    u_xlat58.x = max(u_xlat58.x, 0.0);

    u_xlat58.x = sqrt(u_xlat58.x);

    u_xlat58.x = fma(u_xlat64, u_xlat40, u_xlat58.x);

    u_xlat58.x = max(u_xlat58.x, 0.0);

    u_xlat96 = (-u_xlat64) + FGlobals.top_radius;

    u_xlat19.x = u_xlat85 + u_xlat91;

    u_xlat58.x = u_xlat58.x + (-u_xlat96);

    u_xlat96 = (-u_xlat96) + u_xlat19.x;

    u_xlat58.x = u_xlat58.x / u_xlat96;

    u_xlat91 = u_xlat91 / u_xlat85;

    u_xlat19.xw = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat72.xy = float2(0.5, 0.5) / u_xlat19.xw;

    u_xlat19.xw = float2(1.0, 1.0) / u_xlat19.xw;

    u_xlat19.xw = (-u_xlat19.xw) + float2(1.0, 1.0);

    u_xlat23.x = fma(u_xlat58.x, u_xlat19.x, u_xlat72.x);

    u_xlat23.y = fma(u_xlat91, u_xlat19.w, u_xlat72.y);

    u_xlat16_23.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat23.xy, level(0.0)).xyz;

    u_xlat58.x = fma(u_xlat69.y, u_xlat69.y, (-u_xlat62.x));

    u_xlat58.x = max(u_xlat58.x, 0.0);

    u_xlat58.x = sqrt(u_xlat58.x);

    u_xlat91 = fma(u_xlat44, u_xlat10.x, u_xlat62.y);

    u_xlat91 = max(u_xlat91, 0.0);

    u_xlat91 = sqrt(u_xlat91);

    u_xlat91 = u_xlat91 + u_xlat69.x;

    u_xlat91 = max(u_xlat91, 0.0);

    u_xlat96 = (-u_xlat69.y) + FGlobals.top_radius;

    u_xlat47.x = u_xlat85 + u_xlat58.x;

    u_xlat91 = u_xlat91 + (-u_xlat96);

    u_xlat96 = (-u_xlat96) + u_xlat47.x;

    u_xlat91 = u_xlat91 / u_xlat96;

    u_xlat58.x = u_xlat58.x / u_xlat85;

    u_xlat24.x = fma(u_xlat91, u_xlat19.x, u_xlat72.x);

    u_xlat24.y = fma(u_xlat58.x, u_xlat19.w, u_xlat72.y);

    u_xlat16_24.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat24.xy, level(0.0)).xyz;

    u_xlat16_23.xyz = u_xlat16_23.xyz / u_xlat16_24.xyz;

    u_xlat23.xyz = min(float3(u_xlat16_23.xyz), float3(1.0, 1.0, 1.0));

    } else {

    u_xlat58.x = fma(u_xlat69.y, u_xlat69.y, (-u_xlat62.x));

    u_xlat58.x = max(u_xlat58.x, 0.0);

    u_xlat58.x = sqrt(u_xlat58.x);

    u_xlat91 = fma(u_xlat44, u_xlat10.x, u_xlat62.y);

    u_xlat91 = max(u_xlat91, 0.0);

    u_xlat91 = sqrt(u_xlat91);

    u_xlat91 = u_xlat91 + (-u_xlat69.x);

    u_xlat91 = max(u_xlat91, 0.0);

    u_xlat96 = (-u_xlat69.y) + FGlobals.top_radius;

    u_xlat19.x = u_xlat85 + u_xlat58.x;

    u_xlat91 = u_xlat91 + (-u_xlat96);

    u_xlat96 = (-u_xlat96) + u_xlat19.x;

    u_xlat91 = u_xlat91 / u_xlat96;

    u_xlat58.x = u_xlat58.x / u_xlat85;

    u_xlat19.xw = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat72.xy = float2(0.5, 0.5) / u_xlat19.xw;

    u_xlat19.xw = float2(1.0, 1.0) / u_xlat19.xw;

    u_xlat19.xw = (-u_xlat19.xw) + float2(1.0, 1.0);

    u_xlat24.x = fma(u_xlat91, u_xlat19.x, u_xlat72.x);

    u_xlat24.y = fma(u_xlat58.x, u_xlat19.w, u_xlat72.y);

    u_xlat16_24.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat24.xy, level(0.0)).xyz;

    u_xlat58.x = u_xlat64 * u_xlat64;

    u_xlat91 = fma(u_xlat64, u_xlat64, (-u_xlat62.x));

    u_xlat91 = max(u_xlat91, 0.0);

    u_xlat91 = sqrt(u_xlat91);

    u_xlat96 = fma(u_xlat40, u_xlat40, -1.0);

    u_xlat58.x = fma(u_xlat58.x, u_xlat96, u_xlat62.y);

    u_xlat58.x = max(u_xlat58.x, 0.0);

    u_xlat58.x = sqrt(u_xlat58.x);

    u_xlat58.x = fma((-u_xlat64), u_xlat40, u_xlat58.x);

    u_xlat58.x = max(u_xlat58.x, 0.0);

    u_xlat96 = (-u_xlat64) + FGlobals.top_radius;

    u_xlat47.x = u_xlat85 + u_xlat91;

    u_xlat58.x = u_xlat58.x + (-u_xlat96);

    u_xlat96 = (-u_xlat96) + u_xlat47.x;

    u_xlat58.x = u_xlat58.x / u_xlat96;

    u_xlat91 = u_xlat91 / u_xlat85;

    u_xlat25.x = fma(u_xlat58.x, u_xlat19.x, u_xlat72.x);

    u_xlat25.y = fma(u_xlat91, u_xlat19.w, u_xlat72.y);

    u_xlat16_25.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat25.xy, level(0.0)).xyz;

    u_xlat16_24.xyz = u_xlat16_24.xyz / u_xlat16_25.xyz;

    u_xlat23.xyz = min(float3(u_xlat16_24.xyz), float3(1.0, 1.0, 1.0));

    }

    u_xlat23.xyz = u_xlat23.xyz + float3(-1.0, -1.0, -1.0);

    u_xlat23.xyz = fma(u_xlat23.xyz, float3(0.5, 0.5, 0.5), float3(1.0, 1.0, 1.0));

    u_xlat4.x = dot((-u_xlat4.xyz), FGlobals._OC_LightDir.xyzx.xyz);

    u_xlat4.x = fma(u_xlat4.x, 0.5, 0.5);

    u_xlat4.x = fma((-u_xlat20.x), u_xlat4.x, 1.0);

    u_xlat4.xw = u_xlat4.xw * u_xlat4.xw;

    u_xlat4.x = u_xlat4.x * 12.566371;

    u_xlat4.x = u_xlat46 / u_xlat4.x;

    u_xlat4.x = u_xlat4.x * FGlobals._OC_MieScatteringParams.x;

    u_xlat4.xyz = u_xlat4.xxx * FGlobals._OC_LightColor.xyzx.xyz;

    u_xlat4.xyz = u_xlat4.www * u_xlat4.xyz;

    u_xlat4.xyz = float3(u_xlat87) * u_xlat4.xyz;

    u_xlat4.xyz = float3(u_xlat70) * u_xlat4.xyz;

    u_xlat4.xyz = u_xlat23.xyz * u_xlat4.xyz;

    u_xlat28.xyz = fma(u_xlat4.xyz, float3(u_xlat16_29), u_xlat28.xyz);

    u_xlat4.xyz = fma(u_xlat28.xyz, u_xlat15.xyz, u_xlat9.xyz);

    u_xlat9.xyz = fma(u_xlat5.xyz, float3(u_xlat16_29), (-u_xlat4.xyz));

    u_xlat4.xyz = fma(u_xlat32.xxx, u_xlat9.xyz, u_xlat4.xyz);

    u_xlat5.xyz = fma(u_xlat5.xyz, float3(u_xlat16_29), (-u_xlat28.xyz));

    u_xlat28.xyz = fma(u_xlat32.xxx, u_xlat5.xyz, u_xlat28.xyz);

    u_xlat28.xyz = (int(u_xlati81) != 0) ? u_xlat4.xyz : u_xlat28.xyz;

    u_xlat0.x = fma(FGlobals._ZBufferParams.x, u_xlat0.x, FGlobals._ZBufferParams.y);

    u_xlat0.x = float(1.0) / u_xlat0.x;

    u_xlatb0 = u_xlat0.x<1.0;

    if(u_xlatb0){

    u_xlat16_4.xyz = _BackBuffer.sample(sampler_BackBuffer, input.TEXCOORD0.zw).xyz;

    u_xlat5.xy = u_xlat1.xz + (-FGlobals._WorldSpaceCameraPos.xyzx.xz);

    u_xlat0.x = dot(u_xlat5.xy, u_xlat5.xy);

    u_xlat0.x = fma(u_xlat0.x, -7.99999995e-08, u_xlat1.y);

    u_xlat27 = (-FGlobals._OverCloudOriginOffset.xyzx.y) + 1.0;

    u_xlat1.w = max(u_xlat0.x, u_xlat27);

    u_xlat5.xyz = u_xlat1.xwz + (-FGlobals._WorldSpaceCameraPos.xyzx.xyz);

    u_xlat0.x = dot(u_xlat5.xyz, u_xlat5.xyz);

    u_xlat23.x = sqrt(u_xlat0.x);

    u_xlat5.xyz = u_xlat5.xyz / u_xlat23.xxx;

    u_xlat23.yzw = u_xlat1.xwz + FGlobals._OverCloudOriginOffset.xyzx.xyz;

    u_xlat1.xz = (-u_xlat3.xz) + u_xlat23.yw;

    if(u_xlatb83){

    u_xlat0.x = FGlobals._OC_EarthRadius + FGlobals._OC_FogHeight;

    u_xlat79 = (-u_xlat12.x) + (-FGlobals._OC_EarthRadius);

    u_xlat3.x = u_xlat5.y * u_xlat79;

    u_xlat55 = u_xlat0.x * u_xlat0.x;

    u_xlat3.x = u_xlat3.x * u_xlat3.x;

    u_xlat3.x = fma(u_xlat79, u_xlat79, (-u_xlat3.x));

    u_xlatb55 = u_xlat55>=u_xlat3.x;

    u_xlat0.x = fma(u_xlat0.x, u_xlat0.x, (-u_xlat3.x));

    u_xlat0.x = sqrt(u_xlat0.x);

    u_xlat9.y = fma(u_xlat79, u_xlat5.y, (-u_xlat0.x));

    u_xlat9.x = fma(u_xlat79, u_xlat5.y, u_xlat0.x);

    u_xlatb0 = u_xlat9.x<u_xlat9.y;

    u_xlat3.xw = (bool(u_xlatb0)) ? u_xlat9.xy : u_xlat9.yx;

    u_xlatb32.xy = (u_xlat3.xw<float2(0.0, 0.0));

    u_xlat9.x = (u_xlatb32.x) ? u_xlat3.w : u_xlat3.x;

    u_xlatb0 = u_xlatb32.y && u_xlatb32.x;

    u_xlati0 = ~(int(u_xlatb0) * int(0xffffffffu));

    u_xlati0 = u_xlatb55 ? u_xlati0 : int(0);

    u_xlatb79 = u_xlat9.x<u_xlat23.x;

    u_xlat9.y = fma(u_xlat5.y, u_xlat9.x, u_xlat12.x);

    u_xlat3.xz = (bool(u_xlatb79)) ? u_xlat9.xy : u_xlat23.xz;

    u_xlat9.x = 0.0;

    u_xlat9.y = u_xlat23.z;

    u_xlat8.xz = (int(u_xlati0) != 0) ? u_xlat3.zx : u_xlat9.yx;

    u_xlat8.xyz = u_xlat8.wxz;

    u_xlat8.w = 0.0;

    } else {

    u_xlat0.x = FGlobals._OC_EarthRadius + FGlobals._OC_FogHeight;

    u_xlat79 = (-u_xlat12.x) + (-FGlobals._OC_EarthRadius);

    u_xlat3.x = u_xlat5.y * u_xlat79;

    u_xlat55 = u_xlat0.x * u_xlat0.x;

    u_xlat3.x = u_xlat3.x * u_xlat3.x;

    u_xlat3.x = fma(u_xlat79, u_xlat79, (-u_xlat3.x));

    u_xlatb55 = u_xlat55>=u_xlat3.x;

    u_xlat0.x = fma(u_xlat0.x, u_xlat0.x, (-u_xlat3.x));

    u_xlat0.x = sqrt(u_xlat0.x);

    u_xlat72.x = fma(u_xlat79, u_xlat5.y, (-u_xlat0.x));

    u_xlat72.y = fma(u_xlat79, u_xlat5.y, u_xlat0.x);

    u_xlatb0 = u_xlat72.y<u_xlat72.x;

    u_xlat3.xw = (bool(u_xlatb0)) ? u_xlat72.xy : u_xlat72.yx;

    u_xlatb32.xy = (u_xlat3.wx<float2(0.0, 0.0));

    u_xlat24.zw = (u_xlatb32.x) ? u_xlat3.xw : u_xlat3.wx;

    u_xlatb0 = u_xlatb32.y && u_xlatb32.x;

    u_xlati0 = ~(int(u_xlatb0) * int(0xffffffffu));

    u_xlati0 = u_xlatb55 ? u_xlati0 : int(0);

    u_xlat79 = min(u_xlat23.x, u_xlat24.w);

    u_xlat24.x = (-u_xlat24.z) + u_xlat79;

    u_xlatb79 = u_xlat24.x<u_xlat23.x;

    u_xlat24.y = fma(u_xlat5.y, u_xlat24.z, u_xlat12.x);

    u_xlat8.xy = u_xlat23.xz;

    u_xlat3.xzw = (bool(u_xlatb79)) ? u_xlat24.xyz : u_xlat8.xwz;

    u_xlat8.xzw = (int(u_xlati0) != 0) ? u_xlat3.zxw : u_xlat8.wzz;

    }

    u_xlat0.x = max(u_xlat8.z, 0.0);

    u_xlat79 = u_xlat8.y + u_xlat8.x;

    u_xlat79 = fma((-u_xlat79), 0.5, FGlobals._OC_FogHeight);

    u_xlat79 = max(u_xlat79, 0.0);

    u_xlat79 = u_xlat79 * FGlobals._OC_FogFalloffParams.xxyx.z;

    u_xlat79 = min(u_xlat79, 1.0);

    u_xlat0.x = u_xlat0.x * (-FGlobals._OC_FogParams.x);

    u_xlat0.x = u_xlat79 * u_xlat0.x;

    u_xlat0.x = exp2(u_xlat0.x);

    u_xlat0.x = (-u_xlat0.x) + 1.0;

    u_xlat79 = max(u_xlat8.w, FGlobals._OC_FogBlend);

    u_xlat79 = min(u_xlat79, u_xlat23.x);

    u_xlat8.xyz = fma(u_xlat5.xyz, float3(u_xlat79), u_xlat12.yxy);

    u_xlatb3 = u_xlat23.x<FGlobals._ProjectionParams.z;

    u_xlat14.z = max(u_xlat8.y, 1.0);

    u_xlat12.w = u_xlat8.y;

    u_xlat9.xy = (bool(u_xlatb3)) ? u_xlat14.xz : u_xlat12.xw;

    u_xlat9.z = 0.0;

    u_xlat3.xzw = u_xlat9.zxz + (-FGlobals._ScattEarthCenter.xxyz.yzw);

    u_xlat8.w = u_xlat9.y;

    u_xlat8.xyz = u_xlat8.xwz + (-FGlobals._ScattEarthCenter.xxyz.yzw);

    u_xlat9.xyz = (-u_xlat3.xzw) + u_xlat8.xyz;

    u_xlat82 = dot(u_xlat9.xyz, u_xlat9.xyz);

    u_xlat82 = rsqrt(u_xlat82);

    u_xlat9.xyz = float3(u_xlat82) * u_xlat9.xyz;

    u_xlat82 = dot(u_xlat3.xzw, u_xlat3.xzw);

    u_xlat12.y = sqrt(u_xlat82);

    u_xlat12.x = dot(u_xlat3.xzw, u_xlat9.xyz);

    u_xlat82 = fma(u_xlat12.x, u_xlat12.x, (-u_xlat82));

    u_xlat82 = fma(FGlobals.top_radius, FGlobals.top_radius, u_xlat82);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat24.x = (-u_xlat82);

    u_xlat82 = (-u_xlat12.x) + u_xlat24.x;

    u_xlatb83 = 0.0<u_xlat82;

    u_xlat15.xyz = fma(u_xlat9.xyz, float3(u_xlat82), u_xlat3.xzw);

    u_xlat3.xzw = (bool(u_xlatb83)) ? u_xlat15.xyz : u_xlat3.xzw;

    u_xlat24.yw = float2(FGlobals.top_radius);

    u_xlat32.xy = (bool(u_xlatb83)) ? u_xlat24.xy : u_xlat12.xy;

    u_xlat82 = u_xlat32.x / u_xlat32.y;

    u_xlat83 = dot(u_xlat3.xzw, (-FGlobals._OC_ActualSunDir.xyzx.xyz));

    u_xlat86 = u_xlat83 / u_xlat32.y;

    u_xlat9.x = dot(u_xlat9.xyz, (-FGlobals._OC_ActualSunDir.xyzx.xyz));

    u_xlat3.xzw = (-u_xlat3.xzw) + u_xlat8.xyz;

    u_xlat3.x = dot(u_xlat3.xzw, u_xlat3.xzw);

    u_xlat55 = sqrt(u_xlat3.x);

    u_xlatb81 = u_xlat82<0.0;

    u_xlat8.x = u_xlat32.y * u_xlat32.y;

    u_xlat82 = fma(u_xlat82, u_xlat82, -1.0);

    u_xlat34 = fma(u_xlat8.x, u_xlat82, u_xlat62.x);

    u_xlatb34 = u_xlat34>=0.0;

    u_xlatb81 = u_xlatb81 && u_xlatb34;

    u_xlat34 = dot(u_xlat32.xx, float2(u_xlat55));

    u_xlat3.x = u_xlat3.x + u_xlat34;

    u_xlat3.x = fma(u_xlat32.y, u_xlat32.y, u_xlat3.x);

    u_xlat3.x = sqrt(u_xlat3.x);


    u_xlat3.x = max(u_xlat3.x, FGlobals.bottom_radius);

    u_xlat3.x = min(u_xlat3.x, FGlobals.top_radius);

    u_xlat34 = u_xlat55 + u_xlat32.x;

    u_xlat60.x = u_xlat34 / u_xlat3.x;

    u_xlat60.x = max(u_xlat60.x, -1.0);

    u_xlat60.x = min(u_xlat60.x, 1.0);

    if(u_xlatb81){

    u_xlat35.x = u_xlat3.x * u_xlat3.x;

    u_xlat61.x = fma(u_xlat3.x, u_xlat3.x, (-u_xlat62.x));

    u_xlat35.y = max(u_xlat61.x, 0.0);

    u_xlat12.x = fma(u_xlat60.x, u_xlat60.x, -1.0);

    u_xlat35.x = fma(u_xlat35.x, u_xlat12.x, u_xlat62.y);

    u_xlat35.x = max(u_xlat35.x, 0.0);

    u_xlat35.xy = sqrt(u_xlat35.xy);

    u_xlat35.x = fma(u_xlat3.x, u_xlat60.x, u_xlat35.x);

    u_xlat35.x = max(u_xlat35.x, 0.0);

    u_xlat12.x = (-u_xlat3.x) + FGlobals.top_radius;

    u_xlat38 = u_xlat85 + u_xlat35.y;

    u_xlat35.x = u_xlat35.x + (-u_xlat12.x);

    u_xlat12.x = (-u_xlat12.x) + u_xlat38;

    u_xlat35.x = u_xlat35.x / u_xlat12.x;

    u_xlat61.x = u_xlat35.y / u_xlat85;

    u_xlat12.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat14.xz = float2(0.5, 0.5) / u_xlat12.xy;

    u_xlat12.xy = float2(1.0, 1.0) / u_xlat12.xy;

    u_xlat12.xy = (-u_xlat12.xy) + float2(1.0, 1.0);

    u_xlat15.x = fma(u_xlat35.x, u_xlat12.x, u_xlat14.x);

    u_xlat15.y = fma(u_xlat61.x, u_xlat12.y, u_xlat14.z);

    u_xlat16_15.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat15.xy, level(0.0)).xyz;

    u_xlat35.x = fma(u_xlat32.y, u_xlat32.y, (-u_xlat62.x));

    u_xlat35.x = max(u_xlat35.x, 0.0);

    u_xlat61.x = fma(u_xlat8.x, u_xlat82, u_xlat62.y);

    u_xlat35.y = max(u_xlat61.x, 0.0);

    u_xlat35.xy = sqrt(u_xlat35.xy);

    u_xlat61.x = u_xlat32.x + u_xlat35.y;

    u_xlat61.x = max(u_xlat61.x, 0.0);

    u_xlat90 = (-u_xlat32.y) + FGlobals.top_radius;

    u_xlat91 = u_xlat85 + u_xlat35.x;

    u_xlat61.x = u_xlat61.x + (-u_xlat90);

    u_xlat90 = (-u_xlat90) + u_xlat91;

    u_xlat61.x = u_xlat61.x / u_xlat90;

    u_xlat35.x = u_xlat35.x / u_xlat85;

    u_xlat24.x = fma(u_xlat61.x, u_xlat12.x, u_xlat14.x);

    u_xlat24.y = fma(u_xlat35.x, u_xlat12.y, u_xlat14.z);

    u_xlat16_12.xyw = transmittance_texture.sample(samplertransmittance_texture, u_xlat24.xy, level(0.0)).xyz;

    u_xlat16_12.xyw = u_xlat16_15.xyz / u_xlat16_12.xyw;

    u_xlat12.xyw = min(float3(u_xlat16_12.xyw), float3(1.0, 1.0, 1.0));

    } else {

    u_xlat35.x = fma(u_xlat32.y, u_xlat32.y, (-u_xlat62.x));

    u_xlat35.x = max(u_xlat35.x, 0.0);

    u_xlat35.x = sqrt(u_xlat35.x);

    u_xlat82 = fma(u_xlat8.x, u_xlat82, u_xlat62.y);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat82 = u_xlat82 + (-u_xlat32.x);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat61.x = (-u_xlat32.y) + FGlobals.top_radius;

    u_xlat91 = u_xlat85 + u_xlat35.x;

    u_xlat82 = u_xlat82 + (-u_xlat61.x);

    u_xlat61.x = (-u_xlat61.x) + u_xlat91;

    u_xlat82 = u_xlat82 / u_xlat61.x;

    u_xlat35.x = u_xlat35.x / u_xlat85;

    u_xlat14.xz = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat15.xy = float2(0.5, 0.5) / u_xlat14.xz;

    u_xlat14.xz = float2(1.0, 1.0) / u_xlat14.xz;

    u_xlat14.xz = (-u_xlat14.xz) + float2(1.0, 1.0);

    u_xlat24.x = fma(u_xlat82, u_xlat14.x, u_xlat15.x);

    u_xlat24.y = fma(u_xlat35.x, u_xlat14.z, u_xlat15.y);

    u_xlat16_25.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat24.xy, level(0.0)).xyz;

    u_xlat82 = u_xlat3.x * u_xlat3.x;

    u_xlat35.x = fma(u_xlat3.x, u_xlat3.x, (-u_xlat62.x));

    u_xlat35.x = max(u_xlat35.x, 0.0);

    u_xlat35.x = sqrt(u_xlat35.x);

    u_xlat61.x = fma(u_xlat60.x, u_xlat60.x, -1.0);

    u_xlat82 = fma(u_xlat82, u_xlat61.x, u_xlat62.y);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat82 = fma((-u_xlat3.x), u_xlat60.x, u_xlat82);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat60.x = (-u_xlat3.x) + FGlobals.top_radius;

    u_xlat61.x = u_xlat85 + u_xlat35.x;

    u_xlat82 = u_xlat82 + (-u_xlat60.x);

    u_xlat60.x = (-u_xlat60.x) + u_xlat61.x;

    u_xlat82 = u_xlat82 / u_xlat60.x;

    u_xlat60.x = u_xlat35.x / u_xlat85;

    u_xlat24.x = fma(u_xlat82, u_xlat14.x, u_xlat15.x);

    u_xlat24.y = fma(u_xlat60.x, u_xlat14.z, u_xlat15.y);

    u_xlat16_15.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat24.xy, level(0.0)).xyz;

    u_xlat16_15.xyz = u_xlat16_25.xyz / u_xlat16_15.xyz;

    u_xlat12.xyw = min(float3(u_xlat16_15.xyz), float3(1.0, 1.0, 1.0));

    }

    u_xlat82 = fma(u_xlat32.y, u_xlat32.y, (-u_xlat62.x));

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat60.x = u_xlat82 / u_xlat85;

    u_xlat25.w = fma(u_xlat60.x, u_xlat16.x, u_xlat68.x);

    u_xlat8.x = fma(u_xlat32.x, u_xlat32.x, (-u_xlat8.x));

    u_xlat8.x = fma(FGlobals.bottom_radius, FGlobals.bottom_radius, u_xlat8.x);

    u_xlat60.x = max(u_xlat8.x, 0.0);

    u_xlat60.x = sqrt(u_xlat60.x);

    u_xlat60.x = (-u_xlat32.x) + (-u_xlat60.x);

    u_xlat35.x = u_xlat32.y + (-FGlobals.bottom_radius);

    u_xlatb61 = u_xlat82==u_xlat35.x;

    u_xlat60.x = u_xlat60.x + (-u_xlat35.x);

    u_xlat35.x = u_xlat82 + (-u_xlat35.x);

    u_xlat60.x = u_xlat60.x / u_xlat35.x;

    u_xlat60.x = (u_xlatb61) ? 0.0 : u_xlat60.x;

    u_xlat60.x = fma(u_xlat60.x, u_xlat42.x, u_xlat94);

    u_xlat60.x = fma((-u_xlat60.x), 0.5, 0.5);

    u_xlat8.x = fma(u_xlat85, u_xlat85, u_xlat8.x);

    u_xlat8.x = max(u_xlat8.x, 0.0);

    u_xlat8.x = sqrt(u_xlat8.x);

    u_xlat32.x = (-u_xlat32.x) + u_xlat8.x;

    u_xlat58.x = (-u_xlat32.y) + FGlobals.top_radius;

    u_xlat82 = u_xlat85 + u_xlat82;

    u_xlat32.x = (-u_xlat58.x) + u_xlat32.x;

    u_xlat82 = (-u_xlat58.x) + u_xlat82;

    u_xlat82 = u_xlat32.x / u_xlat82;

    u_xlat82 = fma(u_xlat82, u_xlat42.x, u_xlat94);

    u_xlat82 = fma(u_xlat82, 0.5, 0.5);

    u_xlat25.z = (u_xlatb81) ? u_xlat60.x : u_xlat82;

    u_xlat82 = fma(u_xlat86, u_xlat86, -1.0);

    u_xlat82 = fma(u_xlat62.x, u_xlat82, u_xlat62.y);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat82 = fma((-FGlobals.bottom_radius), u_xlat86, u_xlat82);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = (-u_xlat36) + u_xlat82;

    u_xlat82 = u_xlat82 / u_xlat89;

    u_xlat32.x = u_xlat82 / u_xlat92;

    u_xlat32.x = (-u_xlat32.x) + 1.0;

    u_xlat32.x = max(u_xlat32.x, 0.0);

    u_xlat82 = u_xlat82 + 1.0;

    u_xlat82 = u_xlat32.x / u_xlat82;

    u_xlat82 = fma(u_xlat82, u_xlat17.x, u_xlat93);

    u_xlat32.x = u_xlat9.x + 1.0;

    u_xlat32.x = u_xlat45 * u_xlat32.x;

    u_xlat58.x = u_xlat32.x * 0.5;

    u_xlat58.x = floor(u_xlat58.x);

    u_xlat32.x = fma(u_xlat32.x, 0.5, (-u_xlat58.x));

    u_xlat8.x = u_xlat82 + u_xlat58.x;

    u_xlat25.y = u_xlat8.x / u_xlat17.y;

    u_xlat8.x = u_xlat58.x + 1.0;

    u_xlat82 = u_xlat82 + u_xlat8.x;

    u_xlat25.x = u_xlat82 / u_xlat17.y;

    u_xlat16_15.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat25.yzw, level(1.0)).xyz;

    u_xlat82 = (-u_xlat32.x) + 1.0;

    u_xlat16_25.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat25.xzw, level(1.0)).xyz;

    u_xlat25.xyz = u_xlat32.xxx * float3(u_xlat16_25.xyz);

    u_xlat15.xyz = fma(float3(u_xlat16_15.xyz), float3(u_xlat82), u_xlat25.xyz);

    u_xlat55 = fma(u_xlat55, u_xlat9.x, u_xlat83);

    u_xlat55 = u_xlat55 / u_xlat3.x;

    u_xlat83 = u_xlat3.x * u_xlat3.x;

    u_xlat60.x = fma(u_xlat3.x, u_xlat3.x, (-u_xlat62.x));

    u_xlat60.x = max(u_xlat60.x, 0.0);

    u_xlat60.x = sqrt(u_xlat60.x);

    u_xlat86 = u_xlat60.x / u_xlat85;

    u_xlat25.w = fma(u_xlat86, u_xlat16.x, u_xlat68.x);

    u_xlat83 = fma(u_xlat34, u_xlat34, (-u_xlat83));

    u_xlat83 = fma(FGlobals.bottom_radius, FGlobals.bottom_radius, u_xlat83);

    u_xlat86 = max(u_xlat83, 0.0);

    u_xlat86 = sqrt(u_xlat86);

    u_xlat86 = (-u_xlat86) + (-u_xlat34);

    u_xlat35.x = u_xlat3.x + (-FGlobals.bottom_radius);

    u_xlatb61 = u_xlat60.x==u_xlat35.x;

    u_xlat86 = u_xlat86 + (-u_xlat35.x);

    u_xlat35.x = u_xlat60.x + (-u_xlat35.x);

    u_xlat86 = u_xlat86 / u_xlat35.x;

    u_xlat86 = (u_xlatb61) ? 0.0 : u_xlat86;

    u_xlat86 = fma(u_xlat86, u_xlat42.x, u_xlat94);

    u_xlat86 = fma((-u_xlat86), 0.5, 0.5);

    u_xlat83 = fma(u_xlat85, u_xlat85, u_xlat83);

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat83 = sqrt(u_xlat83);

    u_xlat83 = u_xlat83 + (-u_xlat34);

    u_xlat3.x = (-u_xlat3.x) + FGlobals.top_radius;

    u_xlat34 = u_xlat85 + u_xlat60.x;

    u_xlat83 = (-u_xlat3.x) + u_xlat83;

    u_xlat3.x = (-u_xlat3.x) + u_xlat34;

    u_xlat3.x = u_xlat83 / u_xlat3.x;

    u_xlat3.x = fma(u_xlat3.x, u_xlat42.x, u_xlat94);

    u_xlat3.x = fma(u_xlat3.x, 0.5, 0.5);

    u_xlat25.z = (u_xlatb81) ? u_xlat86 : u_xlat3.x;

    u_xlat3.x = fma(u_xlat55, u_xlat55, -1.0);

    u_xlat3.x = fma(u_xlat62.x, u_xlat3.x, u_xlat62.y);

    u_xlat3.x = max(u_xlat3.x, 0.0);

    u_xlat3.x = sqrt(u_xlat3.x);

    u_xlat3.x = fma((-FGlobals.bottom_radius), u_xlat55, u_xlat3.x);

    u_xlat3.x = max(u_xlat3.x, 0.0);

    u_xlat3.x = (-u_xlat36) + u_xlat3.x;

    u_xlat3.x = u_xlat3.x / u_xlat89;

    u_xlat55 = u_xlat3.x / u_xlat92;

    u_xlat55 = (-u_xlat55) + 1.0;

    u_xlat55 = max(u_xlat55, 0.0);

    u_xlat3.x = u_xlat3.x + 1.0;

    u_xlat3.x = u_xlat55 / u_xlat3.x;

    u_xlat3.x = fma(u_xlat3.x, u_xlat17.x, u_xlat93);

    u_xlat3.z = u_xlat3.x + u_xlat58.x;

    u_xlat3.x = u_xlat3.x + u_xlat8.x;

    u_xlat25.xy = u_xlat3.xz / u_xlat17.yy;

    u_xlat16_3.xzw = scattering_texture.sample(samplerscattering_texture, u_xlat25.yzw, level(1.0)).xyz;

    u_xlat16_8.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat25.xzw, level(1.0)).xyz;

    u_xlat8.xyz = u_xlat32.xxx * float3(u_xlat16_8.xyz);

    u_xlat3.xzw = fma(float3(u_xlat16_3.xzw), float3(u_xlat82), u_xlat8.xyz);

    u_xlat3.xzw = fma((-u_xlat12.xyw), u_xlat3.xzw, u_xlat15.xyz);

    u_xlat82 = fma(u_xlat9.x, u_xlat9.x, 1.0);

    u_xlat82 = u_xlat82 * 0.0596831031;

    u_xlat3.xzw = u_xlat3.xzw * float3(u_xlat82);

    u_xlat3.xzw = u_xlat3.xzw * FGlobals.SKY_SPECTRAL_RADIANCE_TO_LUMINANCE.xyzx.xyz;

    u_xlat3.xzw = u_xlat7.xyz * u_xlat3.xzw;

    u_xlat3.xzw = u_xlat3.xzw * FGlobals._OC_ActualSunColor.www;

    u_xlat3.xzw = u_xlat3.xzw * float3(FGlobals._OC_AtmosphereExposure);

    u_xlat3.xzw = max(u_xlat3.xzw, float3(0.0, 0.0, 0.0));

    u_xlat82 = dot(u_xlat12.xyw, float3(0.300000012, 0.589999974, 0.109999999));

    u_xlat82 = (-u_xlat82) + 1.0;

    u_xlat82 = u_xlat82 * 0.349999994;

    u_xlat8.xyz = u_xlat11.xyz * float3(u_xlat82);

    u_xlat3.xzw = fma(u_xlat8.xyz, float3(FGlobals._OC_NightScattering), u_xlat3.xzw);

    u_xlat79 = (-u_xlat79) * FGlobals._OC_MieScatteringParams.w;

    u_xlat79 = exp2(u_xlat79);

    u_xlat79 = (-u_xlat79) + 1.0;

    u_xlat79 = u_xlat79 * u_xlat79;

    u_xlat79 = u_xlat79 * u_xlat79;

    if(u_xlatb18){

    u_xlat82 = u_xlat64 * u_xlat64;

    u_xlat83 = fma(u_xlat64, u_xlat64, (-u_xlat62.x));

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat83 = sqrt(u_xlat83);

    u_xlat32.x = fma(u_xlat40, u_xlat40, -1.0);

    u_xlat82 = fma(u_xlat82, u_xlat32.x, u_xlat62.y);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat82 = fma(u_xlat64, u_xlat40, u_xlat82);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat32.x = (-u_xlat64) + FGlobals.top_radius;

    u_xlat58.x = u_xlat85 + u_xlat83;

    u_xlat82 = u_xlat82 + (-u_xlat32.x);

    u_xlat32.x = (-u_xlat32.x) + u_xlat58.x;

    u_xlat82 = u_xlat82 / u_xlat32.x;

    u_xlat83 = u_xlat83 / u_xlat85;

    u_xlat32.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat8.xy = float2(0.5, 0.5) / u_xlat32.xy;

    u_xlat32.xy = float2(1.0, 1.0) / u_xlat32.xy;

    u_xlat32.xy = (-u_xlat32.xy) + float2(1.0, 1.0);

    u_xlat9.x = fma(u_xlat82, u_xlat32.x, u_xlat8.x);

    u_xlat9.y = fma(u_xlat83, u_xlat32.y, u_xlat8.y);

    u_xlat16_9.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat9.xy, level(0.0)).xyz;

    u_xlat82 = fma(u_xlat69.y, u_xlat69.y, (-u_xlat62.x));

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat83 = fma(u_xlat44, u_xlat10.x, u_xlat62.y);

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat83 = sqrt(u_xlat83);

    u_xlat83 = u_xlat83 + u_xlat69.x;

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat60.x = (-u_xlat69.y) + FGlobals.top_radius;

    u_xlat86 = u_xlat85 + u_xlat82;

    u_xlat83 = u_xlat83 + (-u_xlat60.x);

    u_xlat60.x = (-u_xlat60.x) + u_xlat86;

    u_xlat83 = u_xlat83 / u_xlat60.x;

    u_xlat82 = u_xlat82 / u_xlat85;

    u_xlat15.x = fma(u_xlat83, u_xlat32.x, u_xlat8.x);

    u_xlat15.y = fma(u_xlat82, u_xlat32.y, u_xlat8.y);

    u_xlat16_8.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat15.xy, level(0.0)).xyz;

    u_xlat16_8.xyz = u_xlat16_9.xyz / u_xlat16_8.xyz;

    u_xlat8.xyz = min(float3(u_xlat16_8.xyz), float3(1.0, 1.0, 1.0));

    } else {

    u_xlat82 = fma(u_xlat69.y, u_xlat69.y, (-u_xlat62.x));

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat83 = fma(u_xlat44, u_xlat10.x, u_xlat62.y);

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat83 = sqrt(u_xlat83);

    u_xlat83 = u_xlat83 + (-u_xlat69.x);

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat32.x = (-u_xlat69.y) + FGlobals.top_radius;

    u_xlat58.x = u_xlat85 + u_xlat82;

    u_xlat83 = u_xlat83 + (-u_xlat32.x);

    u_xlat32.x = (-u_xlat32.x) + u_xlat58.x;

    u_xlat83 = u_xlat83 / u_xlat32.x;

    u_xlat82 = u_xlat82 / u_xlat85;

    u_xlat32.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat9.xy = float2(0.5, 0.5) / u_xlat32.xy;

    u_xlat32.xy = float2(1.0, 1.0) / u_xlat32.xy;

    u_xlat32.xy = (-u_xlat32.xy) + float2(1.0, 1.0);

    u_xlat15.x = fma(u_xlat83, u_xlat32.x, u_xlat9.x);

    u_xlat15.y = fma(u_xlat82, u_xlat32.y, u_xlat9.y);

    u_xlat16_15.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat15.xy, level(0.0)).xyz;

    u_xlat82 = u_xlat64 * u_xlat64;

    u_xlat83 = fma(u_xlat64, u_xlat64, (-u_xlat62.x));

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat83 = sqrt(u_xlat83);

    u_xlat86 = fma(u_xlat40, u_xlat40, -1.0);

    u_xlat82 = fma(u_xlat82, u_xlat86, u_xlat62.y);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat82 = fma((-u_xlat64), u_xlat40, u_xlat82);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat86 = (-u_xlat64) + FGlobals.top_radius;

    u_xlat61.x = u_xlat85 + u_xlat83;

    u_xlat82 = u_xlat82 + (-u_xlat86);

    u_xlat86 = (-u_xlat86) + u_xlat61.x;

    u_xlat82 = u_xlat82 / u_xlat86;

    u_xlat83 = u_xlat83 / u_xlat85;

    u_xlat24.x = fma(u_xlat82, u_xlat32.x, u_xlat9.x);

    u_xlat24.y = fma(u_xlat83, u_xlat32.y, u_xlat9.y);

    u_xlat16_9.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat24.xy, level(0.0)).xyz;

    u_xlat16_9.xyz = u_xlat16_15.xyz / u_xlat16_9.xyz;

    u_xlat8.xyz = min(float3(u_xlat16_9.xyz), float3(1.0, 1.0, 1.0));

    }

    u_xlat8.xyz = u_xlat8.xyz + float3(-1.0, -1.0, -1.0);

    u_xlat8.xyz = fma(u_xlat8.xyz, float3(0.5, 0.5, 0.5), float3(1.0, 1.0, 1.0));

    u_xlat82 = dot((-u_xlat5.xyz), FGlobals._OC_LightDir.xyzx.xyz);

    u_xlat82 = fma(u_xlat82, 0.5, 0.5);

    u_xlat82 = fma((-u_xlat20.x), u_xlat82, 1.0);

    u_xlat82 = u_xlat82 * u_xlat82;

    u_xlat82 = u_xlat82 * 12.566371;

    u_xlat82 = u_xlat46 / u_xlat82;

    u_xlat82 = u_xlat82 * FGlobals._OC_MieScatteringParams.x;

    u_xlat9.xyz = float3(u_xlat82) * FGlobals._OC_LightColor.xyzx.xyz;

    u_xlat15.xyz = float3(u_xlat79) * u_xlat9.xyz;

    u_xlat15.xyz = float3(u_xlat87) * u_xlat15.xyz;

    u_xlat15.xyz = float3(u_xlat70) * u_xlat15.xyz;

    u_xlat3.xzw = fma(u_xlat15.xyz, u_xlat8.xyz, u_xlat3.xzw);

    u_xlat0.x = u_xlat0.x * FGlobals._OC_FogColor.w;

    u_xlat5.xyz = u_xlat5.xyz * float3(1.0, 0.0, 1.0);

    u_xlat22.z = dot((-FGlobals._ScattEarthCenter.xxyz.yw), u_xlat5.xz);

    u_xlat79 = fma(u_xlat22.z, u_xlat22.z, (-u_xlat84));

    u_xlat79 = fma(FGlobals.top_radius, FGlobals.top_radius, u_xlat79);

    u_xlat79 = sqrt(u_xlat79);

    u_xlat8.x = (-u_xlat79);

    u_xlat79 = u_xlat8.x + (-u_xlat22.z);

    u_xlatb82 = 0.0<u_xlat79;

    u_xlati83 = (u_xlatb82) ? int(0xffffffffu) : u_xlati71;

    if((uint(u_xlati83))!=uint(0)){

    u_xlat32.xyz = fma(u_xlat5.xyz, float3(u_xlat79), (-FGlobals._ScattEarthCenter.xxyz.yzw));

    u_xlat32.xyz = (bool(u_xlatb82)) ? u_xlat32.xyz : (-FGlobals._ScattEarthCenter.xxyz.yzw);

    u_xlat8.y = FGlobals.top_radius;

    u_xlat31.xz = (bool(u_xlatb82)) ? u_xlat8.xy : u_xlat22.zx;

    u_xlat79 = u_xlat31.x / u_xlat31.z;

    u_xlat82 = dot(u_xlat32.xyz, (-FGlobals._OC_ActualSunDir.xyzx.xyz));

    u_xlat82 = u_xlat82 / u_xlat31.z;

    u_xlat5.x = dot(u_xlat5.xz, (-FGlobals._OC_ActualSunDir.xyzx.xz));

    u_xlatb57 = u_xlat79<0.0;

    u_xlat32.x = u_xlat31.z * u_xlat31.z;

    u_xlat79 = fma(u_xlat79, u_xlat79, -1.0);

    u_xlat58.xy = fma(u_xlat32.xx, float2(u_xlat79), u_xlat62.xy);

    u_xlatb79 = u_xlat58.x>=0.0;

    u_xlatb79 = u_xlatb79 && u_xlatb57;

    u_xlat57 = fma(u_xlat31.z, u_xlat31.z, (-u_xlat62.x));

    u_xlat57 = max(u_xlat57, 0.0);

    u_xlat57 = sqrt(u_xlat57);

    u_xlat58.x = max(u_xlat58.y, 0.0);

    u_xlat58.x = sqrt(u_xlat58.x);

    u_xlat58.x = (-u_xlat31.x) + u_xlat58.x;

    u_xlat58.x = max(u_xlat58.x, 0.0);

    u_xlat84 = (-u_xlat31.z) + FGlobals.top_radius;

    u_xlat8.x = u_xlat85 + u_xlat57;

    u_xlat58.x = (-u_xlat84) + u_xlat58.x;

    u_xlat8.x = (-u_xlat84) + u_xlat8.x;

    u_xlat58.x = u_xlat58.x / u_xlat8.x;

    u_xlat34 = u_xlat57 / u_xlat85;

    u_xlat60.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat14.xz = float2(0.5, 0.5) / u_xlat60.xy;

    u_xlat60.xy = float2(1.0, 1.0) / u_xlat60.xy;

    u_xlat60.xy = (-u_xlat60.xy) + float2(1.0, 1.0);

    u_xlat15.x = fma(u_xlat58.x, u_xlat60.x, u_xlat14.x);

    u_xlat15.y = fma(u_xlat34, u_xlat60.y, u_xlat14.z);

    u_xlat15.xyz = float3(transmittance_texture.sample(samplertransmittance_texture, u_xlat15.xy, level(0.0)).xyz);

    u_xlat15.xyz = (bool(u_xlatb79)) ? float3(0.0, 0.0, 0.0) : u_xlat15.xyz;

    u_xlat22.w = fma(u_xlat34, u_xlat16.x, u_xlat68.x);

    u_xlat32.x = fma(u_xlat31.x, u_xlat31.x, (-u_xlat32.x));

    u_xlat32.x = fma(FGlobals.bottom_radius, FGlobals.bottom_radius, u_xlat32.x);

    u_xlat58.x = max(u_xlat32.x, 0.0);

    u_xlat58.x = sqrt(u_xlat58.x);

    u_xlat58.x = (-u_xlat31.x) + (-u_xlat58.x);

    u_xlat83 = u_xlat31.z + (-FGlobals.bottom_radius);

    u_xlatb34 = u_xlat83==u_xlat57;

    u_xlat58.x = (-u_xlat83) + u_xlat58.x;

    u_xlat57 = (-u_xlat83) + u_xlat57;

    u_xlat57 = u_xlat58.x / u_xlat57;

    u_xlat57 = (u_xlatb34) ? 0.0 : u_xlat57;

    u_xlat57 = fma(u_xlat57, u_xlat42.x, u_xlat94);

    u_xlat57 = fma((-u_xlat57), 0.5, 0.5);

    u_xlat83 = fma(u_xlat85, u_xlat85, u_xlat32.x);

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat83 = sqrt(u_xlat83);

    u_xlat31.x = u_xlat83 + (-u_xlat31.x);

    u_xlat31.x = (-u_xlat84) + u_xlat31.x;

    u_xlat31.x = u_xlat31.x / u_xlat8.x;

    u_xlat31.x = fma(u_xlat31.x, u_xlat42.x, u_xlat94);

    u_xlat31.x = fma(u_xlat31.x, 0.5, 0.5);

    u_xlat22.z = (u_xlatb79) ? u_xlat57 : u_xlat31.x;

    u_xlat79 = fma(u_xlat82, u_xlat82, -1.0);

    u_xlat79 = fma(u_xlat62.x, u_xlat79, u_xlat62.y);

    u_xlat79 = max(u_xlat79, 0.0);

    u_xlat79 = sqrt(u_xlat79);

    u_xlat79 = fma((-FGlobals.bottom_radius), u_xlat82, u_xlat79);

    u_xlat79 = max(u_xlat79, 0.0);

    u_xlat79 = (-u_xlat36) + u_xlat79;

    u_xlat79 = u_xlat79 / u_xlat89;

    u_xlat82 = u_xlat79 / u_xlat92;

    u_xlat82 = (-u_xlat82) + 1.0;

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat79 = u_xlat79 + 1.0;

    u_xlat79 = u_xlat82 / u_xlat79;

    u_xlat79 = fma(u_xlat79, u_xlat17.x, u_xlat93);

    u_xlat82 = u_xlat5.x + 1.0;

    u_xlat82 = u_xlat45 * u_xlat82;

    u_xlat31.x = u_xlat82 * 0.5;

    u_xlat31.x = floor(u_xlat31.x);

    u_xlat82 = fma(u_xlat82, 0.5, (-u_xlat31.x));

    u_xlat79 = u_xlat79 + u_xlat31.x;

    u_xlat22.y = u_xlat79 / u_xlat17.y;

    u_xlat79 = u_xlat79 + 1.0;

    u_xlat22.x = u_xlat79 / u_xlat17.y;

    u_xlat16_31.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat22.yzw, level(1.0)).xyz;

    u_xlat79 = (-u_xlat82) + 1.0;

    u_xlat16_32.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat22.xzw, level(1.0)).xyz;

    u_xlat32.xyz = float3(u_xlat82) * float3(u_xlat16_32.xyz);

    u_xlat31.xyz = fma(float3(u_xlat16_31.xyz), float3(u_xlat79), u_xlat32.xyz);

    u_xlat79 = fma(u_xlat5.x, u_xlat5.x, 1.0);

    u_xlat79 = u_xlat79 * 0.0596831031;

    u_xlat5.xyz = float3(u_xlat79) * u_xlat31.xyz;

    } else {

    u_xlat15.x = float(1.0);

    u_xlat15.y = float(1.0);

    u_xlat15.z = float(1.0);

    u_xlat5.x = float(0.0);

    u_xlat5.y = float(0.0);

    u_xlat5.z = float(0.0);

    }

    u_xlat5.xyz = u_xlat5.xyz * FGlobals.SKY_SPECTRAL_RADIANCE_TO_LUMINANCE.xyzx.xyz;

    u_xlat79 = dot(u_xlat15.xyz, float3(0.300000012, 0.589999974, 0.109999999));

    u_xlat79 = (-u_xlat79) + 1.0;

    u_xlat79 = u_xlat79 * 0.349999994;

    u_xlat32.xyz = u_xlat11.xyz * float3(u_xlat79);

    u_xlat32.xyz = u_xlat32.xyz * float3(FGlobals._OC_NightScattering);

    u_xlat5.xyz = fma(u_xlat5.xyz, float3(FGlobals._OC_AtmosphereExposure), u_xlat32.xyz);

    u_xlat79 = (-u_xlat23.x) * FGlobals._OC_MieScatteringParams.w;

    u_xlat79 = exp2(u_xlat79);

    u_xlat79 = (-u_xlat79) + 1.0;

    u_xlat79 = u_xlat79 * u_xlat79;

    u_xlat79 = u_xlat79 * u_xlat79;

    if(u_xlatb18){

    u_xlat82 = u_xlat64 * u_xlat64;

    u_xlat83 = fma(u_xlat64, u_xlat64, (-u_xlat62.x));

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat83 = sqrt(u_xlat83);

    u_xlat32.x = fma(u_xlat40, u_xlat40, -1.0);

    u_xlat82 = fma(u_xlat82, u_xlat32.x, u_xlat62.y);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat82 = fma(u_xlat64, u_xlat40, u_xlat82);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat32.x = (-u_xlat64) + FGlobals.top_radius;

    u_xlat58.x = u_xlat85 + u_xlat83;

    u_xlat82 = u_xlat82 + (-u_xlat32.x);

    u_xlat32.x = (-u_xlat32.x) + u_xlat58.x;

    u_xlat82 = u_xlat82 / u_xlat32.x;

    u_xlat83 = u_xlat83 / u_xlat85;

    u_xlat32.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat8.xy = float2(0.5, 0.5) / u_xlat32.xy;

    u_xlat32.xy = float2(1.0, 1.0) / u_xlat32.xy;

    u_xlat32.xy = (-u_xlat32.xy) + float2(1.0, 1.0);

    u_xlat15.x = fma(u_xlat82, u_xlat32.x, u_xlat8.x);

    u_xlat15.y = fma(u_xlat83, u_xlat32.y, u_xlat8.y);

    u_xlat16_15.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat15.xy, level(0.0)).xyz;

    u_xlat82 = fma(u_xlat69.y, u_xlat69.y, (-u_xlat62.x));

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat83 = fma(u_xlat44, u_xlat10.x, u_xlat62.y);

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat83 = sqrt(u_xlat83);

    u_xlat83 = u_xlat83 + u_xlat69.x;

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat84 = (-u_xlat69.y) + FGlobals.top_radius;

    u_xlat60.x = u_xlat85 + u_xlat82;

    u_xlat83 = u_xlat83 + (-u_xlat84);

    u_xlat84 = (-u_xlat84) + u_xlat60.x;

    u_xlat83 = u_xlat83 / u_xlat84;

    u_xlat82 = u_xlat82 / u_xlat85;

    u_xlat22.x = fma(u_xlat83, u_xlat32.x, u_xlat8.x);

    u_xlat22.y = fma(u_xlat82, u_xlat32.y, u_xlat8.y);

    u_xlat16_32.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat22.xy, level(0.0)).xyz;

    u_xlat16_32.xyz = u_xlat16_15.xyz / u_xlat16_32.xyz;

    u_xlat32.xyz = min(float3(u_xlat16_32.xyz), float3(1.0, 1.0, 1.0));

    } else {

    u_xlat82 = fma(u_xlat69.y, u_xlat69.y, (-u_xlat62.x));

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat83 = fma(u_xlat44, u_xlat10.x, u_xlat62.y);

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat83 = sqrt(u_xlat83);

    u_xlat83 = u_xlat83 + (-u_xlat69.x);

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat8.x = (-u_xlat69.y) + FGlobals.top_radius;

    u_xlat34 = u_xlat85 + u_xlat82;

    u_xlat83 = u_xlat83 + (-u_xlat8.x);

    u_xlat8.x = (-u_xlat8.x) + u_xlat34;

    u_xlat83 = u_xlat83 / u_xlat8.x;

    u_xlat82 = u_xlat82 / u_xlat85;

    u_xlat8.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat60.xy = float2(0.5, 0.5) / u_xlat8.xy;

    u_xlat8.xy = float2(1.0, 1.0) / u_xlat8.xy;

    u_xlat8.xy = (-u_xlat8.xy) + float2(1.0, 1.0);

    u_xlat15.x = fma(u_xlat83, u_xlat8.x, u_xlat60.x);

    u_xlat15.y = fma(u_xlat82, u_xlat8.y, u_xlat60.y);

    u_xlat16_15.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat15.xy, level(0.0)).xyz;

    u_xlat82 = u_xlat64 * u_xlat64;

    u_xlat83 = fma(u_xlat64, u_xlat64, (-u_xlat62.x));

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat83 = sqrt(u_xlat83);

    u_xlat91 = fma(u_xlat40, u_xlat40, -1.0);

    u_xlat82 = fma(u_xlat82, u_xlat91, u_xlat62.y);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat82 = fma((-u_xlat64), u_xlat40, u_xlat82);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat91 = (-u_xlat64) + FGlobals.top_radius;

    u_xlat14.x = u_xlat85 + u_xlat83;

    u_xlat82 = u_xlat82 + (-u_xlat91);

    u_xlat91 = (-u_xlat91) + u_xlat14.x;

    u_xlat82 = u_xlat82 / u_xlat91;

    u_xlat83 = u_xlat83 / u_xlat85;

    u_xlat22.x = fma(u_xlat82, u_xlat8.x, u_xlat60.x);

    u_xlat22.y = fma(u_xlat83, u_xlat8.y, u_xlat60.y);

    u_xlat16_8.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat22.xy, level(0.0)).xyz;

    u_xlat16_8.xyz = u_xlat16_15.xyz / u_xlat16_8.xyz;

    u_xlat32.xyz = min(float3(u_xlat16_8.xyz), float3(1.0, 1.0, 1.0));

    }

    u_xlat32.xyz = u_xlat32.xyz + float3(-1.0, -1.0, -1.0);

    u_xlat32.xyz = fma(u_xlat32.xyz, float3(0.5, 0.5, 0.5), float3(1.0, 1.0, 1.0));

    u_xlat8.xyz = float3(u_xlat79) * u_xlat9.xyz;

    u_xlat8.xyz = float3(u_xlat87) * u_xlat8.xyz;

    u_xlat8.xyz = float3(u_xlat70) * u_xlat8.xyz;

    u_xlat5.xyz = fma(u_xlat8.xyz, u_xlat32.xyz, u_xlat5.xyz);

    u_xlat5.xyz = u_xlat5.xyz * FGlobals._OC_FogColor.xyz;

    u_xlat3.xzw = fma(u_xlat5.xyz, u_xlat12.xyw, u_xlat3.xzw);

    u_xlat1.y = u_xlat23.z;

    u_xlat1.xyz = u_xlat1.xyz + (-FGlobals._ScattEarthCenter.xxyz.yzw);

    u_xlat5.xyz = (-u_xlat13.xyz) + u_xlat1.xyz;

    u_xlat79 = dot(u_xlat5.xyz, u_xlat5.xyz);

    u_xlat79 = rsqrt(u_xlat79);

    u_xlat5.xyz = float3(u_xlat79) * u_xlat5.xyz;

    u_xlat21.z = dot(u_xlat13.xyz, u_xlat5.xyz);

    u_xlat79 = fma(u_xlat21.z, u_xlat21.z, (-u_xlat6.x));

    u_xlat79 = fma(FGlobals.top_radius, FGlobals.top_radius, u_xlat79);

    u_xlat79 = sqrt(u_xlat79);

    u_xlat24.z = (-u_xlat79);

    u_xlat79 = (-u_xlat21.z) + u_xlat24.z;

    u_xlatb82 = 0.0<u_xlat79;

    u_xlat6.xyz = fma(u_xlat5.xyz, float3(u_xlat79), u_xlat13.xyz);

    u_xlat6.xyz = (bool(u_xlatb82)) ? u_xlat6.xyz : u_xlat13.xyz;

    u_xlat8.xy = (bool(u_xlatb82)) ? u_xlat24.zw : u_xlat21.zx;

    u_xlat79 = u_xlat8.x / u_xlat8.y;

    u_xlat82 = dot(u_xlat6.xyz, (-FGlobals._OC_ActualSunDir.xyzx.xyz));

    u_xlat83 = u_xlat82 / u_xlat8.y;

    u_xlat5.x = dot(u_xlat5.xyz, (-FGlobals._OC_ActualSunDir.xyzx.xyz));

    u_xlat1.xyz = u_xlat1.xyz + (-u_xlat6.xyz);

    u_xlat1.x = dot(u_xlat1.xyz, u_xlat1.xyz);

    u_xlat27 = sqrt(u_xlat1.x);

    u_xlatb53 = u_xlat79<0.0;

    u_xlat31.x = u_xlat8.y * u_xlat8.y;

    u_xlat79 = fma(u_xlat79, u_xlat79, -1.0);

    u_xlat57 = fma(u_xlat31.x, u_xlat79, u_xlat62.x);

    u_xlatb57 = u_xlat57>=0.0;

    u_xlatb53 = u_xlatb53 && u_xlatb57;

    u_xlat57 = dot(u_xlat8.xx, float2(u_xlat27));

    u_xlat1.x = u_xlat1.x + u_xlat57;

    u_xlat1.x = fma(u_xlat8.y, u_xlat8.y, u_xlat1.x);

    u_xlat1.x = sqrt(u_xlat1.x);

    u_xlat1.x = max(u_xlat1.x, FGlobals.bottom_radius);

    u_xlat1.x = min(u_xlat1.x, FGlobals.top_radius);

    u_xlat57 = u_xlat27 + u_xlat8.x;

    u_xlat6.x = u_xlat57 / u_xlat1.x;

    u_xlat6.x = max(u_xlat6.x, -1.0);

    u_xlat6.x = min(u_xlat6.x, 1.0);

    if(u_xlatb53){

    u_xlat32.x = u_xlat1.x * u_xlat1.x;

    u_xlat58.x = fma(u_xlat1.x, u_xlat1.x, (-u_xlat62.x));

    u_xlat32.y = max(u_xlat58.x, 0.0);

    u_xlat84 = fma(u_xlat6.x, u_xlat6.x, -1.0);

    u_xlat32.x = fma(u_xlat32.x, u_xlat84, u_xlat62.y);

    u_xlat32.x = max(u_xlat32.x, 0.0);

    u_xlat32.xy = sqrt(u_xlat32.xy);

    u_xlat32.x = fma(u_xlat1.x, u_xlat6.x, u_xlat32.x);

    u_xlat32.x = max(u_xlat32.x, 0.0);

    u_xlat84 = (-u_xlat1.x) + FGlobals.top_radius;

    u_xlat60.x = u_xlat85 + u_xlat32.y;

    u_xlat32.x = (-u_xlat84) + u_xlat32.x;

    u_xlat84 = (-u_xlat84) + u_xlat60.x;

    u_xlat32.x = u_xlat32.x / u_xlat84;

    u_xlat58.x = u_xlat32.y / u_xlat85;

    u_xlat60.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat9.xy = float2(0.5, 0.5) / u_xlat60.xy;

    u_xlat60.xy = float2(1.0, 1.0) / u_xlat60.xy;

    u_xlat60.xy = (-u_xlat60.xy) + float2(1.0, 1.0);

    u_xlat12.x = fma(u_xlat32.x, u_xlat60.x, u_xlat9.x);

    u_xlat12.y = fma(u_xlat58.x, u_xlat60.y, u_xlat9.y);

    u_xlat16_32.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat12.xy, level(0.0)).xyz;

    u_xlat61.x = fma(u_xlat8.y, u_xlat8.y, (-u_xlat62.x));

    u_xlat61.x = max(u_xlat61.x, 0.0);

    u_xlat61.x = sqrt(u_xlat61.x);

    u_xlat12.x = fma(u_xlat31.x, u_xlat79, u_xlat62.y);

    u_xlat12.x = max(u_xlat12.x, 0.0);

    u_xlat12.x = sqrt(u_xlat12.x);

    u_xlat12.x = u_xlat8.x + u_xlat12.x;

    u_xlat12.x = max(u_xlat12.x, 0.0);

    u_xlat38 = (-u_xlat8.y) + FGlobals.top_radius;

    u_xlat90 = u_xlat85 + u_xlat61.x;

    u_xlat12.x = (-u_xlat38) + u_xlat12.x;

    u_xlat38 = (-u_xlat38) + u_xlat90;

    u_xlat12.x = u_xlat12.x / u_xlat38;

    u_xlat61.x = u_xlat61.x / u_xlat85;

    u_xlat12.x = fma(u_xlat12.x, u_xlat60.x, u_xlat9.x);

    u_xlat12.y = fma(u_xlat61.x, u_xlat60.y, u_xlat9.y);

    u_xlat16_9.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat12.xy, level(0.0)).xyz;

    u_xlat16_32.xyz = u_xlat16_32.xyz / u_xlat16_9.xyz;

    u_xlat32.xyz = min(float3(u_xlat16_32.xyz), float3(1.0, 1.0, 1.0));

    } else {

    u_xlat60.x = fma(u_xlat8.y, u_xlat8.y, (-u_xlat62.x));

    u_xlat60.x = max(u_xlat60.x, 0.0);

    u_xlat60.x = sqrt(u_xlat60.x);

    u_xlat79 = fma(u_xlat31.x, u_xlat79, u_xlat62.y);

    u_xlat79 = max(u_xlat79, 0.0);

    u_xlat79 = sqrt(u_xlat79);

    u_xlat79 = u_xlat79 + (-u_xlat8.x);

    u_xlat79 = max(u_xlat79, 0.0);

    u_xlat86 = (-u_xlat8.y) + FGlobals.top_radius;

    u_xlat9.x = u_xlat85 + u_xlat60.x;

    u_xlat79 = u_xlat79 + (-u_xlat86);

    u_xlat86 = (-u_xlat86) + u_xlat9.x;

    u_xlat79 = u_xlat79 / u_xlat86;

    u_xlat60.x = u_xlat60.x / u_xlat85;

    u_xlat9.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat12.xy = float2(0.5, 0.5) / u_xlat9.xy;

    u_xlat9.xy = float2(1.0, 1.0) / u_xlat9.xy;

    u_xlat9.xy = (-u_xlat9.xy) + float2(1.0, 1.0);

    u_xlat13.x = fma(u_xlat79, u_xlat9.x, u_xlat12.x);

    u_xlat13.y = fma(u_xlat60.x, u_xlat9.y, u_xlat12.y);

    u_xlat16_13.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat13.xy, level(0.0)).xyz;

    u_xlat79 = u_xlat1.x * u_xlat1.x;

    u_xlat60.x = fma(u_xlat1.x, u_xlat1.x, (-u_xlat62.x));

    u_xlat60.x = max(u_xlat60.x, 0.0);

    u_xlat60.x = sqrt(u_xlat60.x);

    u_xlat86 = fma(u_xlat6.x, u_xlat6.x, -1.0);

    u_xlat79 = fma(u_xlat79, u_xlat86, u_xlat62.y);

    u_xlat79 = max(u_xlat79, 0.0);

    u_xlat79 = sqrt(u_xlat79);

    u_xlat79 = fma((-u_xlat1.x), u_xlat6.x, u_xlat79);

    u_xlat79 = max(u_xlat79, 0.0);

    u_xlat6.x = (-u_xlat1.x) + FGlobals.top_radius;

    u_xlat86 = u_xlat85 + u_xlat60.x;

    u_xlat79 = u_xlat79 + (-u_xlat6.x);

    u_xlat6.x = (-u_xlat6.x) + u_xlat86;

    u_xlat79 = u_xlat79 / u_xlat6.x;

    u_xlat6.x = u_xlat60.x / u_xlat85;

    u_xlat15.x = fma(u_xlat79, u_xlat9.x, u_xlat12.x);

    u_xlat15.y = fma(u_xlat6.x, u_xlat9.y, u_xlat12.y);

    u_xlat16_9.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat15.xy, level(0.0)).xyz;

    u_xlat16_9.xyz = u_xlat16_13.xyz / u_xlat16_9.xyz;

    u_xlat32.xyz = min(float3(u_xlat16_9.xyz), float3(1.0, 1.0, 1.0));

    }

    u_xlat79 = fma(u_xlat8.y, u_xlat8.y, (-u_xlat62.x));

    u_xlat79 = max(u_xlat79, 0.0);

    u_xlat79 = sqrt(u_xlat79);

    u_xlat6.x = u_xlat79 / u_xlat85;

    u_xlat13.w = fma(u_xlat6.x, u_xlat16.x, u_xlat68.x);

    u_xlat31.x = fma(u_xlat8.x, u_xlat8.x, (-u_xlat31.x));

    u_xlat31.x = fma(FGlobals.bottom_radius, FGlobals.bottom_radius, u_xlat31.x);

    u_xlat6.x = max(u_xlat31.x, 0.0);

    u_xlat6.x = sqrt(u_xlat6.x);

    u_xlat6.x = (-u_xlat6.x) + (-u_xlat8.x);

    u_xlat60.x = u_xlat8.y + (-FGlobals.bottom_radius);

    u_xlatb86 = u_xlat79==u_xlat60.x;

    u_xlat6.x = u_xlat6.x + (-u_xlat60.x);

    u_xlat60.x = u_xlat79 + (-u_xlat60.x);

    u_xlat6.x = u_xlat6.x / u_xlat60.x;

    u_xlat6.x = (u_xlatb86) ? 0.0 : u_xlat6.x;

    u_xlat6.x = fma(u_xlat6.x, u_xlat42.x, u_xlat94);

    u_xlat6.x = fma((-u_xlat6.x), 0.5, 0.5);

    u_xlat31.x = fma(u_xlat85, u_xlat85, u_xlat31.x);

    u_xlat31.x = max(u_xlat31.x, 0.0);

    u_xlat31.x = sqrt(u_xlat31.x);

    u_xlat31.x = u_xlat31.x + (-u_xlat8.x);

    u_xlat8.x = (-u_xlat8.y) + FGlobals.top_radius;

    u_xlat79 = u_xlat85 + u_xlat79;

    u_xlat31.x = u_xlat31.x + (-u_xlat8.x);

    u_xlat79 = (-u_xlat8.x) + u_xlat79;

    u_xlat79 = u_xlat31.x / u_xlat79;

    u_xlat79 = fma(u_xlat79, u_xlat42.x, u_xlat94);

    u_xlat79 = fma(u_xlat79, 0.5, 0.5);

    u_xlat13.z = (u_xlatb53) ? u_xlat6.x : u_xlat79;

    u_xlat79 = fma(u_xlat83, u_xlat83, -1.0);

    u_xlat79 = fma(u_xlat62.x, u_xlat79, u_xlat62.y);

    u_xlat79 = max(u_xlat79, 0.0);

    u_xlat79 = sqrt(u_xlat79);

    u_xlat79 = fma((-FGlobals.bottom_radius), u_xlat83, u_xlat79);

    u_xlat79 = max(u_xlat79, 0.0);

    u_xlat79 = (-u_xlat36) + u_xlat79;

    u_xlat79 = u_xlat79 / u_xlat89;

    u_xlat31.x = u_xlat79 / u_xlat92;

    u_xlat31.x = (-u_xlat31.x) + 1.0;

    u_xlat31.x = max(u_xlat31.x, 0.0);

    u_xlat79 = u_xlat79 + 1.0;

    u_xlat79 = u_xlat31.x / u_xlat79;

    u_xlat79 = fma(u_xlat79, u_xlat17.x, u_xlat93);

    u_xlat31.x = u_xlat5.x + 1.0;

    u_xlat31.x = u_xlat45 * u_xlat31.x;

    u_xlat83 = u_xlat31.x * 0.5;

    u_xlat83 = floor(u_xlat83);

    u_xlat31.x = fma(u_xlat31.x, 0.5, (-u_xlat83));

    u_xlat6.x = u_xlat79 + u_xlat83;

    u_xlat13.y = u_xlat6.x / u_xlat17.y;

    u_xlat6.x = u_xlat83 + 1.0;

    u_xlat79 = u_xlat79 + u_xlat6.x;

    u_xlat13.x = u_xlat79 / u_xlat17.y;

    u_xlat16_8.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat13.yzw, level(1.0)).xyz;

    u_xlat79 = (-u_xlat31.x) + 1.0;

    u_xlat16_9.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat13.xzw, level(1.0)).xyz;

    u_xlat9.xyz = u_xlat31.xxx * float3(u_xlat16_9.xyz);

    u_xlat8.xyz = fma(float3(u_xlat16_8.xyz), float3(u_xlat79), u_xlat9.xyz);

    u_xlat27 = fma(u_xlat27, u_xlat5.x, u_xlat82);

    u_xlat27 = u_xlat27 / u_xlat1.x;

    u_xlat82 = u_xlat1.x * u_xlat1.x;

    u_xlat86 = fma(u_xlat1.x, u_xlat1.x, (-u_xlat62.x));

    u_xlat86 = max(u_xlat86, 0.0);

    u_xlat86 = sqrt(u_xlat86);

    u_xlat9.x = u_xlat86 / u_xlat85;

    u_xlat13.w = fma(u_xlat9.x, u_xlat16.x, u_xlat68.x);

    u_xlat82 = fma(u_xlat57, u_xlat57, (-u_xlat82));

    u_xlat82 = fma(FGlobals.bottom_radius, FGlobals.bottom_radius, u_xlat82);

    u_xlat9.x = max(u_xlat82, 0.0);

    u_xlat9.x = sqrt(u_xlat9.x);

    u_xlat9.x = (-u_xlat57) + (-u_xlat9.x);

    u_xlat35.x = u_xlat1.x + (-FGlobals.bottom_radius);

    u_xlatb61 = u_xlat86==u_xlat35.x;

    u_xlat9.x = (-u_xlat35.x) + u_xlat9.x;

    u_xlat35.x = u_xlat86 + (-u_xlat35.x);

    u_xlat9.x = u_xlat9.x / u_xlat35.x;

    u_xlat9.x = (u_xlatb61) ? 0.0 : u_xlat9.x;

    u_xlat9.x = fma(u_xlat9.x, u_xlat42.x, u_xlat94);

    u_xlat9.x = fma((-u_xlat9.x), 0.5, 0.5);

    u_xlat82 = fma(u_xlat85, u_xlat85, u_xlat82);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat82 = u_xlat82 + (-u_xlat57);

    u_xlat1.x = (-u_xlat1.x) + FGlobals.top_radius;

    u_xlat57 = u_xlat85 + u_xlat86;

    u_xlat82 = (-u_xlat1.x) + u_xlat82;

    u_xlat1.x = (-u_xlat1.x) + u_xlat57;

    u_xlat1.x = u_xlat82 / u_xlat1.x;

    u_xlat1.x = fma(u_xlat1.x, u_xlat42.x, u_xlat94);

    u_xlat1.x = fma(u_xlat1.x, 0.5, 0.5);

    u_xlat13.z = (u_xlatb53) ? u_xlat9.x : u_xlat1.x;

    u_xlat1.x = fma(u_xlat27, u_xlat27, -1.0);

    u_xlat1.x = fma(u_xlat62.x, u_xlat1.x, u_xlat62.y);

    u_xlat1.x = max(u_xlat1.x, 0.0);

    u_xlat1.x = sqrt(u_xlat1.x);

    u_xlat1.x = fma((-FGlobals.bottom_radius), u_xlat27, u_xlat1.x);

    u_xlat1.x = max(u_xlat1.x, 0.0);

    u_xlat1.x = (-u_xlat36) + u_xlat1.x;

    u_xlat1.x = u_xlat1.x / u_xlat89;

    u_xlat27 = u_xlat1.x / u_xlat92;

    u_xlat27 = (-u_xlat27) + 1.0;

    u_xlat27 = max(u_xlat27, 0.0);

    u_xlat1.x = u_xlat1.x + 1.0;

    u_xlat1.x = u_xlat27 / u_xlat1.x;

    u_xlat1.x = fma(u_xlat1.x, u_xlat17.x, u_xlat93);

    u_xlat1.y = u_xlat1.x + u_xlat83;

    u_xlat1.x = u_xlat1.x + u_xlat6.x;

    u_xlat13.xy = u_xlat1.xy / u_xlat17.yy;

    u_xlat16_1.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat13.yzw, level(1.0)).xyz;

    u_xlat16_9.xyz = scattering_texture.sample(samplerscattering_texture, u_xlat13.xzw, level(1.0)).xyz;

    u_xlat31.xyz = u_xlat31.xxx * float3(u_xlat16_9.xyz);

    u_xlat1.xyz = fma(float3(u_xlat16_1.xyz), float3(u_xlat79), u_xlat31.xyz);

    u_xlat1.xyz = fma((-u_xlat32.xyz), u_xlat1.xyz, u_xlat8.xyz);

    u_xlat79 = fma(u_xlat5.x, u_xlat5.x, 1.0);

    u_xlat79 = u_xlat79 * 0.0596831031;

    u_xlat1.xyz = float3(u_xlat79) * u_xlat1.xyz;

    u_xlat1.xyz = u_xlat1.xyz * FGlobals.SKY_SPECTRAL_RADIANCE_TO_LUMINANCE.xyzx.xyz;

    u_xlat1.xyz = u_xlat7.xyz * u_xlat1.xyz;

    u_xlat1.xyz = u_xlat1.xyz * FGlobals._OC_ActualSunColor.www;

    u_xlat1.xyz = u_xlat1.xyz * float3(FGlobals._OC_AtmosphereExposure);

    u_xlat1.xyz = max(u_xlat1.xyz, float3(0.0, 0.0, 0.0));

    u_xlat79 = dot(u_xlat32.xyz, float3(0.300000012, 0.589999974, 0.109999999));

    u_xlat79 = (-u_xlat79) + 1.0;

    u_xlat79 = u_xlat79 * 0.349999994;

    u_xlat5.xyz = u_xlat11.xyz * float3(u_xlat79);

    u_xlat1.xyz = fma(u_xlat5.xyz, float3(FGlobals._OC_NightScattering), u_xlat1.xyz);

    u_xlat5.xyz = u_xlat32.xyz + float3(-1.0, -1.0, -1.0);

    u_xlat5.xyz = fma(float3(FGlobals._OC_AtmosphereDensity), u_xlat5.xyz, float3(1.0, 1.0, 1.0));

    u_xlat79 = (-u_xlat2) * FGlobals._OC_MieScatteringParams.w;

    u_xlat79 = exp2(u_xlat79);

    u_xlat79 = (-u_xlat79) + 1.0;

    u_xlat79 = u_xlat79 * u_xlat79;

    u_xlat79 = u_xlat79 * u_xlat79;

    if(u_xlatb18){

    u_xlat82 = u_xlat64 * u_xlat64;

    u_xlat83 = fma(u_xlat64, u_xlat64, (-u_xlat62.x));

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat83 = sqrt(u_xlat83);

    u_xlat6.x = fma(u_xlat40, u_xlat40, -1.0);

    u_xlat82 = fma(u_xlat82, u_xlat6.x, u_xlat62.y);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat82 = fma(u_xlat64, u_xlat40, u_xlat82);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat6.x = (-u_xlat64) + FGlobals.top_radius;

    u_xlat32.x = u_xlat85 + u_xlat83;

    u_xlat82 = u_xlat82 + (-u_xlat6.x);

    u_xlat6.x = (-u_xlat6.x) + u_xlat32.x;

    u_xlat82 = u_xlat82 / u_xlat6.x;

    u_xlat83 = u_xlat83 / u_xlat85;

    u_xlat6.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat58.xy = float2(0.5, 0.5) / u_xlat6.xy;

    u_xlat6.xy = float2(1.0, 1.0) / u_xlat6.xy;

    u_xlat6.xy = (-u_xlat6.xy) + float2(1.0, 1.0);

    u_xlat7.x = fma(u_xlat82, u_xlat6.x, u_xlat58.x);

    u_xlat7.y = fma(u_xlat83, u_xlat6.y, u_xlat58.y);

    u_xlat16_7.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat7.xy, level(0.0)).xyz;

    u_xlat82 = fma(u_xlat69.y, u_xlat69.y, (-u_xlat62.x));

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat83 = fma(u_xlat44, u_xlat10.x, u_xlat62.y);

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat83 = sqrt(u_xlat83);

    u_xlat83 = u_xlat83 + u_xlat69.x;

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat8.x = (-u_xlat69.y) + FGlobals.top_radius;

    u_xlat34 = u_xlat85 + u_xlat82;

    u_xlat83 = u_xlat83 + (-u_xlat8.x);

    u_xlat8.x = (-u_xlat8.x) + u_xlat34;

    u_xlat83 = u_xlat83 / u_xlat8.x;

    u_xlat82 = u_xlat82 / u_xlat85;

    u_xlat8.x = fma(u_xlat83, u_xlat6.x, u_xlat58.x);

    u_xlat8.y = fma(u_xlat82, u_xlat6.y, u_xlat58.y);

    u_xlat16_6.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat8.xy, level(0.0)).xyz;

    u_xlat16_6.xyz = u_xlat16_7.xyz / u_xlat16_6.xyz;

    u_xlat6.xyz = min(float3(u_xlat16_6.xyz), float3(1.0, 1.0, 1.0));

    } else {

    u_xlat82 = fma(u_xlat69.y, u_xlat69.y, (-u_xlat62.x));

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat83 = fma(u_xlat44, u_xlat10.x, u_xlat62.y);

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat83 = sqrt(u_xlat83);

    u_xlat83 = u_xlat83 + (-u_xlat69.x);

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat84 = (-u_xlat69.y) + FGlobals.top_radius;

    u_xlat7.x = u_xlat85 + u_xlat82;

    u_xlat83 = u_xlat83 + (-u_xlat84);

    u_xlat84 = (-u_xlat84) + u_xlat7.x;

    u_xlat83 = u_xlat83 / u_xlat84;

    u_xlat82 = u_xlat82 / u_xlat85;

    u_xlat7.xy = float2(int2(FGlobals.TRANSMITTANCE_TEXTURE_WIDTH, FGlobals.TRANSMITTANCE_TEXTURE_HEIGHT));

    u_xlat8.xy = float2(0.5, 0.5) / u_xlat7.xy;

    u_xlat7.xy = float2(1.0, 1.0) / u_xlat7.xy;

    u_xlat7.xy = (-u_xlat7.xy) + float2(1.0, 1.0);

    u_xlat9.x = fma(u_xlat83, u_xlat7.x, u_xlat8.x);

    u_xlat9.y = fma(u_xlat82, u_xlat7.y, u_xlat8.y);

    u_xlat16_9.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat9.xy, level(0.0)).xyz;

    u_xlat82 = u_xlat64 * u_xlat64;

    u_xlat83 = fma(u_xlat64, u_xlat64, (-u_xlat62.x));

    u_xlat83 = max(u_xlat83, 0.0);

    u_xlat83 = sqrt(u_xlat83);

    u_xlat84 = fma(u_xlat40, u_xlat40, -1.0);

    u_xlat82 = fma(u_xlat82, u_xlat84, u_xlat62.y);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat82 = sqrt(u_xlat82);

    u_xlat82 = fma((-u_xlat64), u_xlat40, u_xlat82);

    u_xlat82 = max(u_xlat82, 0.0);

    u_xlat84 = (-u_xlat64) + FGlobals.top_radius;

    u_xlat59 = u_xlat85 + u_xlat83;

    u_xlat82 = u_xlat82 + (-u_xlat84);

    u_xlat84 = (-u_xlat84) + u_xlat59;

    u_xlat82 = u_xlat82 / u_xlat84;

    u_xlat83 = u_xlat83 / u_xlat85;

    u_xlat10.x = fma(u_xlat82, u_xlat7.x, u_xlat8.x);

    u_xlat10.y = fma(u_xlat83, u_xlat7.y, u_xlat8.y);

    u_xlat16_7.xyz = transmittance_texture.sample(samplertransmittance_texture, u_xlat10.xy, level(0.0)).xyz;

    u_xlat16_7.xyz = u_xlat16_9.xyz / u_xlat16_7.xyz;

    u_xlat6.xyz = min(float3(u_xlat16_7.xyz), float3(1.0, 1.0, 1.0));

    }

    u_xlat6.xyz = u_xlat6.xyz + float3(-1.0, -1.0, -1.0);

    u_xlat6.xyz = fma(u_xlat6.xyz, float3(0.5, 0.5, 0.5), float3(1.0, 1.0, 1.0));

    u_xlat26.x = dot((-u_xlat26.xyz), FGlobals._OC_LightDir.xyzx.xyz);

    u_xlat26.x = fma(u_xlat26.x, 0.5, 0.5);

    u_xlat26.x = fma((-u_xlat20.x), u_xlat26.x, 1.0);

    u_xlat26.x = u_xlat26.x * u_xlat26.x;

    u_xlat26.x = u_xlat26.x * 12.566371;

    u_xlat26.x = u_xlat46 / u_xlat26.x;

    u_xlat26.x = u_xlat26.x * FGlobals._OC_MieScatteringParams.x;

    u_xlat26.xyz = u_xlat26.xxx * FGlobals._OC_LightColor.xyzx.xyz;

    u_xlat26.xyz = float3(u_xlat79) * u_xlat26.xyz;

    u_xlat26.xyz = float3(u_xlat87) * u_xlat26.xyz;

    u_xlat26.xyz = float3(u_xlat70) * u_xlat26.xyz;

    u_xlat26.xyz = u_xlat6.xyz * u_xlat26.xyz;

    u_xlat26.xyz = fma(u_xlat1.xyz, float3(FGlobals._OC_AtmosphereDensity), u_xlat26.xyz);

    u_xlat26.xyz = float3(u_xlat16_29) * u_xlat26.xyz;

    u_xlat26.xyz = fma(float3(u_xlat16_4.xyz), u_xlat5.xyz, u_xlat26.xyz);

    u_xlat1.xyz = fma(u_xlat3.xzw, float3(u_xlat16_29), (-u_xlat26.xyz));

    u_xlat0.xyz = fma(u_xlat0.xxx, u_xlat1.xyz, u_xlat26.xyz);

    u_xlat78 = u_xlat2 * FGlobals._OC_FarClipInv;

    u_xlat78 = u_xlat78 * FGlobals._OC_AtmosphereFarClipFade;

    u_xlat78 = clamp(u_xlat78, 0.0f, 1.0f);

    u_xlat78 = fma(u_xlat78, 2.0, -1.0);

    u_xlat78 = max(u_xlat78, 0.0);

    u_xlat78 = fma((-u_xlat78), u_xlat78, 1.0);

    u_xlat0.xyz = (-u_xlat28.xyz) + u_xlat0.xyz;

    u_xlat0.xyz = fma(float3(u_xlat78), u_xlat0.xyz, u_xlat28.xyz);

    u_xlat16_0.xyz = half3(u_xlat0.xyz);

    } else {

    u_xlat16_0.xyz = half3(u_xlat28.xyz);

    }

    output.SV_Target0.xyz = u_xlat16_0.xyz;

    output.SV_Target0.w = half(1.0);

    return output;

    }

    Metal: Blending not supported for format 125

    Metal: Blending not supported for format 125

    Compilation failed:


    program_source:84:21: error: assigning to 'float4' (vector of 4 'float' values) from incompatible type 'half4' (vector of 4 'half' values)

    TempArray0[0] = u_xlat16_4;

    ^~~~~~~~~~

    program_source:86:21: error: assigning to 'float4' (vector of 4 'float' values) from incompatible type 'half4' (vector of 4 'half' values)

    TempArray0[1] = u_xlat16_4;

    ^~~~~~~~~~

    program_source:88:21: error: assigning to 'float4' (vector of 4 'float' values) from incompatible type 'half4' (vector of 4 'half' values)

    TempArray0[2] = u_xlat16_1;

    ^~~~~~~~~~

    program_source:90:21: error: assigning to 'float4' (vector of 4 'float' values) from incompatible type 'half4' (vector of 4 'half' values)

    TempArray0[3] = u_xlat16_1;

    ^~~~~~~~~~

    program_source:129:29: error: assigning to 'half4' (vector of 4 'half' values) from incompatible type 'float4' (vector of 4 'float' values)

    output.SV_Target0 = TempArray0[u_xlati12];

    ^~~~~~~~~~~~~~~~~~~~~




    #include <metal_stdlib>

    #include <metal_texture>

    using namespace metal;

    #if !(__HAVE_FMA__)

    #define fma(a,b,c) ((a) * (b) + (c))

    #endif

    #ifndef XLT_REMAP_O

    #define XLT_REMAP_O {0, 1, 2, 3, 4, 5, 6, 7}

    #endif

    constexpr constant uint xlt_remap_o[] = XLT_REMAP_O;

    struct FGlobals_Type

    {

    float4 _ZBufferParams;

    float4 _PixelSizeDS;

    };

    struct Mtl_FragmentIn

    {

    float2 TEXCOORD0 [[ user(TEXCOORD0) ]] ;

    };

    struct Mtl_FragmentOut

    {

    half4 SV_Target0 [[ color(xlt_remap_o[0]) ]];

    };

    fragment Mtl_FragmentOut xlatMtlMain(

    constant FGlobals_Type& FGlobals [[ buffer(0) ]],

    sampler sampler_MainTex [[ sampler (0) ]],

    sampler sampler_CameraDepthLowRes [[ sampler (1) ]],

    sampler sampler_CameraDepthTexture [[ sampler (2) ]],

    texture2d<float, access::sample > _CameraDepthTexture [[ texture(0) ]] ,

    texture2d<half, access::sample > _MainTex [[ texture(1) ]] ,

    texture2d<half, access::sample > _CameraDepthLowRes [[ texture(2) ]] ,

    Mtl_FragmentIn input [[ stage_in ]])

    {

    Mtl_FragmentOut output;

    float u_xlat0;

    bool u_xlatb0;

    float2 u_xlat1;

    half4 u_xlat16_1;

    float2 u_xlat2;

    float u_xlat3;

    half u_xlat16_3;

    half4 u_xlat16_4;

    half u_xlat16_5;

    float2 u_xlat6;

    bool u_xlatb6;

    half u_xlat16_11;

    int u_xlati12;

    bool u_xlatb12;

    float2 u_xlat13;

    float u_xlat14;

    half u_xlat16_14;

    half u_xlat16_17;

    float u_xlat18;

    half u_xlat16_18;

    bool u_xlatb18;

    float u_xlat20;

    half u_xlat16_20;

    float4 TempArray0[4];

    u_xlat0 = _CameraDepthTexture.sample(sampler_CameraDepthTexture, input.TEXCOORD0.xy).x;

    u_xlat0 = fma(FGlobals._ZBufferParams.x, u_xlat0, FGlobals._ZBufferParams.y);

    u_xlat0 = float(1.0) / u_xlat0;

    u_xlat6.xy = fma((-FGlobals._PixelSizeDS.zw), float2(0.5, 0.5), input.TEXCOORD0.xy);

    u_xlat1.xy = fma(FGlobals._PixelSizeDS.zw, float2(1.0, 0.0), u_xlat6.xy);

    u_xlat13.xy = fma(FGlobals._PixelSizeDS.zw, float2(0.0, 1.0), u_xlat6.xy);

    u_xlat2.xy = u_xlat6.xy + FGlobals._PixelSizeDS.zw;

    u_xlat16_18 = _CameraDepthLowRes.sample(sampler_CameraDepthLowRes, u_xlat6.xy).x;

    u_xlat18 = fma(FGlobals._ZBufferParams.x, float(u_xlat16_18), FGlobals._ZBufferParams.y);

    u_xlat18 = float(1.0) / u_xlat18;

    u_xlat16_14 = _CameraDepthLowRes.sample(sampler_CameraDepthLowRes, u_xlat1.xy).x;

    u_xlat14 = fma(FGlobals._ZBufferParams.x, float(u_xlat16_14), FGlobals._ZBufferParams.y);

    u_xlat14 = float(1.0) / u_xlat14;

    u_xlat16_20 = _CameraDepthLowRes.sample(sampler_CameraDepthLowRes, u_xlat13.xy).x;

    u_xlat20 = fma(FGlobals._ZBufferParams.x, float(u_xlat16_20), FGlobals._ZBufferParams.y);

    u_xlat20 = float(1.0) / u_xlat20;

    u_xlat16_3 = _CameraDepthLowRes.sample(sampler_CameraDepthLowRes, u_xlat2.xy).x;

    u_xlat3 = fma(FGlobals._ZBufferParams.x, float(u_xlat16_3), FGlobals._ZBufferParams.y);

    u_xlat3 = float(1.0) / u_xlat3;

    u_xlat16_4 = _MainTex.sample(sampler_CameraDepthLowRes, u_xlat6.xy);

    TempArray0[0] = u_xlat16_4;

    u_xlat16_4 = _MainTex.sample(sampler_CameraDepthLowRes, u_xlat1.xy);

    TempArray0[1] = u_xlat16_4;

    u_xlat16_1 = _MainTex.sample(sampler_CameraDepthLowRes, u_xlat13.xy);

    TempArray0[2] = u_xlat16_1;

    u_xlat16_1 = _MainTex.sample(sampler_CameraDepthLowRes, u_xlat2.xy);

    TempArray0[3] = u_xlat16_1;

    u_xlat16_5 = half(fma(u_xlat0, 0.0498999991, 9.99999975e-05));

    u_xlat16_11 = half((-u_xlat0) + u_xlat18);

    u_xlatb6 = abs(u_xlat16_11)<u_xlat16_5;

    u_xlatb12 = abs(u_xlat16_11)<half(1.0);

    if(u_xlatb12){

    u_xlat16_11 = abs(u_xlat16_11);

    } else {

    u_xlat16_11 = half(1.0);

    }

    u_xlat16_17 = half((-u_xlat0) + u_xlat14);

    u_xlatb12 = abs(u_xlat16_17)<u_xlat16_5;

    u_xlatb6 = u_xlatb12 && u_xlatb6;

    u_xlatb12 = abs(u_xlat16_17)<u_xlat16_11;

    if(u_xlatb12){

    u_xlat16_11 = abs(u_xlat16_17);

    u_xlati12 = 0x1;

    } else {

    u_xlati12 = 0x0;

    }

    u_xlat16_17 = half((-u_xlat0) + u_xlat20);

    u_xlatb18 = abs(u_xlat16_17)<u_xlat16_5;

    u_xlatb6 = u_xlatb18 && u_xlatb6;

    u_xlatb18 = abs(u_xlat16_17)<u_xlat16_11;

    if(u_xlatb18){

    u_xlat16_11 = abs(u_xlat16_17);

    u_xlati12 = 0x2;

    }

    u_xlat16_17 = half((-u_xlat0) + u_xlat3);

    u_xlatb0 = abs(u_xlat16_17)<u_xlat16_5;

    u_xlatb0 = u_xlatb0 && u_xlatb6;

    u_xlatb6 = abs(u_xlat16_17)<u_xlat16_11;

    if(u_xlatb6){

    u_xlati12 = 0x3;

    }

    if(u_xlatb0){

    u_xlat16_1 = _MainTex.sample(sampler_MainTex, input.TEXCOORD0.xy);

    output.SV_Target0 = u_xlat16_1;

    } else {

    output.SV_Target0 = TempArray0[u_xlati12];

    }

    return output;

    }

    Metal: Blending not supported for format 125

    Metal: Blending not supported for format 125

    Invalid pass number (1) for Graphics.Blit (Material "(Unknown material)" with 1 passes)


    (Filename: Line: 773)


    Invalid pass number (1) for Graphics.Blit (Material "(Unknown material)" with 1 passes)

    OC.OverCloudReflectionProbe:RenderUpdate()


    [ line 773]

    (Filename: Line: 773)


    Invalid pass number (1) for Graphics.Blit (Material "(Unknown material)" with 1 passes)


    (Filename: Line: 773)


    Invalid pass number (1) for Graphics.Blit (Material "(Unknown material)" with 1 passes)

    OC.OverCloudReflectionProbe:RenderUpdate()


    [ line 773]

    (Filename: Line: 773)


    Invalid pass number (1) for Graphics.Blit (Material "(Unknown material)" with 1 passes)


    (Filename: Line: 773)


    2019-10-28 14:48:15.842859+0100 clouds[2640:413235] Execution of the command buffer was aborted due to an error during execution. Caused GPU Timeout Error (IOAF code 2)

    Invalid pass number (1) for Graphics.Blit (Material "(Unknown material)" with 1 passes)

    OC.OverCloudReflectionProbe:RenderUpdate()


    [ line 773]

    (Filename: Line: 773)

    I'm happy to keep trying to get it to work, do you have any idea on what should be changed ?
     
    Last edited: Oct 28, 2019
  36. look001

    look001

    Joined:
    Mar 23, 2017
    Posts:
    50
    Does this asset work with Android?
     
  37. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    If your platform supports floating-point render textures and compute shader (shader model 4+), it should work. However, as most mobile platforms still do not, OverCloud does not officially support neither Android nor iOS.
     
  38. KarlLakner

    KarlLakner

    Joined:
    Jan 30, 2019
    Posts:
    16
    Hey, I'm having a weird issue, which is definitely not a bug, but... I'll post it here and see if anyone (Felix ;))has any ideas:

    I'm running a (almost) standard overcloud, but I've touched pretty much every parameter in overcloud, plus post process, tone mapping etc, to get a particular look. I've tweaked the shader to work witrh LUX, in accordance with Felix' instructions.

    What's happened is the albedo channel of all meshes (except the LUX water!) are completely blacked out by the cloud shadows. They're using a standard shader, and as soon as I move out of the cloud shadows everything's fine. (reflections render however - if I turn them on I get the ovecloud-rendered probe celarly visible.)

    If I toggle shadows on/off, I can tell that's cloud shadows causing it (or at least, toggling them off removes the "pitch black" look).

    Update:
    I'm an idiot, just so that's clear. I've got some results messing with the shadow coverage parameter, and this affects the cloud shadows, but I can't seem to get it to balance the water vs. the meshes. If the shadowes are visible on the water, they're turning meshes black. If the meshes are normally shadowed, the water receives too little shadow.

    Any ideas? :D

    Here are my shadow settings. Anything above 0.125 will black out the albedo on meshes:

     

    Attached Files:

    Last edited: Nov 21, 2019
  39. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    I think I understand why you are having issues balancing the shadows, as I've run into the same problem in regards to water before. Basically, shadows that look good for diffuse lighting look very weak when used for specular higlights on water (probably because of the difference in intensity of the fragments). That said, the coverage parameter should be balanced around having a neutral look at a value of 1.0. Are you using the Cloud AO effect + deferred rendering? This might also be a reason why the lighting appears "blacked out".

    I'll do some internal shader work so the shadows can be sampled with variable intensity, which will allow for overriding the strength for specific shaders (like the water).
     
    KarlLakner likes this.
  40. KarlLakner

    KarlLakner

    Joined:
    Jan 30, 2019
    Posts:
    16
    This is almost certainly it. I've done some more tweaking, and I've had to settle for a middle ground at the moment. I am using both cloud AO effect (as this gives the clouds an amazing "volume" feel) and deferred, have tried switching to forward (which didn't solve anything but also didn't ruin anything much at all which was nice). Will tweak more. If you do have time to patch in avariable intensity variable I would be forever grateful (as I have several gameplay scenarios set entitely over water, and with the "correct" shadows it looks just about beautiful).

    And as always, thanks for the quick response!
     
  41. DaleEidd

    DaleEidd

    Joined:
    Aug 11, 2019
    Posts:
    3
    Thank you for releasing a great asset.

    I am using this with Crest and the horizon renders in front of the ocean. See attached imaged. If I disable the
    OVERCLOUD_OCEAN_BASE function, the issue disappears. What are your thoughts?

    Horizon Issue.jpg

    I am also getting an issue where the volumetric clouds disappear when the camera.y is below or near 0. The noisy image is between -0.5 and 0.5. The other one is below zero. I noticed someone mentioned something similar, but they were referring to the 2D cloud plane. It might be my hardware (MacOS with AMD eGPU).

    Around Zero.jpg Below Zero.jpg

    I am using forward rendering. Far plane is set to 10,000.

    Finally, will the upcoming stamp feature allow different presets? I would like to have a storm in the distance that the player can move towards since weather is location based. If not, if anyone can recommend an asset which can do this then please let me know. Thank you.
     
  42. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    Hi there,

    In the first image when you say horizon, do you mean the thin, horizontal strip of sky visible in the middle of the image, or is the sky occluding the ocean behind the waves? (it's a little hard to tell from the image)

    The "below 0" issue happens because of the planet sphere culling the clouds (mainly it is used for culling stuff beyond the horizon), but AFAIK I added code to prevent this exact issue from happening. I will take a look again using Crest specifically and see if I can replicate+fix it.

    Preset-based stamps is a great suggestion actually. I'm not sure if this is how you meant but how I would implement it is on the stamp object itself, you can add preset strings to a list which will either act as an additive or subtractive mask for the stamp, based on the current preset active on OverCloud.
     
  43. GuitarBro

    GuitarBro

    Joined:
    Oct 9, 2014
    Posts:
    76
    Hi, I was trying out the demo for OverCloud and noticed that sometimes there seemed to be some tiling artifacts, particularly when the sky is completely covered in clouds (see screenshot upper-middle-right-ish area). I was wondering if there are any measures that could be taken to obscure such artifacts (or if perhaps the demo is a bit outdated)?
    upload_2019-11-25_21-32-31.png

    That aside, it's quite an impressive package! Definitely considering picking it up, but figured I'd ask about the tiling beforehand.
     
  44. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    Hi there! There are actually two sources of tiling:
    1. 2D noise (a customizable texture) is rendered to a global coverage buffer (the compositor). Depending on the scale/size of this 2D noise texture, some tiling can appear (depends on the compostior settings).
    2. 3D noise (perlin-worley mix, can be tweaked by the user) is used for two detail passes to give the clouds higher fidelity. Depending on your settings, this can also introduce some tiling.
    The reason why there is any tiling at all is simply performance: Sampling a pre-generated (but tiling) texture is much, much faster than generating the noise on-the-go.
    Usually I've found that there is a good middle-ground to be found between high-detail and having some tiling. If you want to have the sky completely filled with clouds like in the screenshot, I'd recommend tweaking the 3D noise settings until the tiling is no longer visible.
     
  45. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    405
    Hi @Fewes

    Just got Overcloud yesterday and I'm absolutely loving it! It looks amazing.

    One question though, how can I increase the godrays that would shine around a mountain? Is it a combination of multiple components such as fog/atmosphere density or is it fully controlled by mie scattering? I cannot pin-point it.

    Thank you
     
  46. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    Hi! The god rays appear in both the ambient fog lighting and the mie scattering. For a very strong effect, try a Mie Scattering Phase of around 0.75, set the Mie Scattering Intensity to 8, and make sure the Scattering Mask Softness is set to 0.
    You can also try increasing the Fog Density (weather preset param) and lower the Fog Shadow. Doing this too much might give you strange results though.
     
  47. GuitarBro

    GuitarBro

    Joined:
    Oct 9, 2014
    Posts:
    76
    Cool, good to know it can potentially be mitigated. I'll probably scoop it up and play around with it a bit. Thanks!
     
  48. DaleEidd

    DaleEidd

    Joined:
    Aug 11, 2019
    Posts:
    3
    I would like to add that I am using the latest OverCloud. I just re-imported it to be sure.

    The thin horizontal strip in the middle. I think this might be an issue generally since the Weather Maker integration fork of Crest has this commented out. See link:

    https://github.com/DigitalRuby/cres...ts/Crest/Crest/Shaders/OceanExternal.hlsl#L28

    I had Crest disabled for the "below 0" screenshots. Is there a setting that affects this I could tweak?

    I just tested this on a Windows machine using the provided scene by OverCloud without Crest imported. The issue still occurs. When the camera is below zero, the volumetric clouds disappear when looking above the horizon and appear when looking below.

    That sounds fantastic! Is it possible to have the stamp move around at run-time?
     
    Last edited: Nov 27, 2019
  49. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    168
    Thanks for the additional info. There is no setting you can tweak which will affect this, but I will take a look and see if I can fix it.

    Stamps will be drawn once per frame, so there is no reason why you couldn't move them :)
     
  50. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    416
    Hi. I got some real stunning results with crest.
    The cloud shadows similar to Lux would be great.
    Did you have some tips for shadow integration to crest, too.
    I already integrated your shader code from the integration website.