reckfellENGINE

3D export to glTF: files, materials and verification

Export GLB/glTF from the editor and C#, handle dependencies, material limits and round trips.

On this page

What glTF transfers

glTF 2.0 is a 3D interchange format, not a project backup. Export geometry and supported materials for editing in a DCC application or transfer to another tool. Use native project formats to preserve Reckfell gameplay Entities/resources, and project export to distribute the game.

Successful file writing does not guarantee identical appearance: the receiving application may handle lighting, materials and glTF extensions differently. Scripts, gameplay connections, WorldEnvironment settings, postprocessing and particle simulation do not become a portable game project.

Export from the editor

  1. Open the required 3D level or prefab. Export traverses its root and descendants; it does not export every open tab.
  2. Check geometry, local transforms, materials and membership in the saved tree. In editor mode, temporary descendants without an Owner can be excluded.
  3. Select Scene → Export As… → glTF 2.0 Scene…, choose the output file and review export settings before confirming.
  4. Open the result in the receiving program. Compare scale, hierarchy, surfaces, textures and required animations.

Menu labels can be localized. Visibility and root-mode settings affect output; do not assume that an invisible object is automatically excluded. This interface workflow was checked against source; additional plugins can change export settings.

FormatWhat to transfer
.gltfThe JSON file plus generated .bin, images and other dependencies, preserving relative paths
.glbUsually a binary container with embedded data; still check external URIs and the result in the receiving application

Do not call .gltf with neighboring files an embedded format. For very large data or nondefault settings, do not assume that one .glb always suffices.

Export from C#

The output directory must exist and be writable. Pass a live Entity3D root and a path ending in .glb or .gltf, such as user://model.glb. Save this class as ExportModel.cs:

C#
using System;
using Reckfell;

public static class ExportModel
{
    public static Error Write(Entity3D root, string outputPath)
    {
        if (!outputPath.EndsWith(".glb", StringComparison.OrdinalIgnoreCase)
            && !outputPath.EndsWith(".gltf", StringComparison.OrdinalIgnoreCase))
            return Error.InvalidParameter;

        using var document = new GltfDocument();
        using var state = new GltfState();
        Error error = document.AppendFromScene(root, state);
        if (error != Error.Ok)
            return error;
        return document.WriteToFilesystem(state, outputPath);
    }
}

AppendFromScene populates GltfState; WriteToFilesystem creates the file. Check both stages. For independent exports, the example creates a new state each call. The source tree remains owned by the caller and is not freed.

Error.Ok means the API operation succeeded, not that every artistic or gameplay requirement was verified. Export can create several files and is not an atomic directory replacement: inspect partially written output after failure.

Practical limitations

Source contentWhat to check
StandardMaterial3D / BaseMaterial3DSupported PBR factors, color, texture channels, transparency and UVs; not every material effect has an equivalent
ShaderMaterialThe shader program is not transferred as an executable glTF material. Export can succeed with a simple material instead of the original effect
ParticlesDo not expect simulation or behavior to transfer. A generic hierarchy element does not mean the particle system survived
CSGOutput depends on conversion of current geometry; operation history does not become editable CSG in another application
Cameras and lightsReceiver support for parameters/extensions, units, exposure and actual frame appearance
Animation and skeletonNames, bindings, range and bake rate, then motion in the receiving program

Verify the result and diagnose failures

For a round trip, create a fresh GltfDocument and GltfState, call AppendFromFile(path, state) and, after Error.Ok, GenerateScene(state). The returned tree has not been added to EntityTree: use it explicitly and free it when no longer needed. This checks Reckfell's own reader; compatibility with another application requires a separate test there.

ProblemCheck
No output or writing failedDirectory existence, write access, Error and log; this is not a parent-directory creation command
Model exists, textures missingNeighboring files and relative URIs, source material export and image-format support
File written, effect lostShaderMaterial, postprocessing or unsupported material feature; Error.Ok alone is insufficient
Object missingEditor Owner, visibility mode, exported subtree and log
Lighting differsEnvironment, exposure, extension support and receiver rendering settings

Continue with 3D import and runtime files.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.