glTF vs GLB — 같은 포맷, 다른 패키징

같은 데이터, 다른 파일 레이아웃
glTF 2.0(Khronos Group, 2017)이 스키마. .gltf는 스키마를 JSON으로 저장하고 별도 .bin 지오메트리 버퍼와 URI 참조 이미지 파일. .glb는 같은 JSON·버퍼·이미지를 단일 바이너리 컨테이너에 패킹. 로더는 두 포맷 다 파싱 — three.js·Babylon.js·model-viewer·Blender·Unity·Unreal 모두 처리. 화면 결과 동일, 선택은 능력 아니라 전달에 관한 것.
GLB가 glTF를 내부적으로 감싸는 방법
GLB 파일은 12바이트 헤더로 시작 — 매직 'glTF'(4바이트), 버전 2(4바이트), 총 파일 길이(4바이트). 그 다음 길이 접두 청크들. 청크 0: JSON(.gltf에 있을 같은 JSON, 4바이트 정렬 패딩). 청크 1: BIN(연결된 버퍼 데이터 — 정점·인덱스·UV·노멀·애니메이션). 선택적 청크 2+: 임베드 이미지 데이터. JSON이 byteOffset/byteLength로 버퍼 청크 1 참조, 로더는 JSON 먼저 파싱하고 오프셋으로 바이너리 청크 슬라이스. ZIP·압축 없이 길이 접두 바이너리만.
실전 차이
- 파일 수 — .gltf는 3+ 파일(JSON·.bin·텍스처), .glb는 단일 파일. 단일 파일은 단일 HTTP 요청과 깨진 서브 에셋 참조 없음.
- 편집성 — .gltf JSON은 사람이 읽고 손 편집 가능, .glb는 추출 도구 필요해서 검사하거나 수정.
- 크기 — .glb가 약간 더 작음(JSON 공백 없음·경로 오버헤드 없음) 하지만 압축 안 됨. 진짜 크기 감소엔 Draco나 Meshopt.
- CDN 전달 — .glb가 더 친화적(단일 Content-Type·단일 캐시 엔트리), .gltf는 서브 에셋 페치용 CORS 설정 필요.
- 스트리밍 — .glb는 바이트 레인지 요청으로 점진 로드, .gltf는 서브 에셋 병렬 스트리밍 가능.
- 툴링 — gltf-pipeline(Cesium)과 gltf-transform(donmccurdy)이 두 포맷 간 변환하고 Draco·Meshopt·KTX2 압축 적용.
어느 쪽 골라야 하나 — 다섯 결정 룰
- Open pcbviewer.app — 프로덕션 웹 전달은 .glb. 단일 요청·단일 Content-Type·단일 CDN 엔트리·깨진 참조 없음.
- 개발과 디버깅은 .gltf. JSON은 텍스트 에디터에서 읽기 가능, 머티리얼 손 편집·텍스처 교체·노드 하이어라키 검사가 툴링 없이 가능.
- 여러 모델 간 텍스처 공유하는 에셋 라이브러리는 .gltf. 5개 모델이 단일 PNG 공유하면 바이트와 CDN 캐시 공간 절약.
- 이메일이나 단일 파일 핸드오프는 .glb. 패키지 분리 리스크 없음, 첨부 하나가 전부.
- 최대 압축은 컨테이너 무관 Draco(KHR_draco_mesh_compression)와 KTX2(KHR_texture_basisu) 적용 — .gltf나 .glb 모두에서 동작.
브라우저에서 STEP·STL·다른 포맷을 glTF·GLB로 변환 — 배포 전 MakerSuite 3D에서 프리뷰.
MakerSuite 3D 무료로 써보기왜 포맷 선택이 파이프라인에 영향
CI/CD·CDN 설정·에셋 버저닝 모두 이거에 의존. 멀티 파일 .gltf는 각 서브 에셋 도메인용 CORS 설정 필요, 캐시 무효화 복잡, 텍스처 파일 이름 바뀌면 깨진 링크 리스크. 단일 파일 .glb는 배포 쉽지만 디버그 어려움. 팀 병목 따라 선택 — 에셋 디버깅이 통증이면 개발 중 .gltf, CDN 신뢰성이 통증이면 항상 .glb.
각 포맷이 이기는 곳
- 이커머스 3D — .glb로 제품 뷰어, 더 단순한 CDN 통합
- AR/VR 경험 — .glb로 네트워크 전송, model-viewer와 WebXR 둘 다 선호
- 게임 에셋 파이프라인 — 개발 중 .gltf, 빌드 타임 Draco 압축
- 건축 시각화 — 클라이언트 프리뷰 .glb, 소스 에셋 공유 시 .gltf
- 교육·박물관 3D — 임베딩에 .glb, 학습자가 데이터 검사하길 원할 때 다운로드용 .gltf
브라우저에서 변환 검증
.gltf와 .glb 둘 다 독점 3D 모델 포함 가능. MakerSuite 3D는 three.js GLTFLoader로 두 포맷 다 브라우저에서 완전 파싱 — 서버·업로드·캐시 사본 없음. 변환된 에셋 드롭해서 배포 전 지오메트리·머티리얼·텍스처 검증. NDA 작업·출시 전 제품 시각화·IP 민감 3D 모델에 안전.
자주 묻는 질문
What's the actual difference — same data?
Same data, different packaging. glTF 2.0 (Khronos Group, 2017) defines the scene-graph schema; .gltf files store it as JSON with separate .bin geometry buffers and texture image files referenced by URI. .glb is the same JSON + buffers + images packed into a single binary container with a 12-byte header (magic 'glTF', version, length) followed by chunks. Loaders parse both — three.js, Babylon.js, model-viewer, Blender, Unreal, Unity all handle either. The on-screen result is identical; only the file layout differs.
Which should I use for web?
GLB, almost always. One file means one HTTP request, no CORS quirks for sub-assets, no broken references when a file gets renamed. Servers can apply Content-Type: model/gltf-binary in one place. CDNs cache the bundle as a unit. The exception: if you want to hand-edit JSON for debugging, .gltf is readable in any text editor. For production, ship .glb and keep .gltf in version control as the editable source if you need it.
Does GLB compress better?
No — GLB is uncompressed binary. The size advantage over .gltf comes from removing JSON whitespace and consolidating files, not from compression. For real size reduction, use Draco (geometry compression, Khronos extension KHR_draco_mesh_compression) or Meshopt (KHR_meshopt_compression). These can reduce mesh data 5-10x at minor decompression cost. KTX2 with Basis Universal compresses textures. All three can be applied to either .gltf or .glb. Tools: gltf-pipeline (Cesium, JS) or gltf-transform (donmccurdy, Node).
What's inside the GLB binary?
Three or more chunks after the 12-byte header. Chunk 0: JSON (the same JSON that would be in .gltf, padded to 4-byte alignment). Chunk 1: BIN (concatenated buffer data — vertices, indices, UVs, normals, animations). Chunks 2+: optional, typically embedded image data referenced from JSON. The JSON in chunk 0 references buffer chunk 1 via byteOffset and byteLength, so loaders parse JSON first, then slice the binary chunk by offset. No ZIP, no compression — just length-prefixed chunks.
Can I extract assets from a GLB?
Yes, with any glTF tool. gltf-pipeline can convert GLB to glTF with separated assets: gltf-pipeline -i model.glb -o model.gltf --separate. The output gives you the JSON, .bin buffers, and individual texture files. Useful for debugging materials, swapping textures, or hand-editing the scene graph. For inspection without extraction, the donmccurdy.com glTF Viewer and gltf.report inspect GLB internals directly. MakerSuite 3D opens both formats in the browser viewer.
관련 글
.gltf나 .glb 파일 드롭 — 어떤 브라우저에서나 프리뷰
3D 뷰어 열기