C++ | Empirical raytracer

Yesterday, I decided add a windowed output to a a very basic raytracer I started to write 2 years ago. I wanted to figure out how a renderer is built inside. It comes with the following features :

  • unlimited pointlights
  • load/save alias|wavefront mesh file
  • load/save tga files
  • un-efficient antialiasing, variable sampling rate
  • no space partitionning strategy (hence VERY slow)
  • bitmap manipulation(copy, box blur…)
  • mesh manipulation(translate, scale, autofit…)
  • Render window using SDL

Here’s a row output of that thing. Text stream …

Rrenderer::Rrenderer(512, 512) Rmesh::loadFileWavefront() found 861 points, 1674 triangles Rrenderer::loadFiles(), loaded 1 file(s) Rrenderer::computeNormals(), 1 mesh(es) Rrenderer::computeBoundingBoxes(), 1 mesh(es) Rrenderer::fitScene(0.750000), scale scene by (0.806781) Rrenderer::computeBoundingBoxes(), 1 mesh(es) Rrenderer::renderScene(), rendering ... line 511 Rrenderer::renderScene(), 8794 ray/polygon hit, 11520044 ray Rrenderer::renderScene(), ray casting accuracy : 0.076337 %

… and bitmap.

Things to implement, as soon as possible : a decent adaptative AA, shadow casting, a BSP, gouraud shading.
Get a snapshot here.

One thought on “C++ | Empirical raytracer”

Leave a Reply to Ninomojo Cancel reply

Your email address will not be published. Required fields are marked *