DOCS // geofx

geofx in Godot 4 Available

geofx wire writes a shader include, a script and lossless import files for Godot 4. These are outputs from our compiled hills example.

Contents5 sections
  1. Generated Godot files
  2. Read the maps
  3. Wire settings
  4. Hills wire report
  5. Questions

geofx runs on the hosted API: try it in the Playground.

Generated Godot files

The hills compile folder sits inside the Godot project. The compiler reads that folder and writes only the features requested. With --scene it also writes a demo scene.

spatial-compiler wire hills --scene ground_demo.tscn
  • godot/hills_ground.gdshaderinc
  • godot/hills_ground.gd
  • godot/hills_ground_demo.gdshader
  • ../hills_demo.tscn
  • godot/hills_height.png.import
  • godot/hills_masks0.png.import
  • godot/hills_masks1.png.import
  • godot/hills_material_id.png.import
  • godot/hills_material_w0.png.import
  • godot/hills_material_w1.png.import
  • godot/hills_normal.png.import

Read the maps

hills_ground.gdshaderinc defines geo_height, geo_normal, geo_weights / geo_material, geo_masks and geo_wetness with geo_rain, for the features requested.

hills_ground.gd loads the 16-bit height and provides apply_to, height_sample, height_at, material_at, wetness_at and set_rain. Lossless import files preserve the maps.

Wire settings

Setting (--set)ValuesDefault
targeta target idgodot
featureslist of height, normal, materials, masks, wetness, stampsevery one the bake has
heightvertex, fragment, nonevertex
nameletters, digits, _the bake's name
max_samplesinteger, 0 for none0
max_texture_mbnumber, 0 for none0

Hills wire report

The whole wire report of hills (0 warnings, 0 errors)

Download the full JSON report, including every metric, warning and error. Local paths are reduced to file names.

Questions

Which files does the geofx Godot wire command generate?

The wire command writes a shader include, a GDScript helper, a demo shader, lossless PNG import files and an optional demo scene.

What helper functions does hills_ground.gd provide in Godot?

The script loads the 16 bit heightmap and exposes apply_to, height_sample, height_at, material_at, wetness_at and set_rain functions.

How do you limit which geofx features are wired into Godot?

Pass a features list to wire settings choosing from height, normal, materials, masks, wetness and stamps instead of all baked outputs.