LGhassen / basic_pathtracer

A basic GPU pathtracer in unity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

basic_pathtracer

An unbiased Monte Carlo pathtracer running on the GPU in unity. Inspired by smallpt, done as a learning project.

All scene rendering is done in a shader, renderer is very fast compared to similar CPU pathtracers.

Rendering can be sped up by activating explicit light sampling in cases where the light source is small.

Supports supersampling.

Camera can be rotated by holding down the right mouse button and panning.

Can render spheres and boxes.

You can run the WebGL version here: http://lghassen.github.io/pathtracer.html

The following scenes are rendered in between 20-40 seconds on a GTX 1060 3GB:

Notes

-Arbitrary box rotation is not implemented because the code used only handles axis-aligned bounding-boxes (can be added to the existing code by multiplying the rayDir with the box rotation matrix).

-Explicit light sampling was partially implemented, currently not implemented for box light sources. May affect scene look.

About

A basic GPU pathtracer in unity

License:Other


Languages

Language:GLSL 46.1%Language:C# 37.9%Language:HLSL 16.0%