Yocto/GL is a collection of single-file libraries, or single .h/.cpp pairs, for building physically-based graphics applications. Yocto/GL is written in C++14, with compilation supported also on C++11, and compiles on OSX (clang/gcc), Linux (gcc) and Windows (MSVC 2017). You can use Yocto/GL as either header-only libraries, for simplicity, or .h/.cpp pairs, to reduce code bloat and compile time.
- yocto_obj (.h/.cpp) - 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.
- yocto_gltf (.h/.cpp) - Khronos glTF loader and writer automatically generated by the spec. Supports all glTF format including Khronos extensions.
- yocto_bvh (.h/.cpp) - Ray casting and closet point queries of points, lines and triangles accelerated by a two-level bounding volume hierarchy.
- yocto_trace (.h/.cpp) - 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. Implementation depends on
yocto_math.h
. - yocto_sym (.h/.cpp) - Rigid body solver supporting convex and concave triangle meshes based on Sequential Impulses (aka Projected Gauss-Sidel).
- yocto_math (.h only) - Vector and matrix math, shape and image manipulation.
- yocto_utils (.h/.cpp) - Utilities for writing applications. Includes command line parsing, logging, thread pools, string and path msanipulation.
- yocto_glu (.h/.cpp) - Quick and dirty rendering of images and shapes in OpenGL, useful to create interactive viewers.
- yocto_gui (.h/.cpp) - A wrapper for GLFW and ImGui for window management and immediate mode widgets.
- yocto_img (.h/.cpp) - A wrapper for single-file libraries for image loading and saving.
All documentation is included in each library file in plain ASCII and formatted as Markdown and HTML in the doc/
folder.
This repository contains Yocto/GL applications written to test the libraries.
- yview.cpp: Simple OpenGL viewer.
- ytrace.cpp: Interactive/Offline path-tracer.
- ysym.cpp: Interactive/Offline rigid body demo.
- 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.
- yimproc.cpp: Offline image manipulation.
A few screenshots from ytrace are included here for demonstration.
A screenshotted movie from ysym is included here for demonstration.
This repository contains tools used for code generation and documentation extraction.
- ygltfgen.cpp: glTF parsing code generation.
- ydocgen.cpp: Documentation generation.
You can build the non-interactive example apps using cmake with
mkdir cmake
cd cmake
cmake ..
make -j4 # linux/OSX
msbuild # Windows
The interactive apps use OpenGL, GLFW and GLEW. We include binaries for Windows, but you have to install the libraries youself on Linux (we use apt-get
) and OSX (we use homebrew). If these libraries and not available you can compile without interactive viewer support with
cmake -DYOCTO_NO_OPENGL=ON ..
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).