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.

Better Rain

Featured Replies

Hi,

I live in the UK and it's rained a fair bit lately. Does anyone know of a better rain texture/effect for P3D as the standard issue is so un-realistic?

Thanks in advance.

Phil

I was watching a news report on TV a couple of days ago.  They had a camera in a helicopter, flying through the rain.  One brief shot out the side window surprised me... the rain looked exactly like it does in FSX.  That's not to say it would from all angles, but it certainly did in that one shot.

 

Hook

Larry Hookins

 

Oh! I have slipped the surly bonds of Earth
And danced the skies on laughter-silvered wings;

Would be great to know also if the rain effect will be visible in vc... :rolleyes:

Boeing777_Banner_Pilot.jpg

"Does anyone know of a better rain texture/effect for P3D as the standard issue is so un-realistic?"

 

The tweaks to the shader that work for FSX DX-10 also work for P3D.

These make the drops less bright and ameliorate the tunnel effect.

Works for snow and rain.

 

But, the file location and editing is not identical, so some extra effort is required.

.....

But, the file location and editing is not identical, so some extra effort is required.

Why don't you tell us the details?

Spirit

Why don't you tell us the details?

Spirit

Will do once I'm at my home PC later this evening.

 

Ken

Will do once I'm at my home PC later this evening.

 

Ken

Hi Ken,

great - we're waiting.

Spirit

  • 2 weeks later...
Sorry for the delay.
Here is a way to improve rain/snow effects. This requires changing the shader code, so be mindful of what you're getting into.  It's based on hard work by others, I only ported it to P3D.  When done, delete the Shader folder in User/AppData/Local/Lockheed Martin/Prepar3D V2/ so that the code will be recompiled.
 
The file to change is located in the root Prepar3D folder
MAKE SURE TO BACKUP THIS FILE FIRST BEFORE YOU MOD IT!
/ShadersHLSL/Rain.fx
 
 
For the tunnel effect
 
Replace this:
matrix worldViewProj = mul( worldView, cb_mNoNearProj );
Out.vPosition = mul( In.vPosition, worldViewProj );
Out.vPosition.z = LinearizeDepthZ(Out.vPosition);

With this:

matrix worldViewProj = mul( worldView, cb_mNoNearProj );   
float4 scaledRainVPosition = In.vPosition;
scaledRainVPosition.xy *= 6.0; 
Out.vPosition = mul(scaledRainVPosition, worldViewProj);
Out.vPosition.z = LinearizeDepthZ(Out.vPosition);

 

For the raindrop brightness (low numbers are less bright)

 

Replace this:

float4 cColor = float4(1,1,1,In.cDiffuse.w) * (cColor0 + cColor1); 

With this:

float4 cColor = float4(0.5,0.5,0.5,In.cDiffuse.w) * (cColor0 + cColor1);

Note that if you're running 2.0 the first line of the tunnel effect will be slightly different "cb_mProjToDevice".

For brighter rain drops, just increase all three numbers (e.g. 0.5 to 0.7) 

I hope you enjoy the result - I did!

 

Ken

......

I hope you enjoy the result - I did!.......

 

Hi Ken,

thanks for the detailed information how to change and improve the rain effect.

 

I gave it a try and could notice some nice improvements so I'll keep it now.

 

Good job

Spirit

Thanks for this , don't know y LM didn't go this way ???

i7 4777k 4.6mhz, 32gddr3, GTX 760 4g sci ,Saitek x52,yoke and quadrant, 60 Led . SSD

 

This fix does work but just keep in mind that the second edit also affects the color of snow.

Here is a way to improve rain/snow effects.

 

 

You might want to check on this again for P3d 2.1. The code in rain.fx, rain40.fx and rain50.fx does not exactly match that. The lines that you refer to are in both rain40.fx (for DX10) and rain50.fx (for DX11). And even then, the line:

float4 cColor = float4(0.5,0.5,0.5,In.cDiffuse.w) * (cColor0 + cColor1);

is actually:

    return float4(1,1,1,In.cDiffuse.w) * (cColor0 + cColor1);

I know that P3d 2.1 uses DX11 (Shader Model 5), but it may revert to earlier shader versions for specific effects. It's worth experimenting to see what happens when you change either rain50.fx or rain40.fx.

I didn't look at the other files, but my original 2.1 rain.fx in the root shader folder does not have the "return".

Maybe someone can confirm?

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.