User Rating 0.0
Total Usage 0 times
Category Media Tools

Drag & drop a .glb file here

or click to browse · max 100 MB

Is this tool helpful?

Your feedback helps us improve.

About

GLB is the binary container format for glTF 2.0 (GL Transmission Format), the ISO/IEC standard for runtime 3D asset delivery. A single .glb file packs the JSON scene descriptor and all binary buffers (vertex positions, normals, texture coordinates, indices) into one contiguous blob. Misinterpreting accessor component types or byte strides during parsing corrupts geometry silently. Getting the node transform hierarchy wrong (applying T × R × S in incorrect order) produces invisible or inverted meshes. This tool parses the raw binary, reconstructs the scene graph, and renders via WebGL 2 with Phong shading. It handles accessor types 5120 - 5126 (BYTE through FLOAT), all primitive modes, and quaternion node rotations. Limitation: embedded textures and morph targets are not rendered. Skinned meshes display in bind pose only. Models exceeding 100 MB are rejected to prevent browser tab crashes.

glb viewer 3d model viewer gltf viewer glb file 3d viewer online webgl viewer 3d model inspector

Formulas

The GLB binary layout follows a strict structure. The file begins with a 12-byte header:

Header = magic (4 bytes, 0x46546C67) + version (4 bytes) + length (4 bytes)

Each subsequent chunk has an 8-byte preamble: chunkLength (4 bytes) + chunkType (4 bytes).

Node local transform matrix is composed as:

Mlocal = T R S

where T = translation matrix from 3-vector, R = rotation matrix from unit quaternion q = (x, y, z, w), S = scale matrix from 3-vector.

Quaternion to rotation matrix conversion:

R = 12(y2+z2)2(xywz)2(xz+wy)2(xy+wz)12(x2+z2)2(yzwx)2(xzwy)2(yz+wx)12(x2+y2)

Phong illumination per fragment:

I = ka + kd max(0, n l) + ks max(0, r v)ns

where n = surface normal, l = light direction, r = reflection vector, v = view direction, ns = shininess exponent.

Reference Data

glTF Accessor Component TypeGL EnumByte SizeJS Typed Array
BYTE51201Int8Array
UNSIGNED_BYTE51211Uint8Array
SHORT51222Int16Array
UNSIGNED_SHORT51232Uint16Array
UNSIGNED_INT51254Uint32Array
FLOAT51264Float32Array
glTF Accessor Types & Component Counts
SCALAR - 1 componentIndex buffers, weights
VEC2 - 2 componentsTexture coordinates
VEC3 - 3 componentsPositions, normals
VEC4 - 4 componentsTangents, colors, quaternions
MAT2 - 4 componentsRare
MAT3 - 9 componentsRare
MAT4 - 16 componentsJoint matrices
Primitive Modes
POINTS0Point cloud rendering
LINES1Line segments (pairs)
LINE_LOOP2Connected line loop
LINE_STRIP3Connected line strip
TRIANGLES4Default face mode
TRIANGLE_STRIP5Shared-edge strip
TRIANGLE_FAN6Fan from first vertex

Frequently Asked Questions

This viewer supports static meshes with positions, normals, and texture coordinates. It handles all six accessor component types (BYTE through FLOAT), VEC2/VEC3/VEC4/SCALAR accessor types, all primitive modes (POINTS through TRIANGLE_FAN), and the full node hierarchy with TRS transforms including quaternion rotations. PBR baseColorFactor is used for material color. Textures, morph targets, animations, and skin/joint deformation are not rendered.
Three common causes: (1) The model has no normals - the Phong shader needs normals for lighting; this viewer generates flat normals as fallback. (2) The model's scale is extremely small or large relative to the camera - use the Reset Camera button to auto-fit. (3) The model uses extensions like KHR_materials_unlit which this viewer ignores, defaulting to a gray material. Check the Model Info panel for vertex/triangle counts to confirm the geometry loaded.
The limit is 100 MB. The entire GLB is loaded into an ArrayBuffer in browser memory. Parsing creates additional typed array views for every accessor, and WebGL buffers duplicate the geometry data on the GPU. A 100 MB file can easily consume 300-400 MB of total memory. Exceeding this risks crashing the tab, especially on mobile devices with 2-3 GB RAM limits per tab.
After parsing all mesh positions, the viewer computes an axis-aligned bounding box (AABB). The center of this box becomes the orbit target. The bounding sphere radius is calculated as half the AABB diagonal. The camera distance is set to 2.5 times this radius, ensuring the entire model fits within the perspective frustum with a 45-degree field of view.
No. All processing happens entirely in the browser using the File API and WebGL. The binary data never leaves your device. No network requests are made. The file is read via FileReader.readAsArrayBuffer and parsed in JavaScript on the client side.
glTF specifies counter-clockwise winding order for front faces. If a model was exported with flipped normals or clockwise winding, backface culling hides those triangles. Toggle the wireframe mode to see all edges regardless of face orientation. Some exporters (especially from CAD software) produce inconsistent winding. The viewer enables backface culling by default for performance but you can observe the geometry in wireframe mode.