## What changes for the player?
Trees and hedges no longer show their leaf pictu…res squeezed into green streaks when one of their crossed planes is seen side-on: that plane fades out and the other one, facing the camera, carries the crown. Tree crowns are also shaded like a volume (darker underneath and on the side away from the sun) instead of one flat green. A new **Detailed trees** switch in Graphics (under Windy trees) turns it on or off; it is on by default and off in the lowest graphics profile, and off the picture is exactly the current one.
## How to test
Grundorf, any bus, free camera (or walk) next to the trees and the hedge around the bus loop at the start. Turn around a tree close up and look up into it: no vertical streaks, no green line along poles in front of a hedge, and no tree ever disappears. Compare with the current release at the same spot. Check the three graphics modes (Vanilla, Vanilla+, Enhanced), then switch Graphics > Detailed trees off: the trees look exactly as in the current release.
## Screenshots
Grundorf, 14:00, CAVOK, same camera for both. Left: 0.3.52, right: this branch.
| Where | 0.3.52 (left) / this branch (right) |
|---|---|
| Under a tree, Vanilla+ | <img width="1000" alt="h" src="https://github.com/user-attachments/assets/361fb785-255a-4c92-98d1-827d48903a80" /> |
| Looking up past a pole into a hedge and a tree, Vanilla+ | <img width="1000" alt="j" src="https://github.com/user-attachments/assets/30d1ea11-b2fe-4fae-8d4a-d333dc032a3a" /> |
| Bus loop from 25 m, Vanilla+ | <img width="1000" alt="g" src="https://github.com/user-attachments/assets/62cb8ca7-dd1a-49c0-a05b-23eb102609da" /> |
| Under a tree, Enhanced | <img width="1000" alt="eh" src="https://github.com/user-attachments/assets/42f07181-8e76-4f8a-8057-4784004241a3" /> |
| Under a tree, Vanilla | <img width="1000" alt="vh" src="https://github.com/user-attachments/assets/126bf1ed-e350-499f-a1a8-4a127ca389fe" /> |
The new switch in the game's Options > Graphics (English, French):
| English | French |
|---|---|
| <img width="500" alt="menu-graphics-en" src="https://github.com/user-attachments/assets/6450a06d-da51-4052-97d5-ae8cef21b89d" /> | <img width="500" alt="menu-graphics-fr" src="https://github.com/user-attachments/assets/30b87f18-10b0-4ce3-b343-0dedee1cb6eb" /> |
## What does this change, and why?
OMSI draws trees as two or more crossed picture planes. Seen at a grazing angle, a plane squeezes its picture into streaks, which is what makes trees look fake up close.
- `tree_card_fade` (fragment, `03_vertex.wgsl`): for foliage (a `[tree]`'s cards, and plant models through `MaterialExtra::sway`), the plane's normal comes from the screen derivatives of the world position, and the leaves' alpha is scaled down as the plane turns edge-on in the horizontal plane (only for upright planes). Two crossed planes always keep one at 45 degrees or better, so a tree never vanishes; seen from straight above or below nothing changes. The same factor is used by the colour passes (Vanilla+, Enhanced), the depth prepass and the multisampled prefill (`fs_depth_test`, `fs_depth_cover`) so their coverage stays the same; shadows keep the full silhouette.
- `tree_crown_normal` (vertex): a `[tree]` card's or a tall plant model's (crown over 2.5 m) normal points up in OMSI, which lights the crown evenly; it is bent towards a sphere around the crown, above the pivot only, so the trunk is unchanged. Hedges and shrubs keep their normals.
- Both are compiled in only with the `DETAILED_TREES` pipeline override, set from `RenderOptions::detailed_trees` (the `detailed_trees` setting) for the scene pipelines that use them: `vs_main`, the ground, the depth prepass and the MSAA prefill. Off, the code is not in the shaders at all (a run-time check left about 0.1 ms on the GPU even when off), and changing the switch rebuilds the pipelines through `rebuild_with` like the other graphics settings. Off renders byte-identical to the current release (checked offscreen).
- The setting: game Graphics menu, web launcher, iOS/macOS settings page, graphics profiles (off in the lowest), with its label and help in all 29 `app.yml` languages; `apple/Tools/gen-strings.py` regenerated the Apple catalog.
- OpenGL (and ANGLE on Direct3D 11) never draws them: the setting is ignored there and `tree_card_fade` / `tree_crown_normal` are stubbed out of the GL module text, next to the SSAO and ray tracing lookups it already leaves out for fxc. Left in as dead code, they made the ANGLE WARP startup test about three times slower (35 s to 110 s a run) and its CI step timed out.
- `DETAILED_TREES` is only passed when on, so with the switch off every pipeline descriptor is the one main builds.
- `shaders.rs`: the assembled shaders' size/hash test updated.
- `tests/more.rs`: the shader validation test (naga to SPIR-V, GLSL and Metal) also builds the scene variants and the temporal motion module with `DETAILED_TREES` on.
## What could break?
A new `RenderOptions` field and pipeline override: every scene pipeline that takes them must get the same value, or the depth prepass and the colour pass would disagree on which leaves exist (holes); `vs_main`, the ground, the prepass, the prefill and the temporal upscalers' motion prepass (`fs_motion_test`) do, the puddle reflection and the coronas keep the default (off). With the switch on, every foliage material goes through the new fade, including content that marks non-tree objects as vegetation by name (the same detection the windy trees already use). Tested on Grundorf only, on macOS (Metal) and Linux (Vulkan, box). Not tested: Windows DX12, VR, Android.
## Performance
Box with a Radeon 680M (Linux, Vulkan), Berlin-Spandau, MAN EN92, driver view, traffic 30, 4x MSAA, 120 s runs with `OMSI_MAX_FPS=1000`, alternated runs. Memory is RssAnon about 65 s into the drive.
| | This branch, Detailed trees on | This branch, off | Current release (0.3.52) | 0.2.30 |
|---|---|---|---|---|
| Average FPS | 154.8 | 156.5 | 155.8 | 152.2 |
| Slowest 1 % of frames (p99, ms) | 12.4 | 12.2 | 12.5 | 12.0 |
| Memory (MB) | 623 | | 625 | 568 |
Same-build check (main built the same way as the branch, alternated): main 158.4 fps, GPU main pass 3.78 ms; off 156.5 fps, 3.73 ms; on 154.8 fps, 3.79 ms. So on costs about 2 % on this small GPU and off is main within noise.
## Checklist
- [x] `cargo test --workspace` and `cargo build --release` pass
- [x] The pull request contains a single change
- [x] Before/after screenshots are in the description if anything changes on screen
- [x] A new feature has its performance table filled in (this branch, the current release, 0.2.30)
- [ ] ~~New or changed interface texts are in `crates/omsi-app/locales/app.yml`, in every language I can~~
- [x] Online play, saves, settings and mods made for the previous release still work, or the description says what changes
- [x] No original OMSI 2 content and no file of a megabyte or more in the commits