Vertex is a work-in-progress raytracer writen in go.
You have probably reached this place by accident : do not expect great code quality, I write this thing in order to learn the language.
Pretty much all the current features are here : random dynamic textures on spheres, lights with specular highlights, reflection, soft shadows, anti-aliasing, exposure and gamma correction.
The first versions were quick to generate (1-3 seconds), but throwing a lot of rays for the softshadows and reflection, along with the blinn-phong specular highlight computation starts to slow things down. This picture took 1mn 57 to generate.
This is normal since the time complexity of the raytracing is a linear function of the number of rays. When you send 16 more ray, for soft shadows, the algorithm is 16 times slower.
Evolution of the project :
The current image status can be seen in the out directory.
- introduce basic algorithm
- introduce simple lighting
- add shadows
- add reflection
- command line parameters
- Other intersections
- Transformations (rotation translation scaling)
- Lambert shading
- Blinn phong for specular highlights (pretty costly)
- Gamma correction
- [ ]should be configurable (toggle yes/no)
- Exposure correction
- should be configurable (cli options or configuration file)
- add possibility to choose between the different exposure methods
- Texture mapping
- File image
- Cool generated textures
- Perlin noise
- Bump mapping
- Displacement mapping
- Space partitionning
- load scene from file (simple json ?)
- Add save to PPM file format
- Depth of field
- Soft shadows
- Better antialiasing (adaptative, poisson disk-based random sampling ?)
- Metaballs. Just because metaballs
Go further, to infinity and beyond !
Run the scene
In order to generate the raytraced scene with 3x3 antialiasing, reflection with 2 level with output in raytrace.png, run :
./Vertex -as=3 -depth=2 -output="raytrace.png"
For other parameters, get help with :
The gif is generated thanks to the bash file generategif.sh