Tree Distance
Forests that reach the horizon, using the game's own tree impostors.
- Version
- Version 0.1.2
- Works with
- SimplePlanes 2 0.7.9
- Updated
- Category
- Graphics & performance
- Online
- Local onlyExperimental: still has bugs in multiplayer
- Needs
- BepInEx 5. The Gravy Mod Menu is recommended.
What it does
Forests out to the horizon for SimplePlanes 2. The game stops drawing trees at its Tree View Distance (2.5 km by default, 10 km at most), so from the air the islands go bald a few kilometres away. This mod keeps every tree of every loaded island drawing beyond that point, out to 12 km by default (up to 30 km). Far forests thin out gently with distance, and the cost per frame stays close to zero.
(open larger)Features
- The game's own far trees, further away. SP2's trees end their level-of-detail chain with an impostor: a single card that shows a pre-rendered picture of the tree from the angle you're looking from. Beyond the game's tree distance the mod draws exactly that impostor for every tree, so distant forests look like the game's own furthest trees. They're lit the same way: sun colour, ambient light, darker at night, and fog and haze on top.
- No ring, no popping at the hand-off. The distant trees start a little before the game's trees stop. In that overlap both draw the same impostor in the same place, so you can't see where one takes over from the other. If a tree type is hidden earlier because it's too small on screen, the hand-off moves nearer for that type.
- Gentle thinning. At the hand-off every tree is drawn. Towards the far distance, fewer and fewer are drawn, down to 35% by default. Each tree has a fixed rank, so the same trees always stay: nothing flickers as you fly.
- Cheap. The game draws its trees with GPU Instancer, and so does this mod:
- each island's tree positions are sent to the graphics card once, when the island loads;
- the graphics card then picks the visible trees itself every frame, hiding the ones behind hills or outside the view;
- the thinning is done by the graphics card too, so the CPU does almost nothing per frame (a few hundredths of a millisecond);
- the distant trees cast no shadows.
- Every island. Any loaded terrain with trees is covered: the main SP2 island, and islands added by other mods (such as Classic Islands). Islands that load and unload as you fly are picked up and dropped automatically. The trees follow the game's floating origin.
- Follows the game's settings. The hand-off follows the game's Tree View Distance as you change it. Tree Density Low/Medium thins the far forest the same way, and "No Trees" removes it.
- Optional: push the game's own trees further.
Game Tree Distanceoverrides the game's tree distance, including past its 10 km limit. Tree shadows are not affected. - A simple fallback renderer for modded tree types that have no impostor (for example the original SP1 palms and bushes some modded islands bring). It draws their cheapest model, with a cap on how many.

(open larger)Usage
Show usageHide usage
Settings live in the Gravy Mod Menu (Tree Distance tab) if that mod is installed. It shows:
- live status: the hand-off distance, the far distance, how many terrains are covered, how many far trees are on the graphics card, about how many are being drawn right now, CPU time per frame, and memory;
- Rebuild Far Forest: drops everything and sets it up again (use it if trees look wrong after something unusual, such as changing graphics settings mid-flight);
- Write Report To Log: writes a detailed report to
BepInEx/LogOutput.log: every tree type, how it's drawn, the distance window of every density band, and every terrain; - every setting below.
Without it, edit BepInEx/config/rygar.sp2.treedistance.cfg.
Performance tips. A longer Far Distance or a higher Density At Far Distance means more trees on screen; the cost is on the graphics card, not the CPU. Lowering the game's own Tree View Distance (or Game Tree Distance) moves the hand-off nearer. That's often faster overall, because the distant trees are cheaper than the game's.
(open larger)Multiplayer
Show multiplayerHide multiplayer
Experimental online. This mod runs in multiplayer, but it still has bugs there that aren't fixed yet. It works best in single player for now.
Local only. Rendering only: the distant trees have no colliders and nothing is sent to other players. They don't need the mod, and it works the same whether you host or join.
Settings
Show all settingsHide settings
| Section | Setting | Default | Notes |
|---|---|---|---|
| Far Forest | Enabled | true | Draw distant trees |
| Far Forest | FarDistanceKm | 12 | How far trees are drawn (3–30 km). Limited by the camera's far clipping distance |
| Far Forest | FarDensity | 0.35 | Share of the trees still drawn at the far distance (100% = no thinning) |
| Far Forest | Brightness | 1.0 | Brightness of the distant trees (50–150%). Other than 100%, each tree type's impostor picture is copied, about 6 MB each |
| Hand-Off | HandOffKm | 0 | Where the distant trees take over. 0 = automatic (where the game stops drawing its trees). Can only be nearer than that |
| Hand-Off | RealTreeDistanceKm | 0 | Overrides the game's Tree View Distance for its own trees (0–20 km; 0 = game setting) |
| Advanced | SimpleTreeCap | 15000 | Most trees drawn by the simple fallback renderer |
| Advanced | UploadBudgetMb | 4 | Tree data sent to the graphics card per frame while an island loads |
| Advanced | DetailedLog | false | Log every terrain build in detail |
How it works
Show how it worksHide how it works
For each loaded terrain, the mod reads the trees the game is drawing (position, size, rotation, type). On a background thread it turns them into one list per tree type and density band, eight bands in all. Each tree goes into a band by its fixed pseudo-random rank. These lists are uploaded to GPU Instancer as separate groups, a few MB per frame. Each group gets its own distance window:
- they all start at the hand-off;
- the lowest bands reach the far distance (35% of the trees with the default density);
- the higher bands stop earlier and earlier.
Together that thins the forest smoothly with distance, entirely on the graphics card. When the floating origin moves an island, its groups are moved on the graphics card as well; nothing is re-sent.
Known limitations
Show known limitationsHide known limitations
- Graphics card memory: about 70 bytes per tree on loaded terrains (all of them, not only the distant ones). The menu shows the total (the log too, with
DetailedLogon). A big forested island with a million trees uses about 70 MB. - The graphics card does a little extra work for every tree on loaded terrains each frame (choosing which to draw), roughly as much again as the game's own trees.
- Distant trees beyond the camera's far clipping distance can't be drawn; Far Distance is capped there (the menu says so).
- Brightness copies each impostor picture at 1024×1024, a little softer than the original. At 100% the originals are used.
- Tree types without an impostor (some modded islands' own trees) use the simple fallback renderer. It's capped, costs a little CPU when you move, and its hand-off isn't blended: the tree switches from the game's model to its cheapest model.
- Islands that already draw their own distant trees are left alone.
- When an island loads, its far forest appears a second or two later, once it's built and uploaded.
Game Tree Distanceuses a private field of the game. If a game update renames it, only that override stops working (the log says so once); the far forest is unaffected.- Changing the game's Tree Density rebuilds the far forest of every island (a short pause on the worker thread, then a few frames of uploading).
Requirements
Show requirementsHide requirements
- SimplePlanes 2 0.7.9
- BepInEx 5 (5.4.x, x64 Mono build) installed in the game folder. On Linux/Steam Deck with Proton, add
WINEDLLOVERRIDES="winhttp=n,b" %command%to the game's launch options.
The Gravy Mod Menu is recommended: most mods keep their in-game settings and status there. Without it, edit the .cfg files in BepInEx/config/.