NanoRT, single header only modern ray tracing kernel.
NanoRT, single header only modern ray tracing kernel.
Path tracing example contributed by https://github.com/daseyb
NanoRT is simple single header only ray tracing kernel.
c89 branch https://github.com/lighttransport/nanort/tree/c89NanoRT is a linear array and does not have pointers, thus it is suited for GPU raytracing (GPU ray traversal).nanort::Ray represents ray. The origin org, the direction dir (not necessarily normalized), the minimum hit distance min_t(usually 0.0) and the maximum hit distance max_t (usually too far, e.g. 1.0e+30) must be filled before shooting ray.
nanort::BVHAccel builds BVH data structure from geometry, and provides the function to find intersection point for a given ray.
nanort::BVHBuildOptions specifies parameters for BVH build. Usually default parameters should work well.
nanort::BVHTraceOptions specifies ray traverse/intersection options.
…Application must prepare geometric information and store it in linear array.
For a builtin Triangle intersector,
vertices : The array of triangle vertices (e.g. xyz * numVertices)faces : The array of triangle face indices (3 * numFaces)stride : Byte stride of each vertex dataare required attributes.
…NANORT_USE_CPP11_FEATURE : Enable C++11 feature
NANORT_ENABLE_PARALLEL_BUILD : Enable parallel BVH build(OpenMP version is not yet fully tested).See examples directory for example renderer using NanoRT.
Here is an example of custom geometry.
examples/particle_primitive/examples/curves_primitive/examples/cylinder_primitive/And plesae see API at wiki: https://github.com/lighttransport/nanort/wiki/API
nanort.h is licensed under MIT license.
NanoRT uses stack_container.h which is licensed under:
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.NanoRT examples use some external third party libraries. Licenses for such third party libraries obey their own license.
Lucy statue model is from The Stanford 3D Scanning Repository http://graphics.stanford.edu/data/3Dscanrep/
PR are always welcome!
No open issues yet, or sync has not completed.