• Stars
    star
    247
  • Rank 164,117 (Top 4 %)
  • Language
    C
  • Created almost 9 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Header only C++ Tiny glTF loader.

Tiny glTF loader, header only C++ glTF 1.x parsing library.

TinyGLTFLoader is a header only C++ glTF 1.x https://github.com/KhronosGroup/glTF parsing library.

TinyGLTFLoader is deprecated. Please go https://github.com/syoyo/tinygltf for glTF 2.0 parser/serializer

Build Status

Build status

Features

  • Portable C++. C++-03 with STL dependency only.
  • Moderate parsing time and memory consumption.
  • glTF specification v1.0.0
  • Buffers
    • Parse BASE64 encoded embedded buffer fata(DataURI).
    • Load .bin file.
  • Image(Using stb_image)
    • Parse BASE64 encoded embedded image fata(DataURI).
    • Load external image file.
    • PNG(8bit only)
    • JPEG(8bit only)
    • BMP
    • GIF

Examples

  • glview : Simple glTF geometry viewer.
  • writer : Simple glTF writer(serialize tinygltf::Scene class)
  • alembic_to_gltf : Simple Alembic to glTF converter.
  • cyhair_to_gltf : Simple CyHair(hair curves) to glTF converter.

TODOs

  • Write C++ code generator from json schema for robust parsing.
  • Support multiple scenes in .gltf
  • Parse skin
  • Compression/decompression(Open3DGC, etc)
  • Support extensions and extras property
  • HDR image?

License

TinyGLTFLoader is licensed under MIT license.

TinyGLTFLoader uses the following third party libraries.

  • picojson.h : Copyright 2009-2010 Cybozu Labs, Inc. Copyright 2011-2014 Kazuho Oku
  • base64 : Copyright (C) 2004-2008 René Nyffenegger
  • stb_image.h : v2.08 - public domain image loader - http://nothings.org/stb_image.h

Build and example

Copy stb_image.h, picojson.h and tiny_gltf_loader.h to your project.

// Define these only in *one* .cc file.
#define TINYGLTF_LOADER_IMPLEMENTATION
#define STB_IMAGE_IMPLEMENTATION
#include "tiny_gltf_loader.h"

using namespace tinygltf;

Scene scene; 
TinyGLTFLoader loader;
std::string err;
  
bool ret = loader.LoadASCIIFromFile(scene, err, argv[1]);
//bool ret = loader.LoadBinaryFromFile(scene, err, argv[1]); // for binary glTF(.glb) 
if (!err.empty()) {
  printf("Err: %s\n", err.c_str());
}

if (!ret) {
  printf("Failed to parse glTF\n");
  return -1;
}

Running tests.

Setup

Python 2.6 or 2.7 required. Git clone https://github.com/KhronosGroup/glTF-Sample-Models to your local dir.

Run test

After building loader_example, edit test_runner.py, then,

$ python test_runner.py

More Repositories

1

tinygltf

Header only C++11 tiny glTF 2.0 library
C++
1,582
star
2

tinyexr

Tiny OpenEXR image loader/saver library
C++
620
star
3

tinyobjloader-c

Header only tiny wavefront .obj loader in pure C99
C
346
star
4

tinyusdz

Tiny, dependency-free USDZ/USDA/USDC library written in C++14
C++
283
star
5

tinydng

Header-only Tiny DNG/TIFF loader and writer in C++
C
126
star
6

MMDLoader

Simple MMD(PMD/VMD) loader in C++
C++
105
star
7

lucille

lucille global illumination renderer
C
89
star
8

tacotron-tts-cpp

Tacotron text to speech in C++(synthesize only)
C++
71
star
9

nanovg-nanort

NanoRT(SW ray tracer) backend for NanoVG
C
49
star
10

nanocanvas

NanoCanvas, portable JavaScript vector graphics engine.
C
43
star
11

tinymeshutils

Tiny Mesh utilities(e.g. compute half-edge data structure) in C++11
C++
35
star
12

docker-utils

Docker utilities
Shell
33
star
13

tinyvdbio

TinyVDBIO header-only C++ OpenVDB IO library
C++
32
star
14

eson

ESON, Exa-scale Storage Object Notation
Python
31
star
15

window-bootstrap

Cross-platform C++ Window/UI bootstrap
C
29
star
16

python-rdma-examples

