fearlessd / pt

A path tracer written in Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pt: a golang path tracer

Build Status GoDoc

This is a CPU-only, unidirectional path tracing engine written in Go. It has lots of features and a simple API.

Examples


Features

  • Supports OBJ and STL
  • Supports textures, bump maps and normal maps
  • Supports raymarching of signed distance fields
  • Supports volume rendering from image slices
  • Supports various material properties
  • Supports configurable depth of field
  • Supports iterative rendering
  • Uses k-d trees to accelerate ray intersection tests
  • Uses all CPU cores in parallel
  • 100% pure Go with no dependencies besides the standard library

Installation

go get -u github.com/fogleman/pt/pt

Examples

The are lots of examples to learn from! To try them, just run, e.g.

cd go/src/github.com/fogleman/pt
go run examples/gopher.go

Optional Embree Acceleration

You can optionally utilize Intel's Embree ray tracing kernels to accelerate triangle mesh intersections. First, install embree on your system: http://embree.github.io/ Then get the go-embree wrapper and checkout the embree branch of pt.

git checkout embree
go get -u github.com/fogleman/go-embree

Links

Here are some resources that I have found useful.

Samples

Go

Dragon

Cornell

Lucy

SDF

Spheres

Suzanne

Molecule

About

A path tracer written in Go.

License:MIT License


Languages

Language:Go 100.0%