Skip to content

Latest commit

 

History

History

cornell_box

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

cornell-box

This ray tracing example shows area lighting, reflection, refraction, and how to load existing 3D models (the diamond).

By default, it outputs a grainy low-resolution rendering (which takes about a minute):

Low-res rendering

Raising the quality and resolution is as simple as modifying these lines:

MaxDepth:   5,
NumSamples: 400,

and this line:

img := render3d.NewImage(200, 200)

Simply increase MaxDepth to maybe 15, increase NumSamples to 20000, and increase the resolution from 200x200 to whatever you want. Here's an example HD rendering at 500x500:

High-resolution rendering