Unknown's avatar

3rd Raytracer (part 2)

Image

Now I have most of the features I wanted, at least in very early stages.  There is much to do still, however the basics are in place and I’m very happy with my initial renders.  Still on the to-do list:

  • Loading of .3ds or .obj models
  • Transparency
  • Caustics and Specular Highlights
  • Reverse path tracing?
  • KD tree / sphere tree acceleration structure
  • 3D noise fun
Unknown's avatar

3rd Raytracer

So after spending some time writing the core of the ray tracer again here is one of the first renders with multiple bounces of light.  It took 4 mins to render at 2048×2048 with 32 rays per pixel, each taking 3 bounces along the way.

Aside from simplifying the light transport calculations, I have also written a camera class, which can now project rays into the world from arbitrary positions.  One thing I still want to do is abstract the code to handle material interaction, since I don’t want to hard code this.

 

Image

Unknown's avatar

Offline Raytracer Day 3 (part 1)

Image

Update:

  • Here we see 2 bounces of indirect light
  • Procedural checkerboard texture
  • Found ways to speed up the rendering quite a lot

Now that I have gotten to this point, I have identified some weaknesses in my original design for this ray tracer.  Originally I was casting a perhaps 4 or so rays from the camera per pixel and when these hit a surface they cast perhaps 32 sub rays from that point.  This is actually fairly shit, and makes the rendering times horribly slow.  All of these values were tweak able, but I have since found that sending out 256 rays from the camera, and having each one bounce only once randomly with each hit, is a much better solution, leading to more uniform noise, faster render times, free anti-aliasing, etc.

I now plan to write a ray tracer that corrects my previous design, which should in turn simplify the code immensely. I also want to try some backwards path tracing, from the light to the camera, instead of the other way around.

Additional, control of the camera was very tricky, and basically impossible to move.  I have to remedy this and create a freely positionable camera.

Will post results here soon…

Unknown's avatar

Offline Raytracer Day 2 (part 2)

Image

Just implemented some cool upgrades.

  • Radiosity via recursive ray tracing
  • Coloured surfaces

The downside is that this is slow…. really slow…

It really means that I will have to make use of multi-core threading on the CPU very soon.

I also want to implement reflective mirrored surfaces, so I can hope to see some caustics on the ground.