Skip to content
Mallie, bootstrap for your own ray tracer.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
compat
deps
extlibs/windows/SDL2-2.0.3
importers
scripts
test/cctest
tools
.clang-format
.gitignore
LICENSES.3rdpaty.txt
README-SDL.txt
README.md
SDL2.dll
TODO.txt
bsdf.h
bvh_accel.cc
bvh_accel.h
camera.cc
camera.h
common.h
config.json
cornellbox_suzanne.eson
cornellbox_suzanne.material.json
cornellbox_suzanne.mtl
cornellbox_suzanne.obj
duktape.c
duktape.h
fabfile.py
filepath_util.cc
filepath_util.h
format_source.sh
happyhttp.cpp
happyhttp.h
hashgrid.h
hashgrid.hxx
intersection.h
jpge.cc
jpge.h
light.cc
light.h
log.cc
log.h
main.cc
main_console.cc
main_console.h
main_sdl.cc
main_sdl.h
mallie.jpg
material.h
math.hxx
matrix.cc
matrix.h
mesh.h
miniexr.cpp
mmm_io.cc
mmm_io.h
pbrt.h
premake4-test.lua
premake4.lua
prim-plane.cc
prim-plane.h
render.cc
render.h
scene.cc
scene.h
script_engine.cc
script_engine.h
spectrum.cc
spectrum.h
switch_gcc48.sh
tasksys.cc
teapot.mtl
teapot.obj
test_atomic.cc
texture.cc
texture.h
timerutil.h
tinyexr.cc
tinyexr.h
trackball.cc
trackball.h
vcbuild.bat
vcm.cc
vector3.h
version.h

README.md

Mallie ray tracer

https://lighttransport.github.io/mallie

Example

Mallie is bootstrap for ray tracing study and research. Its already used in some ray tracing research. You can easily extend/implement ray tracing algorithm. Mallie is written in portable C/C++ and depends on few third party libraries.

Features

  • Binned SAH BVH builder(robust and works well up to 10M triangles).
  • Intel's Embree support for fast ray tracing.
    • 2 ~ 3 times faster than reference implementation of mallie's Binned SAH BVH.
  • wavefront .obj loader(tinyobjloader)
  • MagicaVoxel .vox loader
  • Very simple path tracer example.
  • Portable C++(at least it should be compiled with gcc/clang/VisualStudio, and run on MacOSX/Linux/Windows, x86/ARM)
  • JSON configuration and JavaScript script engine(duktape)
  • OpenEXR loader(tinyexr)
  • OpenEXR writer(miniexr)

Building

Requirements

  • C++ compiler
  • GCC (If you want OpenMP support)
  • SDL2.0(optional)
  • ptex(optional)
  • Embree raytracing kernel(optional)

Setup

Download embree and put it into deps directory(optional)

Build ptex(optional)

$ cd deps/ptex-master
$ make

Build SDL2(optional)

# linux
$ ./scripts/build_deplibs_linux.sh

# MacOSX
$ ./scripts/build_deplibs_macosx.sh

MacOSX

Edit scripts/setup_macosx.sh, then,

$ ./scripts/setup_macosx.sh
$ export CC=gcc48 # optional
$ export CXX=g++48 # optional
$ make

Linux

Edit scripts/setup_linux.sh, then,

$ ./scripts/setup_linux.sh
$ export CC=gcc48 # optional
$ export CXX=g++48 # optional
$ make

Windows

Edit vcbuild.bat, then,

> vcbuild.bat

Solition file will be generated. Tested on VS2013.

Bootstrap options for premake4

--with-sdl        : Enable SDL(GUI)
--with-openmp     : Enable OpenMP
--with-embree     : Enable Embree

Usage

Edit config.json, then

$ ./bin/mallie

GUI mode

  • mouse left : rotate
  • shift + mouse left : translate
  • ctrl(or tab) + mouse left : dolly
  • 'q' : quit.
  • 'c' : Dump camera data to camera.dat (eye, lookat, up, quaternion)
  • 's' : Save framebuffer as .exr image.

Quick start to hacking

See render.cc::Render().

Author(s)

  • Light Transport Entertainment, Inc.

License

Mallie is licensed under 3-clause BSD. See LICENSES.3rdpaty.txt for components used in Mallie.

EoL.

You can’t perform that action at this time.