A Space Engineers plugin that stops the game from crashing during foliage rendering on RTX 50-series GPUs. Vanilla SE grows grass with a geometry shader, and on those cards that step trips a graphics-driver fault that takes the whole game down — the crash tracked in this Keen bug report. Foliage Rewrite replaces it with a different rendering path that skips the geometry shader entirely, so the crash never happens. The grass still looks just like vanilla — a little better, if anything — and renders faster, but not crashing is the point.
- Install Pulsar (link to installer in its README).
- Enable Foliage Rewrite in the Plugins dialog.
- Apply, restart the game.
- Ctrl+F8 — toggle the rewrite on/off. Hot-togglable; the patches stay installed but every frame falls through to SE's original foliage path when off, no restart needed. Use it for A/B comparisons mid-session, or to recover from a runtime issue without quitting. Mirrored by the Enable rewrite checkbox in the settings dialog — both sources persist to the same setting.
For a full revert without the plugin in the loop at all, disable Foliage Rewrite in Pulsar's plugin list and restart SE.
Open Pulsar's plugin list and click the settings cog next to Foliage Rewrite to bring up a dialog with:
- Enable rewrite — checkbox, mirror of the Ctrl+F8 hotkey.
- Grass draw distance (50–5000 m, exponential) — mirrors SE's
graphics-options slider but applies live as you drag, without the
Apply click. Writes through to the same underlying
MyRenderSettings.User.GrassDrawDistanceSE itself uses, so SE's per-frame foliage-manager update picks it up next frame. - Grass density (0–10×, linear) — same pattern, mirrors and
writes
GrassDensityFactorlive. - Distance density (0–1, default 0.75) — how dense foliage stays at distance. 1 = full density out to the draw distance, 0 = maximum distance thinning.
Grass distance + density are saved into SE's own graphics config
when the dialog closes — the same place SE's Apply button
writes — so they survive restarts and stay in sync with SE's
options screen. The rewrite-enable flag and the distance-density
value persist to %APPDATA%\SpaceEngineers\FoliageRewrite.cfg.
Foliage Rewrite is a client-side rendering plugin only — it changes how grass is drawn on your machine and doesn't touch world, network, or sim state. It works on any multiplayer server without the server having it installed, and can't cause desync.
It reads SE's live grass-draw-distance and density every frame, so it stays in sync with the in-game graphics options, and it's built to render correctly alongside Smooth Frames — blades stay anchored to the smoothed view instead of stuttering between sim ticks.
Vanilla SE grows grass with a geometry shader that reads the terrain mesh and streams out a vertex per blade; that pass is the one that faults on RTX 50-series cards. The rewrite keeps SE's outer render pass — viewport, matrices, GBuffer binding, command-list flushing — and swaps only the generation and draw for a compute + indirect-draw pipeline:
- A compute shader reads each cell's terrain triangles and writes one instance per blade — position, surface normal, material, seed — into a per-cell buffer. No geometry shader, no stream-out.
- Each visible cell draws its blades with a single
DrawInstancedIndirect. The compute only re-runs when a cell changes — first sighting, terrain edit, biome change — so steady-state frames are just the draws. That's the speed-up over vanilla, which regenerates every cell every frame. - The vertex shader expands each instance into a surface-rooted quad, with per-instance angle and size variation, wind sway, a top-down pitch so blades stay visible from overhead, and the same distance-based scale-and-thin that fades grass out with range.
- The pixel shader samples the material's color and normal textures and writes the same GBuffer slots SE's own foliage does, so deferred shading downstream is identical. LOD transitions dissolve between shells with a screen-space stipple instead of popping.
The result is at least full vanilla parity for grass, and lighter on the GPU besides. Frustum culling and distance LOD are handled upstream or by design; foliage shadows and pebble foliage on moons are intentionally out of scope, since vanilla renders neither in a way worth matching.
See CLAUDE.md for the implementation notes — reflection traps, coordinate-system gotchas, and the decisions behind the rewrite.