Luke San Antonio 5415f413b8 Print shaders, programs, and techniques in loader_example.cc
This changes the way parameters for materials and techniques are
printed. Now only one of either the number array or string value will be
printed. Before, both would be printed with the same name being used.
2016-06-15 14:11:55 -04:00
2016-04-20 14:06:56 +09:00
2016-06-11 16:10:39 +09:00
2016-02-07 17:45:17 +09:00
2015-12-21 01:20:35 +09:00
2016-03-08 01:31:49 +09:00
2016-05-01 20:27:30 +09:00
2015-12-21 01:23:00 +09:00
2015-12-21 11:50:21 +09:00
2016-05-01 20:27:30 +09:00
2015-12-20 20:27:54 +09:00
2015-12-20 20:27:54 +09:00
2016-06-15 15:48:18 +09:00
2015-12-21 01:20:35 +09:00

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

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

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)

TODOs

  • Support multiple scenes in .gltf
  • Parse animation, sampler
  • Compression/decompression(Open3DGC, etc)
  • Support extensions and extras property
  • HDR image?

License

TinyGLTFLoader is licensed under 2-clause BSD.

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 to your local dir.

Run test

After building loader_test, edit test_runner.py, then,

$ python test_runner.py
Description
No description provided
Readme MIT 22 MiB
Languages
C++ 82.4%
C 17.2%
CMake 0.2%
Python 0.1%