Godot
Not validated
The Godot add-on under engine/godot/ was written from the Godot 4 documentation. It has never been run in Godot: none of its files has been compiled or opened there yet (roadmap godot-shaders, in validation). The checklist of what to look at first is the "Not validated" section of engine/godot/README.md.
Which format
Use GLB. Godot 4 imports glTF natively: every LOD as a child mesh, PBR materials, cut-out leaves (MASK) and two-sided leaf materials. glTF and Godot are both +Y up, metres and right-handed, so positions and wind pivots need no conversion. FBX through Godot's importer is not recommended.
The AskrGarden add-on
engine/godot/addons/askrgarden/ holds, for Godot 4.3 or newer:
| File | Does |
|---|---|
askr_vegetation.gdshader | leaves: alpha scissor, two-sided, backlight translucency, wind |
askr_vegetation_a2c.gdshader | the same with alpha-to-coverage (needs MSAA) |
askr_bark.gdshader | bark: opaque, same wind |
askr_impostor.gdshader | the octahedral impostor as the last LOD |
askr_wind.gd | the AskrWind node: sets the global wind values |
plugin.cfg, plugin.gd | the editor plugin: creates the wind Shader Globals, keeps the impostor images lossless |
askr_import.gd | the import script: materials, LOD visibility ranges and the impostor card, from <name>_export.json |
askr_fix_scene.gd | the same as an EditorScript, for a scene that is already imported |
Install
Export the tree as GLB with its impostor:
shaskrgarden-cli export oak.treegen.json -f glb -o out/oak --impostorKeep
oak_export.jsonand theoak_Impostor_*.pngfiles next tooak.glb.Install the add-on into your Godot project (the folder with
project.godot): in the editor, File > Install engine support… and choose Godot, oraskrgarden-cli engine-package godot D:/Projects/MyGame. It lands inres://addons/askrgarden/. Copyingengine/godot/addons/askrgarden/there by hand does the same.Project Settings > Plugins: enable AskrGarden. It adds the wind Shader Globals (names and defaults) to the project settings.
Copy the GLB, the sidecar and the impostor PNGs into the project. In the Import dock select
oak.glb, set Import Script > Path tores://addons/askrgarden/askr_import.gdand click Reimport. The Output panel saysAskrGarden: processed N mesh nodes of oak.Add an AskrWind node to the level. Set its
fade_endto the distance where the impostor takes over.
What the import script sets
- Each surface gets a
ShaderMaterial:bark,leaves(cutoff and translucency from the sidecar) or the impostor material (atlases, strips image, grid, frame size, centre, radius). _LOD<n>nodes get visibility ranges computed from the suggested screen sizes in the sidecar (75° vertical field of view assumed). Godot has no dithered LOD cross-fade: levels switch with a margin, so the wind fades to zero before the switch.- Shadow proxies become shadow-only meshes.
- The impostor images are re-imported lossless and without mipmaps: they are data, not pictures.
Things to know
- Normals. AskrGarden writes OpenGL normal maps (+Y), which is Godot's convention: nothing to flip.
- Uniform scale. The wind is computed in world space and brought back to the object, so scale each tree uniformly. MultiMesh instancing works.
- Vertex colours are wind data, never colour. The add-on's materials read them as data; a standard material that uses vertex colour as albedo would tint the tree.
- Time rollover. Godot's
TIMEwraps every 3600 s by default, so the wind phase jumps once an hour. Raise the rollover in Project Settings > Rendering > Limits > Time for long sessions. - Grass and small plants. Vegetation cards are a light alternative to a full mesh in a
MultiMeshInstance3D.
Known gaps
No dithered cross-fade, no interaction with characters, no hashed alpha, no depth write for the impostor, and the Compatibility renderer is not checked.