Jump to content
Sign in to follow this  
Pe11e

DX9 Shadow Intesity Patch

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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

 

 

Kin M.

(Klax)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

this is great.  thanks to you and Steve.


i9-10900k @ 5.1GHz 32G XMP-3200 | RTX3090 | 3T m.2 | Win11 | vkb-gf ultimate & pedals | virpil cm3 throttle | 55" 4k UHDTV | HP R-G2 VR | DCS

 

 

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Can similar thing be done for dx10 shader?


i9-10900k @ 5.1GHz 32G XMP-3200 | RTX3090 | 3T m.2 | Win11 | vkb-gf ultimate & pedals | virpil cm3 throttle | 55" 4k UHDTV | HP R-G2 VR | DCS

 

 

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...