Yocto/GL is a collection of single-file libraries for building physically-based graphics applications. Yocto/GL is written in C++ and can be used from with C or C++ and works on OSX (clang), Linux (clang/gcc) and Windows (cl).
- yocto_obj.h - Wavefront OBJ/MTL loader and writer that supports arbitrary polygons (with/without triangulation), lines, and points. Includes optionals extensions for per-vertex color and radius, camera and environment map. Optionally depends on
stb_image.h
for texture loading. - yocto_gltf.h - Khronos glTF loader and writer automatically generated by the spec. Supports all glTF format including Khronos extensions. Depends on
json.hpp
for json parsing. Optionally depends onstb_image.h
andstb_image_write.h
for texture loading and writing. - yocto_bvh.h - Ray casting and closet point queries of points, lines and triangles accelerated by a two-level bounding volume hierarchy.
- yocto_shape.h - Utilities for manipulating shapes composed of points, lines, triangles or quads. Includes parametric shape generation, uniform tesselation, normal computation, uniform shape sampling.
- yocto_trace.h - Path tracer with support for point, line or triangle geometry, mesh area lights and environment maps, materials with either GGX or Phong (only opaque for now). Support both incremental and offline computation on single- or multi-core machines.
- yocto_sym.h - Rigid body solver supporting convex and concave triangle meshes based on Sequential Impulses (aka Projected Gauss-Sidel).
- yocto_cmd.h - Utilities for writing command line applications. Includes in particular a command line parsing library that support options and arguments of ints, floats, strings, enums.
- yocto_glu.h - Quick and dirty rendering of images and shapes in OpenGL, useful to create interactive viewers.
- yocto_math.h - A few vector math routines used to implement Yocto/GL libraries.
All documentation is included in each library file in plain ASCII. If desired, runs doxygen
in the root directory to get html formatted documentation.
This repository contains Yocto/GL applications written to test the libraries.
- yobj2gltf.cpp: Converts Wavefront OBJ to glTF 1.1.
- ytestgen.cpp: Creates various test cases for the path tracer and GL viewer.
- yimview.cpp: HDR/PNG/JPG image viewer with exposure/gamma tone mapping.
- yshade.cpp: Simple OpenGL viewer.
- yitrace.cpp: Interactive path-tracer.
- ytrace.cpp: Offline path-tracer.
- yisym.cpp: Interactive rigid body demo code.
- ysym.cpp: Offline rigid body demo.
A few screenshots from ytrace are included here for demonstration.
A screenshotted movie from ysym is included here for demonstration.
Yocto/GL was originally written in C99. That version is at commit 55e2328476647fccae8eee1649f961984751ad96 in this repository for reference. We moved to C++ since the lack of operator overloading made some math code really unreadable, defeating one of the main tenants of Yocto/GL.
- Doxygen documentation
- Internal speedup using raw pointers
- Khronos glTF support
- Modern C++ API
- Using references to avoid pointer chasing and memory management
- OBJ loading conforms better to raw file format
- significantly reduce code length, but maintaining same features
- Moving to C++
- Removed old C API
- Use STL containers by default
- Switched
- Moved to C++ internals and common math library.
- Rigid body solver.
- Initial release.
Yocto/GL libraries are released under the permissive MIT license, while the example apps are released under the 2-clause BSD (to include warranty for binary distribution).