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.

X-Plane 10: Clouds & Datarefs - Questions

Featured Replies

  • Author
  • Commercial Member

 

 


improve the final results

 

Murmur, thank you very much for such a thorough explanation! That really gives me a few directions to explore.

 

 

 


Hmm, actually that "circle" of clouds thing is something I associate with X-Plane's default clouds (especially at higher altitudes). Using RWC with the very moderate setting of 10.000km radius, I believe the results are much better. I wonder why that's a deal at all for you, as you say you fly low? When I find the time, I'll try to post some shots comparable to yours using SMP.

 

The reason why it's something I care about is because I fly low. If I flew up high often, then I wouldn't likely care as much, because it would be much easier to discern the draw distance of the default clouds, and therefore any solution (default or SMP) would be near equal.

 

Now, perhaps this is a result of conditioning - I grew up as a farm boy in Southern Alberta in an area that's so wide open and mostly flat and the sky always loomed very large. There's a reason why both Alberta and Montana share a nickname of 'Big Sky Country'. I could fill a wall of text with anecdotes about sitting in the middle of nowhere on horseback, easily 20 miles from the nearest person, watching thunderstorms roll on by in the far, far distance. In the 20 years or so as a photographer, clouds and/or weather also takes center stage in the majority of the landscape imagery that I create.

 

The point is, that to me, clouds are something that I tend to take for granted when right overhead, but are truly wonderful to see in the distance. So this is why, and it doesn't matter on what platform or what add on is in use, that I tend to really dislike the impression that there simply aren't any clouds on the horizon, that they just up and end 30 or so miles away from me. I'm not saying every SMP is always like this - you can set coverage to max, but with a corresponding penalty in performance, and it sure does a good job of providing a solid stratus overcast, especially when combined with a 10 - 20 mile visibility. But in decent weather showing cumulus clouds at 10 - 15,000 sq. km coverage, my experience is that it provides a very clear and immersion-breaking edge to the cloud cover. To be fair, so do the default clouds without any tweaks. Hence why I'm spending time tweaking!

 

In the end, I have no desire to completely replace SMP. It's a fine utility with many uses. There's times when I'm going to want to use it. It's just that in some cases, I want a different depiction of the clouds than what SNP is capable of, and it's great to have other options. Choice is always best! :smile: 

Jim Stewart

Milviz Person.

 

  • Replies 191
  • Views 59.2k
  • Created
  • Last Reply

Is there a place where I can get all the datarefs?

 

EDIT: Found it in the plugins folder.

ASUS Maximus VIII Hero Alpha, Intel Core i7 6700K 4.5GHz, Corsair Vengeance Black LPX 32GB, MSI 5060Ti 16G Ventus 3X, Samsung 850 EVO 500GB SSD

Is there an SDK or something that teaches about the cloud and sky textures for X Plane? I've looked at the sky texture and part of it makes sense and part of it makes no sense to me. The cloud textures are pngs so they wouldn't have alpha channels - not sure how that works. Id like to learn if theres a resource. and datarefs - I don't even know what those are.

 

Murmur - I guess this is most directed to you as you seem to know a lot about these things. All help appreciated.

|   Dave   |    I've been around for most of my life.

There's always a sunset happening somewhere in the world that somebody is enjoying.

Is there an SDK or something that teaches about the cloud and sky textures for X Plane? I've looked at the sky texture and part of it makes sense and part of it makes no sense to me. The cloud textures are pngs so they wouldn't have alpha channels - not sure how that works. Id like to learn if theres a resource. and datarefs - I don't even know what those are.

 

Murmur - I guess this is most directed to you as you seem to know a lot about these things. All help appreciated.

There's no documentation on those internal art assests, so all I know derives from many hours of experimenting. If you search cloud related posts of mine in this forum, you'll find some explanations.

 

Here's some things that I learned experimenting:

 

Each skycolor png determines the color of the skydome, different types of environment lighting, and the color and lighting of clouds.

 

X-Plane uses different skycolors png's depending on conditions:

 

"_mount" when visibility is 80 miles or greater

"_clean" when visiility is 20-40 miles

"_hazy" when visibility is 6-8 miles

"_foggy" when visibility is 2-4 miles

"_socked" when visibility is less than 2 miles.

 

It interpolates between 2 textures when the conditions are midway between one and the other.

 

If atmospheric scattering is on, it mixes the base and the "_hialt" textures in the 3.000-253.000 ft altitude range. At 253.000 ft or above, only "_hialt" texture is used.

 

