Brandon Eleuterio

Day: September 26, 2022

Learning Rust – Part 10: Dielectrics

Glass Sphere

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 […]

Learning Rust – Part 9: Metal Spheres

Shiny Metal Spheres

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 […]

Back to top