EvonX
Part of a 3D game build

The GLB file in a 3D browser gameThe model is in the game, not in a folder.

Getting a 3D model into a browser game is normally a chain of chores: convert it to GLB, fix its scale, turn it the right way, load it, hook up its animations. When EvonX builds a 3D game it does that chain itself. Each model is made or picked for the game, stored as a GLB and placed in the scene by the same AI that writes the game's code.

My 3D game
evonx.ai/games/my-3d-gamePlaying
GLBcharacter.glb · 757 KB
GLB757 KB3 clips
  1. load("character.glb")// 24 joints, 3 clips
  2. scale(model, box)// measured, not trusted
  3. ground(model)// lowest point on the floor
  4. play("run")// clip by name

Playing run · walk, run, idle in the file

How it works

From a sentence to a model in the scene.

These are the steps EvonX runs for every 3D model a game needs. You see the result in the game, not the pipeline.

  1. Step 1

    You describe the game

    Say what the game is and what is in it: a knight, a kart, a row of market stalls. The build works out which 3D models the game needs and what role each one plays.

  2. Step 2

    Each model is made or picked

    A model is either generated for your game, which means reconstructed from views the AI draws of it, or taken from EvonX's free asset library. Either way it lands in the game as one GLB file.

  3. Step 3

    It is sized and stood on the ground

    The game does not trust the numbers in the file. It measures the model's bounding box, scales it to the height or width the game wants and puts its lowest point on the ground.

  4. Step 4

    It is turned to face forward

    If a model looks the wrong way, it is turned once in the game's asset list, in degrees, not patched in code at every place it appears.

  5. Step 5

    Its animations are wired by name

    A rigged character's clips are played by name: idle, walk, run, attack. A check refuses a game that asks for a clip the file does not contain, so a missing animation is caught before you play.

Opened up

What is inside a GLB file.

What is a GLB file? The question is easier to answer with one open on the table. This is character.glb, the rigged character from our own builds, laid out byte by byte. The first 12 bytes are the header: the letters glTF, the version number 2 and the length of the whole file, 774,864 bytes. Two chunks follow. The JSON chunk, 78,664 bytes, is the description: 26 nodes, one mesh, one skin, three animations, three images and 209 accessors saying where each piece of data starts.

The BIN chunk, 696,172 bytes, is the data itself. Hover a block to see its parts: vertex positions, normals and UVs, the weights that tie the mesh to its 24 bones, three WebP textures that together take 302,122 bytes, the largest share, and the keyframes of idle, walk and run. Nothing points outside the file, so a game fetches it with a single request.

character.glb774,864 BglTF 2.0 · binary0x000BD2D0
Header · 12 B JSON · 78,664 B BIN · 696,172 B
  1. 67 6C 54 46magic “glTF”
  2. 02 00 00 00version 2
  3. D0 D2 0B 00file length 774,864
  4. 48 33 01 00chunk 0: 78,664 bytes
  5. 4A 53 4F 4Echunk 0 type: JSON

The JSON chunk declares

  • 26nodes
  • 1meshes
  • 1skins
  • 3animations
  • 3images
  • 1materials
  • 209accessors
  • 212bufferViews

The BIN chunk holds

Mesh · 3,496 triangles239,324 B
  • POSITION38,532
  • NORMAL38,532
  • TANGENT51,376
  • TEXCOORD_025,688
  • JOINTS_012,844
  • WEIGHTS_051,376
  • indices20,976
Skin · 24 joints1,792 B
  • inverseBindMatrices1,792
Textures · 3 WebP302,122 B
  • texture_diffuse124,534
  • texture_normal100,268
  • texture_metallic-texture_roughness77,320
Animations · 3 clips152,932 B
  • idle106,964
  • walk28,288
  • run17,680

Four formats

GLB, glTF, FBX, OBJ: what each one holds.

