Real-time texture switching

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.
Post Reply
pine-nut
Posts: 7
Joined: Sat May 27, 2023 10:07 am

Real-time texture switching

Post by pine-nut »

How to switch the whole texture in real time?
For example, there are two kinds of external texture of an airplane model, one is normal and the other is icing, and it needs to be switched in real time, how can I do it?
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: Real-time texture switching

Post by Clifton Crane »

Hi pine-nut,

There are a couple options. One option would be to use a material script to change the texture:

https://prepar3d.com/SDKv6/sdk/modeling ... lScripting
https://prepar3d.com/SDKv6/sdk/referenc ... ables.html

You could also use visibility scripts to turn a part on or off. For this to work, you would need to model the part twice with different materials and script them on/off separately:

https://prepar3d.com/SDKv6/sdk/modeling ... ity%20Tags

Regards,
Clifton
Clifton Crane
Prepar3D® Software Engineer Sr.
pine-nut
Posts: 7
Joined: Sat May 27, 2023 10:07 am

Re: Real-time texture switching

Post by pine-nut »

Clifton Crane wrote: Fri Jan 26, 2024 12:46 pm Hi pine-nut,

There are a couple options. One option would be to use a material script to change the texture:

https://prepar3d.com/SDKv6/sdk/modeling ... lScripting
https://prepar3d.com/SDKv6/sdk/referenc ... ables.html

You could also use visibility scripts to turn a part on or off. For this to work, you would need to model the part twice with different materials and script them on/off separately:

https://prepar3d.com/SDKv6/sdk/modeling ... ity%20Tags

Regards,
Clifton
Thanks a lot!
Post Reply