Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

DX9 Shadow Intesity Patch

Featured Replies

  • Commercial Member

First of all, big thanks goes to Steve (the author of DX10 Scenery Fixer) for the help and tips!

 

When I saw shadow intensity improvement in the latest version of DX10 Scenery Fixer, I said why to not have this in DX9 mode? So I contacted Steve for the tips. With his help, it was pretty an easy task.

 

-----------------------

 

So, as most of you saw, the Fixer adjusted the shadow intensity, so no more very pale shadows at visibility below 50mi. The intensity will stay the same down to 3mi visibility radius. Everything below 3mi - the shadow intensity fades.

 

With this simple patch the shadows on the aircraft wil lbe more intensive (darker), and also on the ground (see the examples below).

 

---------------------

 

1. head to FSX main folder -> ShadersHSLS -> General, and make a backup of General.fx and GeneralShadow.fx.

2. open General.fx with notepad, and find this line (about 30 lines from the bottom):
    return float4(0,0,0,(min(fDepth,fShadowIntensity))*fBlend);

 

3. insert this line:
    fShadowIntensity = (fShadowIntensity < 0.0175)? 26.0f * fShadowIntensity : 0.966f;

    just above the line from step 2.

 

   Example:

 

 // Finish off by factoring the "kick-in factor"
    fDepth = saturate(fShadowKickIn * 0.1 * fDepth);

     fShadowIntensity = (fShadowIntensity < 0.0175)? 26.0f * fShadowIntensity : 0.966f;

     return float4(0,0,0,(min(fDepth,fShadowIntensity))*fBlend);


    // Debug/Test code to quickly output the shadow result as a simple color
    //return float4(fDepth*fBlend,0,0,1);

 

4. Save the file and close

5. Open GeneralShadow.fx also with notepad, find this line (2-3 page down presses):
    return (float4(0, 0, 0, fShadowIntensity));

6. insert this line:
    fShadowIntensity = (fShadowIntensity < 0.0175)? 26.0f * fShadowIntensity : 0.566f;

    just above the line from step 5.

 

    Example:

 

    // Pixel shader for flat (old-style) shadows
     float4 FLAT_PS(void) : COLOR
{
   fShadowIntensity = (fShadowIntensity < 0.0175)? 26.0f * fShadowIntensity : 0.566f;
    
   return (float4(0, 0, 0, fShadowIntensity));

}

    // Pixel shader for volume shadow shell rendering (front side)
    float4 VOL_PS(void) : COLOR
 

7. save the file and close

8. rebuild the shaders - head to c:\Users\UserName\AppData\Local\Microsoft\FSX\ and delete Shaders folder (important step)!

9. Load FSX and start hitting V, I know you'll love your new screenshots. :P

 

NOTE: if you find the shadows too dark on some aircraft parts, adjust the value 0.966f from step 3. You can try 0.566 for example, but I found if I want to match shadow intensity on the aircraft with the intensity of the ground shadow, it must be 0.966. Everything below that it's pale for me, probably because the reflection on the aircraft is fading the shadow a bit.

 

Comparisons:

 

default shadows at 10mi visibility:

 

2014-1-23_0-40-43-842_zps8c9d3e47.jpg

 

 

patched:

2014-1-23_0-47-49-125_zps8a49c3b1.jpg


patched shadows + my SweetFX preset:

 

2014-1-23_0-49-12-171_zpsea0fc4cb.jpg


2014-1-23_0-50-15-333_zps9967e915.jpg

 

 

2014-1-23_0-52-40-605_zps53b79c72.jpg

 

 

 

That's it.  B)  Thank Steve for his awesome contribution, and thank me later. :P

 

Cheers!

Current system: ASUS PRIME Z690-P D4, Intel 12900k, 32GB RAM @ 3600mhz, Zotac RTX 3090 Trinity, M2 SSD, Oculus Quest 2.

Even the visibility is low, the shadow still going to be that dark?

 

 

Kin M.

(Klax)

  • Author
  • Commercial Member

The shadow will fade below 3mi visibility.

Current system: ASUS PRIME Z690-P D4, Intel 12900k, 32GB RAM @ 3600mhz, Zotac RTX 3090 Trinity, M2 SSD, Oculus Quest 2.

this is great.  thanks to you and Steve.

R9-9950X3D 32G  | RTX5090 | 3T m.2 | Win11 | vkb-gf ultimate & pedals | virpil cm3 throttle | tm boeing yoke | pimax super uw | DCS

 

 

 

  • Author
  • Commercial Member

You're welcome mate. Enjoy it.

 

Sent from my U8815 using Tapatalk 2

Current system: ASUS PRIME Z690-P D4, Intel 12900k, 32GB RAM @ 3600mhz, Zotac RTX 3090 Trinity, M2 SSD, Oculus Quest 2.

  • Author
  • Commercial Member

Hmmm strange, I didn't had any problems with performance.

Current system: ASUS PRIME Z690-P D4, Intel 12900k, 32GB RAM @ 3600mhz, Zotac RTX 3090 Trinity, M2 SSD, Oculus Quest 2.

This really crippled my framerates. Am I the only one?

 

No problem with frame rate.

 

Hmmm strange, I didn't had any problems with performance.

 

No performance hit, but the edges of the shadows are jagged.

Ric Elmore

 

747-8%20Lufthansa%20Banner%202.jpgAmerican777-300smbanner.jpg 

 

 

I don't run SweetFX I just have ground shadows enabled in the FSX menu as well as all the aircraft shadow options. Also 2nd highest water setting. Is that why my sim slows down so much?

Oh yes, that's much more realistic now! can you upload the file to save us the manual editing work? would really appreciate that. Thanks.

Can similar thing be done for dx10 shader?

R9-9950X3D 32G  | RTX5090 | 3T m.2 | Win11 | vkb-gf ultimate & pedals | virpil cm3 throttle | tm boeing yoke | pimax super uw | DCS

 

 

 

  • Author
  • Commercial Member

Oh yes, that's much more realistic now! can you upload the file to save us the manual editing work? would really appreciate that. Thanks.

 

I can't mate, the shaders have a copyright notice. I didn't meant to make you all edit the files because I'm bored, that's for sure. :lol:

 

Can similar thing be done for dx10 shader?

 

Shadow Intensity fix is already in the latest version of DX10 Scenery Fixer.

Current system: ASUS PRIME Z690-P D4, Intel 12900k, 32GB RAM @ 3600mhz, Zotac RTX 3090 Trinity, M2 SSD, Oculus Quest 2.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.