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.
load("character.glb")// 24 joints, 3 clipsscale(model, box)// measured, not trustedground(model)// lowest point on the floorplay("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.
- 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.
- 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.
- 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.
- 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.
- 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.
0x000BD2D067 6C 54 46magic “glTF”02 00 00 00version 2D0 D2 0B 00file length 774,86448 33 01 00chunk 0: 78,664 bytes4A 53 4F 4Echunk 0 type: JSON
The JSON chunk declares
- 26
nodes - 1
meshes - 1
skins - 3
animations - 3
images - 1
materials - 209
accessors - 212
bufferViews
The BIN chunk holds
239,324 BPOSITION38,532NORMAL38,532TANGENT51,376TEXCOORD_025,688JOINTS_012,844WEIGHTS_051,376indices20,976
1,792 BinverseBindMatrices1,792
302,122 Btexture_diffuse124,534texture_normal100,268texture_metallic-texture_roughness77,320
152,932 Bidle106,964walk28,288run17,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 as | binary | JSON text | binary or text | plain text |
| Files to ship | 1 | .gltf + .bin + images | 1, images often beside | .obj + .mtl + images |
| Mesh | ✓ | ✓ | ✓ | ✓ |
| Materials | PBR | PBR | ✓ | in a .mtl |
| Textures | inside | beside, or base64 | inside or beside | beside |
| Skeleton and skin | ✓ | ✓ | ✓ | ✕ |
| Animation clips | ✓ | ✓ | ✓ | ✕ |
| Defined by | Khronos, open | Khronos, open | Autodesk | Wavefront, open |
| three.js loader | GLTFLoader | GLTFLoader | FBXLoader | OBJLoader |
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.
public/assets/models/
5 GLB files · 818,104 B
- GLB
arch.glb401 KB - GLB
flag.glb178 KB - GLB
runner.glb124 KB - GLB
hedge.glb63 KB - GLB
tree.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().
- ✓Fetch the bytes
774,864 B - ✓Split JSON and BIN
JSON 78,664 B · BIN 696,172 B - ✓Decode the textures
3 × WebP 1024 px · 302,122 B - ✓Build the geometry
3,496 triangles · 3,211 vertices - ✓Place it and play
24 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 converterHonest 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