Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Traditional photo scenery often requires downloading and building large areas be
- **Even colours** — optionally soften the patchwork look where neighbouring photos were taken on different days, so a grey, hazy patch stands out less.
- **Seasonal colours** — optionally give summer imagery a more autumnal or winter appearance, based on the simulated date and location.
- **Clean photos up close** — X-Plane's procedural grass and dirt speckles are kept off the aerial photos by default, or faded to the strength you like, without changing your scenery packages.
- **Towns lit at night** — optionally give the photo scenery street lamps and the light of the houses along X-Plane's roads, so towns glow after dark as on X-Plane's own scenery. You can also skip the detailed photos at night to save downloads, keeping the lights.
- **Exposure and a live preview** — tone down photos that look too bright next to X-Plane's own scenery, and see any colour change on a photo from your cache before you fly.
- **See what happened during your flight** — review download performance, scenery loading, and your flight route.

Expand Down
Binary file modified docs/OrthoStreamXP-UserGuide.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ OrthoStreamXP adds real-world aerial photos to your X-Plane 12 scenery while you
1. [Installation](installation.md): what you need and how to install it.
2. [First setup](first-setup.md): the six-step setup that runs the first time you open OrthoStreamXP.
3. [Flying](flying.md): the start order, the Home page, and the report you get after each flight.
4. [Settings](settings.md): quality and ground detail, folders, downloads, colours, seasons and exposure.
4. [Settings](settings.md): quality and ground detail, folders, downloads, colours, seasons and exposure, night lights and photos at night.
5. [Cache](cache.md): how much disk space the scenery uses and how to free it.
6. [Packages](packages.md): downloading the ground mesh of a whole region, the quickest way to get scenery packages.
7. [Troubleshooting](troubleshooting.md): common problems, the log, updates, uninstalling and reporting a bug.
Expand Down
Binary file modified docs/images/settings-colours.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/settings-download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/settings-folders.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/settings-night.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/settings-other.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/settings-quality.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/settings-tuning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 38 additions & 1 deletion docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[User guide](README.md) › Settings

The Settings page has six tabs. Changes are saved straight away, and a short **Saved** note confirms each one.
The Settings page has seven tabs. Changes are saved straight away, and a short **Saved** note confirms each one.

Settings can be changed only while OrthoStreamXP is stopped. While the scenery is streaming, the page shows the settings in use but you cannot edit them: a banner says *Streaming is running. Stop it to change settings.* Click **Stop streaming** in the banner to stop it. Changes apply from the next start.

Expand Down Expand Up @@ -96,6 +96,43 @@ Most aerial photos are taken in summer.

All the colour options only change how the photos look. The cache keeps the photos as downloaded, so changing them never downloads anything again.

## Night

![Settings: Night](images/settings-night.png)

How the photo scenery looks after dark. Both switches are **Off** by default and work independently: you can have the lights without skipping the photos, skip the photos without the lights, or both.

### Night lights

X-Plane's own scenery glows at night where there are towns. Photo scenery replaces that ground, so without night lights a town on the photos is dark except for X-Plane's 3D roads, cars and buildings.

Turn on **Light the towns at night** to give every photo tile its own lights:

- street lamps along X-Plane's roads: a lamp every 28–45 m depending on the road, mostly warm sodium orange with some white LEDs, a few of them out;
- a soft glow around the lamps, which stand beside the road so that X-Plane's 3D roads (or an overlay's, like simHeaven's) do not cover their light;
- a faint, even light from the houses along town streets.

How many lamps are lit and how bright the houses are depends on how built up the place is: a town centre is fully lit, a village keeps all its lamps, and in the open country only a few lamps along the roads shine. Between the lights the photo stays dark; X-Plane fades the lights in at dusk by itself.

The roads come from the overlay package installed with your regions (**OrthoStream_Overlays**), or from another overlay package in X-Plane's Custom Scenery. Where no overlay package covers an area, its photo tiles stay dark at night.

X-Plane loads the lights with the scenery, by day too, so they are there when night falls during a flight. The lights get the same detail as the photos under them at every distance, up to about 3 m per pixel beside the aircraft. Each tile's lights are made the first time X-Plane loads that tile, and again with more detail as you come closer; only the detail X-Plane reads is kept in the cache with the area's photos, compressed (about 50 KB per tile; a 20-minute flight around Zurich kept 160 MB), so the first flight over a new area uses a little more processor time and later flights none. Your scenery packages are not changed. **Off** is the default; a change applies from the next start.

