Resources and runtime
Types live in Glome unless noted as Glome.Editor or Glome.Core. Custom host example
S3Environment and S3ShadingMode
Section titled “S3Environment and S3ShadingMode”| Property | Type | Default | Meaning |
|---|---|---|---|
BackgroundColor |
Color |
new(0.28f, 0.32f, 0.38f) |
Color on primary ray miss |
AmbientColor |
Color |
Colors.White |
Ambient diffuse tint |
AmbientEnergy |
float |
0.2f |
Ambient diffuse multiplier |
FogColor |
Color |
new(0.28f, 0.32f, 0.38f) |
Target fog color |
FogDensity |
float |
0 |
Exponential fog density (); 0 disables fog |
ShadingMode |
S3ShadingMode |
StandardLit |
StandardLit (0), Unlit (1), or ClayClean (2) |
EquatorialGroundEnabled |
bool |
true |
Enables analytical ground at when also enabled on S3Space3D |
GroundMaterial |
StandardMaterial3D? |
null |
Ground material; null renders the procedural grid |
EnvironmentBlock Capture(int groundMaterial) linearizes colors, packs mode and ground index, and stores ground UV transform (0.25 × Uv1Scale.XY, Uv1Offset.XY).
S3RenderProgram, ProgramBuffer, and GlomeStandardProgram
Section titled “S3RenderProgram, ProgramBuffer, and GlomeStandardProgram”| Property | Type | Default | Meaning |
|---|---|---|---|
Shader |
RDShaderFile? |
null |
Compute .glsl shader file (such as cel.glsl) |
SpecializationValues |
int[] |
[] |
One pipeline per integer for constant ID 0; empty uses shader default |
CaptureSet1 |
Func<ProgramBuffer[]>? |
null |
Callback invoked on construction and Rebuild; array index is Set 1 binding |
ProgramBuffer(RenderingDevice.UniformType Type, byte[] Data):UniformBufferorStorageBufferbytes (keep array immutable while upload is queued).GlomeStandardProgram():S3RenderProgrampreloaded withres://addons/glome/Shaders/glome_standard.glsl.
S3BakeSnapshot and GlomeBakeOptions
Section titled “S3BakeSnapshot and GlomeBakeOptions”S3BakeSnapshot(long Revision, BakedGeometry Geometry, S3CollisionWorld Collision, Node3D[]? TriangleOwners, GlomeMaterials? Materials, GlomeLight[] Lights, EnvironmentBlock Environment)
GlomeBakeOptions(double? RadiusOverride = null, BakeVisibility Visibility = BakeVisibility.HonoredUpToRoot, Func<Material?, SurfaceTag>? ResolveMaterial = null, Action<S3Anchor3D, S3Frame, Transform3D>? OnAnchor = null, Action<int, CollisionShape3D, S3Frame, Transform3D>? OnProxy = null, bool IncludeOwners = false, Predicate<D4>? GroundMask = null)Visibility:HonoredUpToRoot(0) checks node and ancestor visibility up to the space;SelfVisible(1) checks only the node. Enabled colliders always bake regardless of visibility.ResolveMaterial: override nativeStandardMaterial3Dpacking with customSurfaceTag(Material, Surface, Traversal)values (Materialsbecomesnull).IncludeOwners: maps reordered BVH triangles back to their owningS3Anchor3D(or mesh) for editor picking.GroundMask: pure predicate on unit crossing pointxfor CPU ground tracing (truekeeps ground; complementary to GPUGLOME_GROUND_HOLE).
GlomeBaker
Section titled “GlomeBaker”public static S3BakeSnapshot Bake(S3Space3D space, GlomeBakeOptions? options = null)public static Task<S3BakeSnapshot> BakeAsync(S3Space3D space, GlomeBakeOptions? options = null, CancellationToken cancellationToken = default)Call from the Godot main thread. BakeAsync extracts Godot nodes and callbacks on the main thread, builds triangles/BVH/collision on a worker thread, and cancels publication (OperationCanceledException) if superseded by a newer bake or RequestRebake().
GlomeMaterials, GlomeBuffers, and GlomeLight
Section titled “GlomeMaterials, GlomeBuffers, and GlomeLight”GlomeMaterials(MaterialRecord[] Records, TextureBank[] Banks): native material table (index0isMaterialRecord.White) and up to 4 sRGBTextureBankarrays.GlomeBuffers.Pack(S3BakeSnapshot)/Pack(BakedGeometry, MaterialRecord[], byte[], EnvironmentBlock, TextureBank[]): packs buffers to Set 0 ABI 1. Pass the actualGeometry.Nodes.LengthtoDraw.GlomeLight.Directional(pole, radiance, shadows)/Omni(position, radiance, metres, radius, shadows)/Pack(lights): groups lights inLightGrouporder (Directional,ShadowedDirectional,Omni,ShadowedOmni) with a 16-byte count header.
GlomeComputeRenderer
Section titled “GlomeComputeRenderer”GlomeComputeRenderer(S3BakeSnapshot snapshot, Vector2I size, S3RenderProgram? program = null, byte[]? probes = null, bool capture = false, string timingPrefix = "")GlomeComputeRenderer(GlomeBuffers buffers, Vector2I size, S3RenderProgram? program = null, byte[]? probes = null, bool capture = false, string timingPrefix = "")| Member | Purpose |
|---|---|
const double VerticalFov |
Default vertical FOV (70°) |
Texture2Drd Output |
Current output texture wrapper |
ConcurrentQueue<RenderNotice> Notices |
Queue of Error, NoDevice, Probe, and FrameSaved notices |
Draw(view, radius, nodeCount, elapsedSeconds, probeCount = 0, timingLabel = null, pipeline = 0, verticalFov = VerticalFov) |
Dispatch image (probeCount == 0) or diagnostic probes (probeCount > 0) |
Resize(Vector2I size) |
Resize output texture |
Rebuild(GlomeBuffers scene, byte[]? probes = null, string timingPrefix = "") |
Upload new geometry buffers and recapture Set 1 |
UpdateLight(int index, LightRecord record) |
Overwrite packed light at byte 16 + 32i |
UpdateEnvironment(EnvironmentBlock env) |
Replace 80-byte environment uniform block |
UpdateProgramBuffer(int binding, byte[] snapshot) |
Overwrite Set 1 buffer from byte 0 |
Task ReloadShader(RDShaderSpirV spirv) |
Swap compute pipelines atomically; leaves old shader active on failure |
Task<bool> CaptureFrame(string path) / SaveFrame(string path) |
Write PNG readback (requires capture: true) |
PollProbe() |
Drain timestamps and probe readback into Notices |
Dispose() |
Release GPU resources on the render thread |
Chart and collision adapters
Section titled “Chart and collision adapters”| Helper | Purpose |
|---|---|
GlomeChart.Walk(parent, transform, visit) |
Depth-first walk of descendants within one chart (stops at nested anchors, spaces, and viewports) |
ChartCamera.FromUnfolded / FromTangent / Blend |
Convert or blend Godot 3D editor transforms into S3Frame views |
CollisionShapeAdapter.Create / Box |
Convert BoxShape3D, WalkableBoxShape3D, and CylinderShape3D into CollisionProxy |
Editor extension API (Glome.Editor, #if TOOLS)
Section titled “Editor extension API (Glome.Editor, #if TOOLS)”IGlomeEditorViewProvider: implementId,DisplayName,AppliesTo(space),Bake(space)(plus optionalResolution,DisplayFilter,Animated) and register viaGlomeEditorViews.Register(provider)(dispose handle to unregister).GlomeEditorView(Snapshot, Buffers, InitialView, Program = null, PrepareFrame = null):PrepareFrame(renderer, view, elapsed)uploads per-frame Set 1 data and returns the pipeline index.GlomeEditorPlugin: exposesBridgeDirectory,BridgeShaderReload,TryGetViewState,SetView,FocusNode,RequestRebake,CapturePreviewImage, andReloadPreviewShader.GlomeInspectorPlugin: adds radius distance readouts, undoable Scale Entire Scene, and anchor radial-compression diagnostics to the Inspector.