If atmospheric scattering is off, it mixes the base and the "_hialt" textures in the 3.000-41.000 ft altitude range, and the "_hialt" and "_orbit" textures in the 41.000-282.000 ft altitude range.

 

If there is "broken" cloud cover, the base texture gets mixed with 33% "_ocast" texture.

 

If there is "overcast" cloud cover, it uses 83% "_ocast" texture and 17% "_stratus" texture.

 

If there is "stratus" cloud cover, it uses only "_stratus" texture.

 

If it is snowing and there is "overcast" cloud cover, it uses 69% "_ocast", 14% "_stratus" and 17% "_snowy" textures.

If it is snowing and there is "stratus" cloud cover, it uses 100% "_snowy" texture.

 

In all these cases, when visibility is less than 2 miles, it mixes these textures with the "_socked" texture.

 

 

Regarding the specific skycolor png's textures:

 

The 16 rectangles on the upper left are the skydome textures. They are used to transition from night to dusk to day (and viceversa), with the night texture being used when the sun is 7 or more degress below the horizon, and the central day texture being used when the sun is 7 or more degrees above the horizon. During dusk, it interpolates between one texture and the next.

 

The 8 vertical stripes to the right, determine different types of environment lighting, in this order from left to right:

 

1st determines ambient (non directional) light when atmo scattering is off. However, the stripe of the "hialt" texture is also used to determine ambient light when atmo scattering is on. This stripe is also used to determine the color when the aircraft is inside a cloud, but close to its bottom.

 

2nd determines directional light (sun) when atmo scattering is off. It also determines the color of the sun reflection in the water with atmo scattering both on or off. It is also used to determine the color when the aircraft is inside a cloud, but close to its top.

 

3rd one determines the color of the sun glare, but it used only with HDR on.

4th one determines the color of the moon glare and its reflection in the water.

 

6th one is used in the night lighting of 2D panels (mixed with others in an unknown way).

 

5th, 7th and 8th ones unknown.

 

The two squares at the bottom are used to determine the color of the clouds. The left square is the ambient light, that is light coming from the sky and non directional (uniform). The right square is the diffuse light, that is directional light coming from the sun.

 

You can vary the amount each of the two is used when X-Plane draws clouds using two specific datarefs.

 

The horizontal axis of the square represents sun elevation (from 21 degrees or more above horizon at the extreme left, to 11 degrees or more below horizon at the extreme right), while the vertical axis represents the cloud altitude (from 0 ft at the bottom, to around 38.000 ft or more at the top).

 

So, for example, the pixel at the center of the right bottom square, represents the directional light of a cloud with an altitude of about 19.000 ft ((0+38.000)/2 ), when the sun is 5 degrees above horizon ( (+21-11)/2 ).

 

The cloud textures used to draw cloud puffs, are named "cloud_puff0.png" to "cloud_puff5.png". They have indeed an alpha channel and a white background.

 

Each cloud layer is composed of 6 different horizontal layers, the closest one uses the "cloud_puff0.png" texture, and the farthest one uses the "cloud_puff5.png" texture.

 

You can see that each cloud texture is composed of 16 (4x4) sub-textures. The first column is used for the "cirrus" and "few cumulus" cloud cover. The second one for the "scattered cumulus" cover. The third one for the "broken cumulus" cover. The last one for the "overcast" or "stratus" cloud cover.

 