The table fills in what each format can carry. GLB and glTF are one Khronos standard in two packagings: glTF keeps the description as readable JSON and leaves the geometry in a .bin and the textures in image files next to it, while GLB packs all of that into one binary file. Our character would ship as five files in the first form and one in the second. Press GLB vs glTF and only the packaging rows light up.

Press GLB vs FBX and the difference moves elsewhere. FBX, Autodesk's format, also holds meshes, skeletons and animation, but its textures often travel beside it and its materials are usually the older Phong and Lambert kinds rather than glTF's PBR. OBJ is the oldest of the four: plain-text geometry with a .mtl for materials and no skeleton or animation at all, so a character never survives the trip.

.glb.gltf.fbx.obj
Stored asbinaryJSON textbinary or textplain text
Files to ship1.gltf + .bin + images1, images often beside.obj + .mtl + images
Mesh✓✓✓✓
MaterialsPBRPBR✓in a .mtl
Texturesinsidebeside, or base64inside or besidebeside
Skeleton and skin✓✓✓✕
Animation clips✓✓✓✕
Defined byKhronos, openKhronos, openAutodeskWavefront, open
three.js loaderGLTFLoaderGLTFLoaderFBXLoaderOBJLoader
character.glb as GLB: 1 file, 774,864 Bunpacked as glTF: 5 files (.gltf, .bin, 3 images)

In the browser

3D browser games built from GLB files.

Each tab is one of our own 3D game templates, recorded while it plays: Crowd runner, Endless runner, Tower defense and Car match. They run in an ordinary browser tab on three.js, with nothing to install, and every model on screen arrives as a GLB from the template's own models folder, listed on the right with its real size, biggest first.

The counts show how much a small game leans on the format. Crowd runner ships 5 models, the endless runner 14, Tower defense 13 and Car match 19, from a 58 KB street lamp to a 606 KB soldier. When you start from one of these templates its models stay in place, and any model generated for your idea lands in the same folder as a GLB too, so a new character stands beside the old ones without a conversion step.

evonx.ai/games/templates/crowd-runnerthree.js · GLB

public/assets/models/

5 GLB files · 818,104 B

  • GLBarch.glb401 KB
  • GLBflag.glb178 KB
  • GLBrunner.glb124 KB
  • GLBhedge.glb63 KB
  • GLBtree.glb53 KB

Load path

What a game does with a GLB, step by step.

Pick a file and follow it down the line. First the bytes are fetched: 774,864 for the rigged character, 311,752 for the cannon from our Conveyor Smash template. The loader then splits the file at its chunk markers, reads the JSON to learn what is inside and hands each texture to the browser's image decoder, three WebP pictures for the character and one for the cannon.

Next the geometry is built straight from the BIN chunk, because the GLB format stores vertices the way a graphics card reads them: 3,496 triangles for the character, 11,044 for the cannon. Last, the game measures the model's bounding box, sets it in the scene and, when it has a skeleton, plays a clip by name. The console under the steps shows the calls our games really make, starting with createGLTFLoader().loadAsync().

a rigged character
  1. ✓
    Fetch the bytes774,864 B
  2. ✓
    Split JSON and BINJSON 78,664 B · BIN 696,172 B
  3. ✓
    Decode the textures3 × WebP 1024 px · 302,122 B
  4. ✓
    Build the geometry3,496 triangles · 3,211 vertices
  5. ✓
    Place it and play24 joints · idle · walk · run
const gltf = await createGLTFLoader().loadAsync("character.glb");
const box = new THREE.Box3().setFromObject(gltf.scene);
scene.add(gltf.scene);
player.play("run");

What you get

A 3D game that loads in a browser tab.

GLB, the web's 3D format

Every model in an EvonX game is a GLB, loaded with three.js's glTF loader. No plug-in, no install: the game opens from a link on a phone or a laptop.

Models at the size the game needs

Because models are fitted by their measured size, a model made in centimetres and one made in metres end up at the right height next to each other.

Clips that match the code

The game logic and the model agree on clip names, and the build checks that they do. You do not find out in the middle of a level that the jump has no animation.

