In the last post, we added the last feature of the series – defocus blur or depth of field. In this final post of the series, we’ll render a random scene that fully demonstrates the features of our ray tracer. The Masterpiece Behold! A randomly generated scene of spheres with a variety of sizes and […]
In the last post, we added the ability to position our camera. This time we’ll add code for focus, or rather the ability to blur objects that are not in focus. Here we go In order to handle “depth of field”, we need to pass two more parameters into our Camera constructor: aperture – the […]
In the previous post, we rendered a glass sphere. In this part, we venture into the world of camera positions. Simple Code We added several key parameters to our Camera struct to manage positions: look_from – the point from which the camera looks. look_at – the point the camera is pointing towards. vert_up – the […]
In the previous post, we implemented a trait called Material which we used to render metallic spheres. This time, we’ll create a new struct called Dielectrics which implements the Material trait and renders glass spheres. Fairly Straightforward…Sort Of Nothing too tricky with this concept, we just had to implement a refract() function as opposed to […]
In the previous part, we covered diffuse materials and lighting for our spheres. Now we take it a step further by adding a metallic look. Traits and Reference Counting Pointers I’m starting to get more comfy with inheritance and shared pointers in Rust. Using a trait called Material, a struct can be created that implements […]
In Part 7, we smoothed out the edges of our spheres using antialiasing. In this chapter, we start making these spheres look a little more realistic. Speed Bump After adding initial diffuse properties to the spheres I noticed a severe slowdown in execution time. I mean we’re talking over 5 minutes to complete the render […]
In Part 6, we drew two spheres on the screen, but the edges of the images were rough and jagged. In this part, we’ll smooth out the edges with some antialiasing. Zoom In It might be hard to notice the jagged edges from the image we rendered in Part 6, so let’s zoom in and […]
Last time we added some dimension to a sphere. In this go around, we’ll add support for multiple spheres and lay the groundwork for supporting glass spheres. A Bigger World So far our one-sphere world is boring. In order to spice things up, we need a way to draw multiple spheres. In order to do […]
In Part 4 we drew a sphere. This time we’re giving the sphere surface normals. Normals are things like shading and lighting that make the object look more three-dimensional. Bug in a Hay Stack This one was a doozy! After I whizzed through coding everything in this chapter, I realized in my haste I had […]
In the last post, we drew a blue and white blended rectangle. In this post, we’re continuing our focus on foundational steps by adding a sphere to that rectangle. A Sphere! Admittedly, it sort of resembles the flag of Japan, but it’s actually great progress. Drawing a single object with our ray tracer demonstrates how […]