Some of the datarefs affecting cloud depiction are these (some of them require a weather regeneration to take effect after you've modified them):

 

"cloud/sample_opacity" determines the opacity to direct (diffuse) light of each cloud puff. If it's very small, the cloud puffs will tend to receive the same direct light and have a uniform lighting. If it's higher, different cloud puffs will receive different amount of direct light.

 

"clouds/ambient_gain" determines how much ambient (uniform) light is used (the bottom left square).

 

"clouds/cloud_shadow_lighten_ratio" is the darkness of the shadow the clouds produce on the ground.

 

"clouds/diffuse_gain" determines how much diffuse (directional) light is used (the bottom right square).

 

"clouds/first_res_3d" determines the first layer used when drawing clouds (e.g. if it is set to "2", X-Plane will not draw the first 2 closest layers nor use "cloud_puff0.png" and "cloud_puff1.png" textures. It will draw cloud puffs close to the viewer, but as an extension of the farther layers). Increasing it can improve performance, but increasing it too much can produce cloud puffs at the wrong altitude

 

"clouds/last_res_3d" determines the last layer used when drawing clouds (e.g. if it is set to "4", X-Plane will not draw the farthest layer of clouds, but in this case it will not extend the closer layers. So you will see the clouds extending less in the distance).

 

"clouds/overdraw_control" controls how much cloud puffs are depicted (lower numbers produce more cloud puffs).

 

"clouds/plot_radius" controls the size of each cloud puff.

 

"clouds/spec_gain" controls the intensity of the specular lighting. That is the glare you see on the clouds when they reflect the light coming from the sun. Noticeable in the part of the clouds that are aligned or near to the sun.

 

Finally, each cloud cover ("cirrus", "few cumulus", "scattered cumulus", "broken cumulus" and "overcast") has 2 types of datarefs that control the appearence of each cloud puff for each horizontal layer (from 0, the closest, to 5, the farthest).

 

The first type of datarefs, end with "/alpha_layer_0" (to 5) and determine the transparency of each cloud puff, for each horizontal layer.

 

The second type of datarefs, end with "/squish_layer_0" (to 5) and determine the "stretching" of each cloud puff, for each horizontal layer. A value of 1 will produce a vertical cloud puff (similar to a cumulus), while a value of 0 will produce a horizontal cloud puff (like a cirrus or a stratus).

 

Be advised that the dataref controlling the "few cumulus" cloud coverage is named "lo_cir" instead. The "stratus" cloud cover has less datarefs and hence allows less control over its depiction.

 

 

Well, this is pretty much all I know about sky and clouds in X-Plane. :smile:

"Society has become so fake that the truth actually bothers people".

  • Author
  • Commercial Member

Well, this is pretty much all I know about sky and clouds in X-Plane. :smile:

 

Which is to say, a whole lot.  Awesome rundown of pretty near anything we might want to fiddle with!

 

 

and datarefs - I don't even know what those are.

 

I'm not sure if you're referring to not knowing only about the specific datarefs that affect clouds. If so, the above list is pretty comprehensive.

 

But if you're referring to not knowing about datarefs in general, they are X-Plane settings that can be manipulated programmatically, or 'under the hood', so to speak. Almost everything in X-Plane is done via datarefs - they hold the current state of almost every single thing in the simulator, from what altitude your aircraft is at, to the local time, to the pitch of the sun, to the frequency that your Nav radio is set at.

 

Keep in mind that some (many) of the datarefs that Murmur has listed are known as Art Controls - from what I understand these Art Controls were never meant to be made visible to the general public, and there's been disapproval from the XP devs about them being played with. It's also been made known that they are subject to change without notice between XP versions, and that no plugin should use them and expect to be forever functional.  The most common 'plugin' that does mess with them is RTH - Real Terra Haze; techincally it's not a plugin but a very complex Lua script used by a plugin called FlyWithLua.

 

The easiest way to learn and play with them is through a plugin called DataRefEditor. This allows you to set and play with them, with no consequences - simply restart your sim and any changes you've made to the datarefs via the DataRefEditor are gone. If you want to persistently set datarefs, the easiest method is to write you own Lua script and use it in conjunction with FlyWithLua, some of which have been shared here.

Jim Stewart

Milviz Person.

 

WoW. Overwhelmingly helpful information, Murmur. when I get to the point where I can comprehend all you've said, I may have an actual question. thank you very much for that incredibly helpful post. its even deeper than it appeared.

 

One thing: So the cloud color hue shift that occurs at sunset is actually the small gradient arc in the bottom right of the sky texture? seems like a tricky thing to change unless you just shift the hue of the whole section.

actually - nevermind. you've been more than helpful already. ill figure it out in time.

|   Dave   |    I've been around for most of my life.

There's always a sunset happening somewhere in the world that somebody is enjoying.

One thing: So the cloud color hue shift that occurs at sunset is actually the small gradient arc in the bottom right of the sky texture? seems like a tricky thing to change unless you just shift the hue of the whole section.

 

Exactly. There's also a gradient on the left texture of course, because also the ambient lighting (the lighting due to the sky) changes during dusk. But the change in the direct light due to the sun is more evident and the one responsible for the red hues during sunrise/sunset.

 

A good artist would be needed to improve it. :smile:

"Society has become so fake that the truth actually bothers people".

Can anyone tell me why my clouds disappear after a few minutes of flight and if I reload the script they come back, but will disappear again in an area that should be populated with clouds. I'm using HD Clouds v2 with my custom script. By custom I mean it's edited from someone else.

set( "sim/private/controls/clouds/first_res_3d",2)
set( "sim/private/controls/clouds/plot_radius",2)


set( "sim/private/controls/clouds/lo_cir/squish_layer_0",0.8)
set( "sim/private/controls/clouds/lo_cir/squish_layer_1",0.7)
set( "sim/private/controls/clouds/lo_cir/squish_layer_2",0.6)
set( "sim/private/controls/clouds/lo_cir/squish_layer_3",0.5)
set( "sim/private/controls/clouds/lo_cir/squish_layer_4",0.4)
set( "sim/private/controls/clouds/lo_cir/squish_layer_5",0.4)


set( "sim/weather/cloud_coverage[0]",1.5) 
set( "sim/private/controls/clouds/ambient_gain", 1.50)


set( "sim/private/controls/atmo/atmo_scale_raleigh", 25.0)
set( "sim/private/controls/atmo/inscatter_gain_raleigh", 5.0)
set( "sim/private/controls/skyc/raleigh_scattering_mount", 0.212)


set( "sim/private/controls/clouds/cloud_shadow_lighten_ratio", 0.75)
set( "sim/private/controls/clouds/shad_radius", 0.75)
set( "sim/private/controls/clouds/shadow_size", 2048.00)
set( "sim/private/controls/clouds/shad_alpha_dry", 1.50)
set( "sim/private/controls/clouds/shad_alpha_wet", 1.50)

ASUS Maximus VIII Hero Alpha, Intel Core i7 6700K 4.5GHz, Corsair Vengeance Black LPX 32GB, MSI 5060Ti 16G Ventus 3X, Samsung 850 EVO 500GB SSD

  • Author
  • Commercial Member

Can anyone tell me why my clouds disappear after a few minutes of flight and if I reload the script they come back, but will disappear again in an area that should be populated with clouds. I'm using HD Clouds v2 with my custom script. By custom I mean it's edited from someone else.

 

I would suspect that there's something else running that's perhaps setting R/W weather, such as the NOAA plugin.

 

This:

set( "sim/weather/cloud_coverage[0]",1.5)

is setting the cloud coverage, and would indeed be overwritten by either XP's real world weather, or by the NOAA plugin.

 

I wrote those settings to work as a 'theme', to be able to select via the Lua menu. If you want to adapt it for general use, you need to delete that line.

Jim Stewart

Milviz Person.

 

I would suspect that there's something else running that's perhaps setting R/W weather, such as the NOAA plugin.

 

This:

set( "sim/weather/cloud_coverage[0]",1.5)

is setting the cloud coverage, and would indeed be overwritten by either XP's real world weather, or by the NOAA plugin.

 

I wrote those settings to work as a 'theme', to be able to select via the Lua menu. If you want to adapt it for general use, you need to delete that line.

 

Thanks, I'll try disabling the cloud_coverage and see what happens.

 

You are correct I am using the NOAA plugin, but I also have the option to download the latest weather disabled.

 

So the clouds script comes from you. I have a few of those so I forgot which one is who's. I'm using your script because it's very good.

ASUS Maximus VIII Hero Alpha, Intel Core i7 6700K 4.5GHz, Corsair Vengeance Black LPX 32GB, MSI 5060Ti 16G Ventus 3X, Samsung 850 EVO 500GB SSD

Can we add more cloud variety by introducing new textures named e.g. cloud_puff6, 7 etc. Will the sim automatically load those textures in?

ASUS Maximus VIII Hero Alpha, Intel Core i7 6700K 4.5GHz, Corsair Vengeance Black LPX 32GB, MSI 5060Ti 16G Ventus 3X, Samsung 850 EVO 500GB SSD

Can we add more cloud variety by introducing new textures named e.g. cloud_puff6, 7 etc. Will the sim automatically load those textures in?

 

I don't think so, it's internally limited to 6 horizontal layers.

"Society has become so fake that the truth actually bothers people".

I don't think so, it's internally limited to 6 horizontal layers.

Thx.

ASUS Maximus VIII Hero Alpha, Intel Core i7 6700K 4.5GHz, Corsair Vengeance Black LPX 32GB, MSI 5060Ti 16G Ventus 3X, Samsung 850 EVO 500GB SSD

The screenshots have been made experimenting (some of them some time ago) so I don't remember all the exact tweaks used. However, you can try this:

 

.) rename the "resources/bitmaps/clouds" folder, and replace it with this one (warning: on update, X-Plane will rewrite the original cloud texture files without asking, so you will have to delete the original files again after updating X-Plane):

 

http://www.filedropper.com/clouds_1

 

.) replace this bitmap in "resources/bitmaps/skycolors":

 

http://www.filedropper.com/skycolorsmount

 

.) use this lua script (of course you need FlyWithLua installed):

 

http://www.filedropper.com/clouds_2

cloud link is not working can you re-upload :)

Archived

This topic is now archived and is closed to further replies.

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.