Razorbill
Components

Rendering Components

MeshComponent

Attaches a mesh to an entity for rendering. References mesh and material assets by GUID.

PropertyTypeDefaultDescription
mesh_guidGuidnullGUID of the mesh asset to render
material_guidGuidnullGUID of the material to apply
visibleBooltrueWhether the mesh is rendered

Creating a Mesh Entity

The easiest way is through CreatePrimitive, which auto-creates the entity with Transform and MeshComponent:

{
  "op": "CreatePrimitive",
  "params": {
    "primitive_type": "Sphere",
    "entity_name": "Ball",
    "position": [0, 3, 0],
    "segments": 32
  }
}

Available primitive types: Cube, Sphere, Plane, Cylinder.

Toggling Visibility in Scripts

void OnUpdate(ScriptContext* ctx) {
    // Toggle mesh visibility with V key
    if (ctx->is_key_pressed(ctx, 86)) { // 86 = 'V'
        bool visible;
        ctx->get_mesh_visible(ctx, ctx->self, &visible);
        ctx->set_mesh_visible(ctx, ctx->self, !visible);
    }
}

SkinnedMeshComponent

A mesh that deforms based on a skeletal animation rig. Used for animated characters and objects.

PropertyTypeDefaultDescription
mesh_guidGuidnullGUID of the skinned mesh asset
skeleton_guidGuidnullGUID of the skeleton asset
material_guidGuidnullGUID of the material to apply
source_glb_pathString""Path to the source glb file (for re-import)
visibleBooltrueWhether the mesh is rendered
cast_shadowsBooltrueWhether this mesh casts shadows

Skinned meshes are typically created by importing a .glb file that contains a skeleton and skinning data.


PBRMaterialComponent

Physically-based rendering material using the metallic/roughness workflow. Supports albedo, normal, and ambient occlusion textures.

PropertyTypeDefaultDescription
guidGuidnullMaterial asset GUID
nameString""Display name
base_colorVec4{x:1, y:1, z:1, w:1}RGBA base color in sRGB space (0-1 range)
metallicFloat0.0Metallic factor. 0 = dielectric (plastic, wood), 1 = metal (gold, iron)
roughnessFloat0.5Roughness factor. 0 = mirror-smooth, 1 = fully rough/matte
albedo_texture_guidGuid?nullOptional albedo texture (sRGB). base_color modulates the texture
normal_texture_guidGuid?nullOptional normal map (tangent-space, linear)
ao_texture_guidGuid?nullOptional ambient occlusion texture (linear, red channel)

Common Material Presets

Materialbase_colormetallicroughness
Plastic (red)[0.8, 0.1, 0.1, 1]0.00.4
Polished metal[0.9, 0.9, 0.9, 1]1.00.1
Rough wood[0.5, 0.3, 0.15, 1]0.00.8
Gold[1.0, 0.76, 0.33, 1]1.00.3
Glass[0.9, 0.95, 1.0, 0.3]0.00.05

Example: Apply PBR Material

{
  "op": "CreatePBRMaterial",
  "params": {
    "entity_name": "Floor",
    "base_color": [0.5, 0.3, 0.15, 1.0],
    "metallic": 0.0,
    "roughness": 0.8,
    "material_name": "WoodFloor"
  }
}

UnlitMaterial

A flat-color material that ignores scene lighting. Useful for UI elements, debug visualization, wireframes, and stylized rendering.

PropertyTypeDefaultDescription
guidGuidnullMaterial asset GUID
nameString""Display name
colorVec4{x:1, y:1, z:1, w:1}RGBA color (0-1 range)
albedo_texture_guidGuid?nullOptional texture. Color modulates the texture

On this page