Nothing to convert or import

You never handle an FBX, an OBJ or an export dialog. The format, the scale and the direction are settled inside the build.

Working in your own engine?

Convert FBX to GLB, free, in your browser.

If you are building the game yourself, the first chore is the format. The free converter turns an FBX into a GLB with its skeleton and animation clips, fixes scale and up axis, and never uploads your file.

Open the FBX to GLB converter

Honest limits

What it does not do.

No upload of your own model file

Today the chat does not accept a 3D model file as an attachment. Models in an EvonX game are generated in the build or come from the asset library.

A picture works instead

You can attach a picture of your character or object. It can be used in the game as it is, or serve as the reference a new 3D model is built from.

Generated 3D needs a paid plan

Generating new 3D models is part of the paid plans and uses credits. Library models and the models a game template ships with are not behind that line.

GLB only

A game holds GLB files and nothing else. FBX, OBJ and loose glTF folders are not loaded by a game; that is what the converter is for in your own projects.

Questions

GLB files and 3D browser games, answered.

What is a GLB file?

A GLB file is a 3D model saved in the binary form of glTF 2.0. One .glb holds everything the model needs: the mesh, its materials and textures and, for a character, its skeleton and animations. Because nothing sits in a separate file, a GLB loads, travels and drops into a game as a single file. Every 3D model in an EvonX game is a GLB.

What is the GLB format used for in a browser game?

It is how 3D models reach the web. GLB stores geometry the way a graphics card reads it and packs meshes, materials, textures and animation into one file, so a game in a browser tab loads it directly, with nothing to install. three.js, the 3D library EvonX games run on, loads it with its GLTFLoader. That is why EvonX stores every model in a game as GLB.

GLB vs glTF: what is the difference?

They are the same format in two packages. A .gltf file is JSON text that describes the model and usually points to separate files: a .bin with the geometry and image files for the textures. A .glb packs that JSON, the geometry and the textures into one binary file. glTF is easier to read and edit by hand, GLB is easier to ship, and an EvonX game keeps one GLB per model.

GLB vs FBX: which one should a game use?

FBX is Autodesk's format, common in game engines and 3D programs. Browser 3D libraries are built around glTF instead: three.js loads GLB through its GLTFLoader, its main path, while FBX needs a separate loader and is usually converted first. For a game that runs in a browser, GLB is the format to ship. The free FBX to GLB converter on this site does the conversion with the skeleton and animation clips included.

How do I open a GLB file?

In your browser, with nothing to install: the free GLB viewer in EvonX's tools opens a .glb on your own computer, lets you turn the model, plays its animations and shows its triangles, textures and materials. It also opens glTF, FBX and OBJ, and your file is never uploaded.

How do I get a 3D model into a browser game?

In your own code: convert the model to GLB, load it with a glTF loader such as the one in three.js, scale it, turn it and play its clips through an animation mixer. In EvonX you skip those steps: you describe the game and the build makes or picks each model, stores it as GLB and places it.

Can I upload my own FBX, OBJ or GLB to an EvonX game?

Not today. The chat does not take 3D model files. You can attach a picture of the thing you want and EvonX can build a 3D model from it, or pick a close match from the asset library.

Why is my model the wrong size in the game?

Formats disagree about units: FBX usually counts in centimetres, glTF in metres, OBJ says nothing. EvonX avoids the question by measuring each model and scaling it to the size the game asks for. In your own project, fix the scale when you convert.

Do the models' animations work?

Yes for rigged characters. Their clips are stored under plain names and the game plays them by name. The build checks that every clip the game asks for exists in the file.

Does a 3D EvonX game run on a phone?

It runs in the phone's browser, with nothing to install. Models are kept within triangle budgets chosen for their role so a scene stays light enough for mobile hardware.

Skip the import chores. Play the game.

Describe a 3D game and the things in it. EvonX makes the models, places them and gives you a link that opens in a browser.

Make a 3D game