### Photos at night

At night the ground is dark and you see little of the photos, so downloading them in full detail mostly costs bandwidth and processor time. Turn on **Skip the photos at night** to save that on night flights:

- **While it is dark in X-Plane** (the sun more than 9° below the horizon), OrthoStreamXP downloads no detailed photos. The ground you fly over is a blurry version of the photos, made from the small overview pictures it already keeps for far-away scenery.
- **The night lights still work.** With **Light the towns at night** on, the street lamps and houses shine on the blurry ground as usual, as sharp as ever.
- **Places you have flown over before stay sharp**: photos already in the cache are shown as they are.
- **Around sunset and sunrise** the photos download as usual, while there is still light to see them by: from sunset until well after the sky starts to darken, and again from early dawn.

OrthoStreamXP reads the time of day from X-Plane. When a flight starts, X-Plane first loads the area around the aircraft, and only then, once the flight is running, says what time it is. So the area where a flight starts still gets its photos, even at night, and the saving starts from there: everything X-Plane loads as you fly on.

If you fly on into the day, ground that loaded during the night stays blurry after sunrise until X-Plane loads it again, which happens as you fly on into new areas. Leave this off for flights that end in daylight. Like every setting, a change applies from the next start.

How dark it must be is set in the settings file (**Show the file**), not on the page: `skip-photos-sun-below = 9` is the sun's height below the horizon in degrees, from 0 to 18. A higher number keeps the photos longer at dusk and brings them back sooner at dawn; a lower one skips more of the twilight.

## Tuning

![Settings: Tuning](images/settings-tuning.png)
Expand Down
13 changes: 13 additions & 0 deletions release-notes/v1.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## What's new

- **Towns lit at night.** X-Plane's own scenery glows after dark where there are towns, but until now the photo scenery stayed dark there, apart from X-Plane's 3D roads and buildings. Turn on **Light the towns at night** in the new **Settings › Night** tab, and the photo scenery gets street lamps, their glow and the light of the houses along X-Plane's roads, beside the roads so that 3D roads (X-Plane's or simHeaven's) do not cover it. Town centres are fully lit, villages less, and the open country has only a few lamps along the roads. X-Plane fades the lights in at dusk by itself.
- **Skip the photos at night.** At night the ground is too dark to see much of the photos, so downloading them in full detail mostly costs bandwidth. Turn on **Skip the photos at night**, also in **Settings › Night**, and OrthoStreamXP downloads no detailed photos while it is dark in X-Plane. The ground shows a lower zoom level version of the photos instead, and the night lights shine on it as usual. Places you have flown over before stay sharp, and around sunset and sunrise the photos download as usual.
- **Out of X-Plane's way.** When you start X-Plane with **Fly** on the **Home** page, OrthoStreamXP waits until X-Plane's window is in front, then moves to the notification area next to the clock. Click its icon to open the window again, or right-click it for **Open OrthoStreamXP** and **Exit**. When X-Plane quits, the window comes back on the **Home** page, ready to stop the scenery and show your flight report.

## Good to know

