Now, I will show the implementation of reflection (from the Whitted approach). It is basically using the reflection law and recurse the ray cast.
Each object can reflect a ray more or less from a different object. A mirror would reflect the light totally, and a matte object would reflect nothing. Each new reflection is a new ray tracing call, so it can be costly. The number of recursion levels will be fixed, even if an object reflects nothing: this will be implemented through shaders in the future.
Continue reading Interactive Raytracer 4: Reflection rays
Python can be used for many things, and is mainly known for the shell scripts people wrote. Shai Vangast proposes using the langage for data analysis and visualization.
Continue reading Book review: Beginning Python Visualization: Crafting Visual Transformation Scripts
After reviewing Parallel Studio, I’ve decided to look after Advisor Lite. Intel offers it for free, before the actual Advisor is released with a future Parallel Studio version. It aims at steering multithreaded development with Parallel Studio.
Continue reading Parallel Studio: Using Advisor Lite
This is a book I wanted to read a long time ago. RTS is a game genre I particularly appreciate, but I never got to the point of starting writting one. Perhaps with this book, I will…
Continue reading Book Review: Programming An RTS Game With Direct3D
Adding the lights is the first step toward a Whitted raytracer. For each ray that hits an object, several rays can be cast, reflection, refraction and shadow. The last one is the one created with lights.
Lights and shadow rays
Without light, objects are bland, seem to have no depth, … Light on a scene can be cast by several light sources. When a ray of the camera hits an object, the intersection point can be illuminated by one or several of those sources. Each of them contributes to the color of the object. If the light source direction is parallel with the normal of the object at the intersection point, the contribution will be maximum. If it is orthogonal, the contribution will be zero. The scalar product is the tool used to compute this quantity.
Continue reading Interactive Raytracer 3: Lights and shadows
C++ code quality is a difficult topic. There are some basic topics and other, more advanced. Sutter and Alexandrescu wrote a complete book on C++ standards to achieve good quality with basic and advanced topics, but Meyers wrote a book before, on the basics of C++.
Effective C++ is at its third edition, which is a complete rewrite with topics from the “old” Effective C++ and More Effective C++. So if you have one or the other, you will find yourself with additional content.
Continue reading Book review: Effective C++: 55 Specific Ways to Improve Your Programs and Designs