Expand description
CesBuilder — the terrain-builder resource.
A planet has ONE builder (its terrain source); when it is unset the planet
renders a plain white sphere. The base CesBuilder is the SINGLE builder
class: whether it is a built-in noise example or YOUR custom terrain is
decided by two fields — device (GPU/CPU) and a hidden builtin_shader
selector (None = custom, Terrain = the built-in noise). The four paths
(BuilderRoute) are:
builtin_shader == Terrain,device == GPU— built-in GPU noise (the rich inline shader, driven by the noise knobs). The auto-added default, shipped as theCesGPUNoiseExampleGDScript (carries the knobs as its own@exports).builtin_shader == Terrain,device == CPU— the same noise baked on CPU worker threads (crate::noise_provider::NoiseProvider); shipped asCesCPUNoiseExample.builtin_shader == None,device == GPU— YOUR terrain: pointshader_fileat a.glsldefiningterrain_height/terrain_color(compiled at runtime). May add@export var name: floatknobs (surfaced to the GLSL as#define NAME).builtin_shader == None,device == CPU— YOUR terrain in GDScript:extends CesBuilder, defineheight/color/normal, and set the device toCPU. If it instead defines_bake_requested, the bake is ASYNCHRONOUS (CEL-86) — seeBuilderRoute::CpuCustomAsync.
The planet routes on (device, builtin_shader) plus, for the CPU-custom
pair, whether the script defines _bake_requested — see route_of.
The noise knobs live on the example GDScripts (not this base); a custom
builder simply doesn’t declare them.
Structs§
- Builder
Params - Plain, testable noise params (the Example builders’ knobs). Defaults MUST
reproduce
HeightGpu::default/TextureGpu::defaultso a default builder renders like the historical HQ terrain. - CesBuilder
- The terrain source: a
Resourceyou assign toCelestial::builder. It answers “what does this planet’s surface look like?” — height, colour, and (since it also owns thewater_*group) the ocean.
Enums§
- Builder
Device - Which device runs a builder — an exported dropdown on
CesBuilder. Combined withBuiltinShaderit selects theBuilderRoute. - Builder
Route - The terrain paths the planet routes between. Derived from a builder’s
CesBuilder::deviceandCesBuilder::builtin_shader, plus — for the CPU-custom pair — whether the GDScript definesBAKE_REQUESTED. NOT an exported field. - Builtin
Shader - Which BUILT-IN library shader a builder runs — a hidden (STORAGE-only)
selector on
CesBuilder.None= a custom builder (user.glslor GDScript);Terrain= the built-in noise example. Combined withBuilderDeviceit selects theBuilderRoute.
Constants§
- BAKE_
REQUESTED - The GDScript method whose presence selects the async CPU bake route.
- BASE_
READY - Optional GDScript method gating whether the baked surface is shown yet.
Functions§
- builder_
height_ gpu - Map the params onto the geometry (height) GPU struct (
enabledalways on — the planet’s builder SELECTION gates displacement, not this flag). - builder_
texture_ gpu - Map the params onto the surface (texture) GPU struct.
- route_
of - Resolve a builder’s routing path.