Skip to content

Simple raytracer written in haskell as a study project

Notifications You must be signed in to change notification settings

TheBlek/haskell-raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This project has been completed as an university assignment. Largely inspired by Ray Tracing in One Weekend

This raytracer implementation supports spheres of different materials:

  • Rugged
  • Metallic, with different roughness
  • Glass, with different transparency values

All with supporting different colours. Output image is saved in .ppm format for easiness.

Sadly, all configuration is done is code, so for tweaking see Run section

Also, we have done a multithreaded version with some additional performance tweaks at multithread branch. Also, we documented the process of multithreading in russian here.

Examples

Final render

Run

You should be able to run the project using

cabal run -O2

But you know, dependency hell and all that. Resulting image will be in output.ppm. All configuration can be done in src/Main.hs:

  • Output file resolution
  • Number of ray casts per pixel
  • Maximum bounces per ray
  • Scene configuration (this one is more involved as you can imagine)

About

Simple raytracer written in haskell as a study project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published