- Both night switches are **Off** after updating. Like every setting, they can be changed only while OrthoStreamXP is stopped, and the change applies from the next start.
- The night lights follow the roads in your overlay packages: the **OrthoStream_Overlays** package installed with your regions, or another overlay package in Custom Scenery. Where no overlay package covers an area, its photo scenery stays dark at night.
- The lights for an area are made the first time X-Plane loads it, so the first flight over a new area uses a little more processor time. They are then kept in the cache with that area's photos, at about 50 KB per tile. Your scenery packages are not changed.
- With **Skip the photos at night** on, the area where a flight starts still gets its photos, even at night. Ground loaded during the night stays with lower zoom level before sunrise.
- OrthoStreamXP moves to the notification area only when **Fly** started X-Plane. If you start X-Plane yourself, the window stays where it is. **Exit** in the icon's menu still asks first while the scenery is streaming.
15 changes: 15 additions & 0 deletions src/OrthoStreamXP/Configuration/MountSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ internal sealed record MountSettings
public bool LazyTerrainListing { get; init; }
/// <summary>How strong X-Plane's detail decals are on the photo terrain, 0 (left out) to 100 percent (as the packages define).</summary>
public int GroundDetail { get; init; }
/// <summary>The photo tiles get night textures: street lamps and lit windows along X-Plane's roads.</summary>
public bool NightLights { get; init; }
/// <summary>At night in X-Plane only the low-zoom base is downloaded: no detailed photos under the night lights.</summary>
public bool SkipPhotosAtNight { get; init; }
/// <summary>How far below the horizon, in degrees, the sun must be before the photos are skipped (0-18).</summary>
public double SkipPhotosSunBelow { get; init; } = -Scenery.Daylight.DefaultDarkBelow;
/// <summary>A texture-quality value from an older settings file: no longer used, noted in the log.</summary>
public string? IgnoredTextureQuality { get; init; }
/// <summary>Photo textures are served level by level as X-Plane reads them (off: built whole first).</summary>
Expand Down Expand Up @@ -141,6 +147,12 @@ public static MountSettings FromValues(SettingValues values, bool console = true
bool readLog = ParseOnOff(readLogValue) ?? throw new SettingsException($"read-log must be on or off, not '{readLogValue}'");
int groundDetail = values.Int("ground-detail", 0);
if (groundDetail is < 0 or > Scenery.TerrainDecals.Full) throw new SettingsException("ground-detail must be between 0 and 100");
string nightValue = values.String("night-lights") ?? "off";
bool nightLights = ParseOnOff(nightValue) ?? throw new SettingsException($"night-lights must be on or off, not '{nightValue}'");
string skipValue = values.String("skip-photos-at-night") ?? "off";
bool skipPhotosAtNight = ParseOnOff(skipValue) ?? throw new SettingsException($"skip-photos-at-night must be on or off, not '{skipValue}'");
double skipSunBelow = values.Double("skip-photos-sun-below", -Scenery.Daylight.DefaultDarkBelow);
if (skipSunBelow is < 0 or > 18) throw new SettingsException("skip-photos-sun-below must be between 0 and 18 degrees");

if (downloadWorkers < 1) throw new SettingsException("download-workers must be at least 1");
if (downloadTimeout is < 1 or > 120) throw new SettingsException("download-timeout must be between 1 and 120 seconds");
Expand Down Expand Up @@ -193,6 +205,9 @@ public static MountSettings FromValues(SettingValues values, bool console = true
TextureStore = textureStore,
LazyTerrainListing = values.Flag("lazy-terrain-listing"),
GroundDetail = groundDetail,
NightLights = nightLights,
SkipPhotosAtNight = skipPhotosAtNight,
SkipPhotosSunBelow = skipSunBelow,
IgnoredTextureQuality = values.String("texture-quality"),
MipStreaming = mipStreaming,
NearWait = nearWait,
Expand Down
3 changes: 3 additions & 0 deletions src/OrthoStreamXP/Configuration/SettingsOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ internal static class SettingsOptions
.Add("texture-quality", "No longer used: the texture size follows level-change (accepted so older settings files still load)")
.Add("background-textures", "Build missing DDS files in a bounded background queue when a local DDS fallback exists", arity: 0)
.Add("ground-detail", "How strong X-Plane's detail decals are over the photo scenery, 0-100 percent. The terrain definitions name a decal library (DECAL_LIB) that sprinkles procedural grass, shrubs and dirt over the ground up close; it adds texture to X-Plane's own blurry land-class textures, but over sharp aerial photos it looks like noise. 0 leaves the decals out, 100 keeps them as the packages define, and anything between fades them (read from the X-Plane folder, so it needs xplane). Applied to the photo tiles' terrain definitions as X-Plane reads them; the packages' files are not changed. Takes effect at the next start (default: 0)")
.Add("night-lights", "on or off: light the towns on the photo scenery at night. X-Plane's own scenery glows where it is a town; photo tiles are dark but for X-Plane's roads and buildings. With this on, each photo tile gets a night texture of street lamps, their glow and lit windows along X-Plane's roads (read from the overlay packages), which X-Plane fades in at dusk. Each is painted the first time X-Plane loads it and kept in the cache. The packages' files are not changed. Takes effect at the next start (default: off)")
.Add("skip-photos-at-night", "on or off: at night in X-Plane (the sun lower than skip-photos-sun-below) download no detailed photos: the ground under the night lights is drawn from the low-zoom base, blurry, and what is already in the cache is shown as it is. In twilight, and before X-Plane sends where the sun is, the photos stream as usual. Saves downloads and processor time on night flights; needs mip-streaming. Takes effect at the next start (default: off)")
.Add("skip-photos-sun-below", "Degrees, 0-18: how far below the horizon the sun in X-Plane must be before skip-photos-at-night skips the photos. 6 is the end of civil twilight, when the sky turns dark; 12 the end of nautical twilight, when the horizon fades; 18 full night. Lower skips more of the twilight; higher keeps the photos while the sky still lights the ground, and brings them back sooner at dawn. Takes effect at the next start (default: 9)")
.Add("lazy-terrain-listing", "Show an empty terrain directory listing; DSF-referenced .ter files remain directly accessible", arity: 0)
.Add("prefetch-loaded-scenery", "on or off: build the textures of each DSF X-Plane loads as soon as it opens the DSF's terrain definitions, before X-Plane asks for them one by one (default: on)")
.Add("track-aircraft", "Follow the aircraft through X-Plane's UDP DATA output (row 20) and build the loaded scenery's textures ahead of it", arity: 0)
Expand Down
18 changes: 18 additions & 0 deletions src/OrthoStreamXP/Gui/Home/XPlaneWatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace OrthoStreamXP.Gui;

/// <summary>
/// Tells from the process list's answers, one check at a time, when X-Plane quits. Only what a check saw counts: an
/// X-Plane just started may not be in the process list at the next check yet, and that is not a quit.
/// </summary>
internal sealed class XPlaneWatch
{
private bool _seenRunning;

/// <summary>Notes whether X-Plane runs now; true when it ran at the last check and no longer does.</summary>
public bool QuitSince(bool runningNow)
{
bool quit = _seenRunning && !runningNow;
_seenRunning = runningNow;
return quit;
}
}
22 changes: 22 additions & 0 deletions src/OrthoStreamXP/Gui/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.ComponentModel;
using System.Windows;
using OrthoStreamXP.Setup;

namespace OrthoStreamXP.Gui;

Expand All @@ -18,6 +19,27 @@ public MainWindow(MainViewModel main)
{
if (new UpdateDialog(offer) { Owner = this }.ShowDialog() == true) _main.Home.InstallConfirmedUpdate();
};
var tray = new TrayIcon(this);
_main.Home.XPlaneStarted += async (_, _) => await HandOverToXPlaneAsync(tray).ConfigureAwait(true);
// The flight is over: back on the Home page, with Stop and (once stopped) the flight's report.
_main.Home.XPlaneQuit += (_, _) =>
{
if (IsVisible) return;
_main.Show(_main.Home);
tray.ShowWindow();
};
}

/// <summary>
/// X-Plane was started: once its window has the front (given by this window, which has it), this window goes to the
/// notification area, out of its way. Not before: hidden while it still has the front, the front would go to the
/// window behind it instead of X-Plane's.
/// </summary>
private async Task HandOverToXPlaneAsync(TrayIcon tray)
{
await XPlaneWindow.HandOverAsync(settle: TimeSpan.FromSeconds(1), timeout: TimeSpan.FromMinutes(3)).ConfigureAwait(true);
// X-Plane quit meanwhile: the window stays, as it would come back for the quit anyway.
if (IsVisible && SystemCheck.IsXPlaneRunning()) tray.HideWindow();
}

/// <summary>Closing while the scenery is mounted asks first, then unmounts before the window goes.</summary>
Expand Down
3 changes: 3 additions & 0 deletions src/OrthoStreamXP/Gui/Settings/SettingNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ internal static class SettingNames
["season"] = "Seasons",
["season-strength"] = "Seasons",
["exposure"] = "Exposure",
["night-lights"] = "Night lights",
["skip-photos-at-night"] = "Photos at night",
["skip-photos-sun-below"] = "Photos at night",
["scenery-packs"] = "Keep the photo scenery below airports",
["xplane-address"] = "X-Plane address",
["xplane-arguments"] = "X-Plane start options",
Expand Down
Loading
Loading