Next up are transparency and reflection. In keeping with the them: we get these by first adding more information to the Ray Paths and then writing shaders that leverage this new information. Recall that Ray Paths contain information about how a ray from the camera travels through the scene, currently it just records what it [ ]
Shadows are the first place where ray tracing has an advantage pipelined graphics (OpenGL). Not that shadows in pipelined graphics are impossible, but they can be a bit of a struggle (or at least they have been for me.) But as we ll see: with ray tracing they re actually quite pleasant. We actually already have everything [ ]
Up until now I ve been cheating in creating images (although cheating is really the point of graphics). As we all know there can be no images without light so let s add some. First off we need a few structures to represent our lights: data Light = Point loc :: Vec3f, color :: Color, intensity :: [ ]
Now that we can get intersections from our solids, we re almost ready to start producing some images. We still need two things: first we need a little bit more information about the surrounding world and second we need a way to convert this information to color. For the more information we ll introduce a Ray_Path which [ ]
The first thing we re going to need is some geometry to shoot our rays at: class Solid a where intersect :: Ray - a - Maybe Intersection Basically something is a solid if we can shoot rays at it and possibly get back an Intersection (we may miss and not get back an intersection). An [ ]
The is going to be some of the most used code and it s going to be a hot spot for bugs. A nice thing that Haskell does is make it very easy to define your own infix operators this should help a lot to keep things readable. Here s the code: module Vector Vec3f, Color, + , [ ]
You know those interview questions? The ones where you re supposed to make spurious assumptions and use them to compute something like: How many piano tuners are there in Chicago? The correct term for one of these is a Fermi Problem after Enrico Fermi the physicist, who apparently was spectacularly good at such problems. Legend has [ ]
Exercise from: http://programmingpraxis.com/2009/10/16/growable-arrays/ Our goal here is to implement an array which is capable of dynamically growing as we add elements to it at the cost of logarithmic runtime for put and get functions instead of the constant runtime of standard arrays. The indexing scheme seems a bit weird at first until we notice the [ ]
I was recently forwarded the response of the Netflix Zenmaster himself to my article about him. There were a few charming details I thought I might share with you. Apparently what I published was actually yesterday s story. The Zenmaster has upped his game quite a bit since then. Nowadays content is stored on a 8TB [ ]