Python RDMA sample scripts
Python
18
star
17

tinyshrot

TinySHRot, header-only C89 spherical harmonics rotation codes.
C
17
star
18

aobench

Automatically exported from code.google.com/p/aobench
HTML
16
star
19

aobench_cs

aobench in OpenGL compute shader!
C++
12
star
20

standalone-pocketfft

pocketfft in standalone C
C
12
star
21

tinyxpd

Dependency-free and header-only C++11 XGen XPD cache I/O library.
C++
11
star
22

USD-build-aarch64

USD build script for aarch64 target
C++
10
star
23

dynamic_bitset

Simple dynamic bitset template class
C++
10
star
24

oi-build

OpenIndiana Unified Build System
C
9
star
25

minioptix

Mini OptiX sample
C
8
star
26

libphm

PHM: Simple Portable Half float(fp16) Map fileformat in C/C++
C
7
star
27

tinylinalg

Tiny linear algebra and matrix math library
7
star
28

xgen-spline-to-cyhair

XGen Interactive Grooming spline to CyHair exporter
C++
7
star
29

node.rdma

RDMA transport layer for node.js
C++
6
star
30

tinylosslessjpeg

Tiny LosslessJPEG decoder in C++11
6
star
31

flutter_native_vulkan_experiment

Experiment to call Vulkan function from Flutter(dart ffi)
Dart
6
star
32

espnet-tts-streamlit

ESPNet TTS with Streamlit GUI
Python
6
star
33

tinycolorio

Header-only C++11 color IO library
Jupyter Notebook
6
star
34

OpenVDB-Android

Android port of OpenVDB
C++
5
star
35

staticstruct

Simple statically typed struct serialization/deserialization library in C++11
C++
5
star
36

raw-images

RAW photo images
5
star
37

espnet-tts

ESPNet TTS standalone execution
Python
4
star
38

mudalang

MUDA(MUltiple Data Accelerator) language
Haskell
4
star
39

solaris-infiniband-tools

Tcl
4
star
40

minijit

Minimal clang/LLVM JIT experiment
CMake
4
star
41

usda-to-usdc-experiment

USDA to USDC conversion experiment in C++
C++
4
star
42

cycles

cycles experimental
C++
3
star
43

tinyarchive

Tiny binary archive library.
C++
3
star
44

parallella-playground

Parallella Epiphany playground
C
3
star
45

aobench_oculus

aobench for Oculus Rift
C++
3
star
46

libtorch_mobile_build

libtorch mobile build script
CMake
2
star
47

libjsonnet-cpp

Embed jsonnet to your C++11 application
C++
2
star
48

francine

Render backend
2
star
49

MUDA

MUDA is a MUltiple Data Accleleration language
Haskell
2
star
50

cmake-rpath-experiment

CMake + RPATH experiment
CMake
2
star
51

alembic-converters

Alembic file formart converters in C++11
C++
2
star
52

jsmuda

optimized code generator written in node.js
JavaScript
2
star
53

llvm-project-mingw-build

llvm-project MinGW build script using llvm-mingw
Shell
2
star
54

LLL

Lucille Light transport Language
Haskell
2
star
55

cyhair-combiner

Simple CyHair combiner tool
C++
2
star
56

jch-vis

Visualize Jump Consistent Hash
1
star
57

visemenet-docker

Run VisnemeNet inference in nvidia-docker container
Dockerfile
1
star
58

klee-avx

avx support branch for klee
1
star
59

OSOgraph

Simple script visualizing OSO instructions using graphviz
Python
1
star
60

orelatex

俺得 latex 環境テンプレート
1
star
61

oremake

oremake
JavaScript
1
star
62

aobench-fortran

Fortran 90 port of aobench
Fortran
1
star
63

aobench-osv

OSv port of aobench
C++
1
star
64

nanostl

NanoSTL, small subset of C++ STL
1
star
65

llvm-win-build

llvm-win-build
1
star
66

aobench-ios

aobench-ios
C
1
star
67

orevfx

ore vfx tool build
1
star
68

clapack-cmake-android-arm64

clapack cmake build for Android ARM64(NDK r20 or later)
C
1
star
69

orebuildenv

俺得ビルド環境
Shell
1
star
70

naiad-tools

Naiad emp processing tools
C
1
star
71

lesh

continuos building tool
JavaScript
1
star