Skip to content

thbop/pathtracer-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pathtracer-c

Writing another pathtracer in C.

Build Instructions

  • Download the devel-mingw version of SDL3
  • Extract the SDL3 folder containing headers to the include folder
  • Create a /bin directory (in the main directory) and extract SDL3.dll into it
  • Create a /lib directory (also in the main directory) and extract libSDL3.dll.a into it
  • Download the latest release of chelp and extract libchelp.a into the /lib directory (the headers for chelp are already included in this repo)
  • Run make, pathtracer.exe should be generated in the /bin folder

Reports

Chapter 0

In this section, I created a thread which renders pixels to the screen using SDL3.

Chapter 1

In this section, I created a camera and generated rays for each pixel (ray directions represented as colors).

Chapter 2

In this section, I solved for ray-sphere intersection, drawing a flat sphere.

Chapter 3

In this section, I upscaled the render output, flipped the vertical axis right-side-up, and implemented configurable subpixel rays for antialiasing.

Chapter 4

In this section, I started bouncing light.

Chapter 5

In this section, I refactored the intersection tests and material properties into separate classes. Shapes and materials ought to be more extendable.

Chapter 6

Successful render of multiple spheres, though light does not appear to be behaving as expected.

Chapter 7

Fixed some mistaken math and made rays sort objects better. Now it is kind of rendering, though I believe the green sphere should not be that flat.

Chapter 8

Fixed sphere normals and some vec3 random functions. Now things are rendering more correctly.

Chapter 9

Wrote/adapted (from another project) as much code as required to make triangles render. Certainly not the best code. Certainly not a cube.

Chapter 10

Ignoring failures with triangles, here is a cool metal material.

About

Writing another pathtracer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published