Skip to content

datavorous/smol-path-tracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smol path tracer

Code style: black

Started coding during a boring friday lecture in uni, finally finished on a rainy Saturday

foreword

Definition: A path tracer is a type of rendering program or algorithm that generates images by simulating the paths of light rays as they bounce around a scene, capturing realistic lighting, shadows, reflections, and refractions.

Why in Python: I dont know. I wanted to type less words and doze off in between the renders.

Resource: Ray Tracing in One Weekend (Part 1 and Part 2)

The heart of the pathtracer is the ray_color() function inside core.utils.
I've tried to write extensive comments in various places to explain in short. I've implemented Sphere and Quadrilaterals till now, and three material types: Lambertian Diffuse, Metal and a Light Emitting one.

Note

The first 2 photos are so noisy because I had kept sampling = 30, to reduce the rendering time.

Formatted with black.

Git clone, and run main.py. Tune parameters beforehand. The image generated will be of .ppm format.

explanation

Note

Read this if you are having some trouble with understanding how the viewport works.

I don't want to bother myself by typing the same thing again, so just see my scribbles below:

About

a smol path tracer written in python to produce realistic renders (without using any external libs)

Topics

Resources

Stars

Watchers

Forks

Languages