VC Windshield Rain Effect - Prepar3D v4.2 SDK

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Locked
User avatar
xtremepro67
Posts: 108
Joined: Thu Oct 18, 2012 5:58 pm
Location: Montreal (Canada)
Contact:

VC Windshield Rain Effect - Prepar3D v4.2 SDK

Post by xtremepro67 »

Hello LMT,

We are having issues implementing the VC windshield rain effect in our interior aircraft model. We are following the procedures described in the Prepar3D v4.2 SDK (New Aircraft Procedures -> The Interior Model -> Virtual Cockpit Specific Materials -> Windshield Effects) very carefully but we cannot make it work properly. This is what we get:

1) When we set the Framebuffer Blend (in the material parameter editor) to Source Blend = One and Destination Blend = Zero, as shown in the example in the SDK, we can see the animated rain effect on the windshield. Great, it works! However, because this is the default setting for an opaque material, the windshield remains opaque and in it we can see the diffuse map (that we use as a "simulated reflection" of what's inside the cockpit in our model) under the rain effect.

2) To simulate glass however, the windshield material must be made transparent and the Framebuffer Blend must be set to Source Blend = ScrAlpha and Destination Blend = InvScrAlpha (the default setting for a transparent material, as shown in the SDK for the glass material). With this setting, the windshield becomes transparent as it should be and the diffuse map, that also contains an alpha channel mask, can be barely seen in the windshield to produce the "simulated reflection" effect we want to create. Unfortunately, with this setting, the windshield rain effect (UV mapped on channel 2 of the geometry) disappears completely.

The bottom line is this: When we make the material transparent, the rain effect disappears. When we make the material opaque, the rain effect is displayed normally but the windshield stays opaque.

Are we missing something?

Why is the material Framebuffer Blend set to "Default Opaque" in your example when glass should be transparent?

How should the maps be organized/set in the material parameter editor for a transparent windshield with a "simulated reflection" from the diffuse map in addition to the animated rain effect (similar to what can be seen in the VC of the stock Mooney Bravo in P3Dv4.2)?

The procedures described in the SDK are incomplete because they don't show the upper part of the material parameter editor so we cannot see how the maps are organized. Would it be possible to show the entire content and all the settings in the material parameter editor for a transparent (glass) windshield material with a diffuse map "reflection" and a rain effect (Mooney_Bravo)?

As always, thank you in advance for your assistance in this matter and for adding this exciting new feature to P3D!

Best regards,

-Alain
Alain Rouleau
Lead Designer and Producer
Xtreme Prototypes, Inc.
Montreal (Canada)
User avatar
Rob McCarthy
Lockheed Martin
Posts: 3703
Joined: Wed Aug 24, 2011 1:37 pm

Re: VC Windshield Rain Effect - Prepar3D v4.2 SDK

Post by Rob McCarthy »

Hi Alain,

The screenshot provided in the learning center is an example and is not the exact same as the implementation in the default Mooney aircraft. There may be some textures or other settings that are slightly different in your implementation than in the Mooney.

Have you tried adjusting the alphaBlendWeight inside of the script? Also are you using the default PrecipWindshieldEffect.lua file?

Regards,
Rob McCarthy
Rob McCarthy
Prepar3D® Core Lead
User avatar
xtremepro67
Posts: 108
Joined: Thu Oct 18, 2012 5:58 pm
Location: Montreal (Canada)
Contact:

Re: VC Windshield Rain Effect - Prepar3D v4.2 SDK

Post by xtremepro67 »

Hello Rob,

Thank you for your answer.

Yes. We are only experimenting at this time and we are using the default (.lua) script as is. We did not modify the script and we are using the same default textures.

So far, we were able to make the default script work and visualize the effect on an opaque windshield but not on a transparent one, as mentioned in my original post. We are following the procedures described in the SDK to create the "glass" material for the windshield with a rain effect.

For now, we are simply trying to reproduce the Mooney windshield rain effect on the windshield of our model. Once we have the default effect set up and working properly, we will customize the effect (material, textures and script) to suit our needs.

Kind regards,

-Alain
Alain Rouleau
Lead Designer and Producer
Xtreme Prototypes, Inc.
Montreal (Canada)
Locked