Category Archives: C++

Everything related to the use of the C++ language

Thinking of good practices when developing with accelerators

Due to the end of the free lunch, manufacturers started to provide differents processing units and developers started to go parallel. It’s kind of back to the future, as accelerators existed before today (the x87 FPU started as a coprocessor, for instance). If those accelerators were integrated into the CPU, their instruction set were also.

Today’s accelerators are not there yet. The tools are not ready yet (code translators) and usual programming practices may not be adequate. All the ecosystem will evolve, accelerators will change (GPUs are the main trend, but they will be different in a few years), so what you will do today needs to be shaped with these changes in mind. How is it possible to do so? Is it even possible?
Continue reading Thinking of good practices when developing with accelerators

Book review: The Art of Concurrency: A Thread Monkey’s Guide to Writing Parallel Applications

Free lunch is over, it’s time to go concurrent. The Art of Concurrency addresses the need for a workflow to develop concurrent/parallel applications.
Continue reading Book review: The Art of Concurrency: A Thread Monkey’s Guide to Writing Parallel Applications

VST plugin AGain reloaded with a Qt GUI

Years ago, I’ve tried to use the GPL version of Qt, but it couldn’t be done without a Qt Solution that was at the time non-free. Now, Nokia has freed and Qt and the appropriate Qt Solution.

I’ve searched if someone has already used this new version to create a VST plugin. The only blog post I’ve found does not use the Qt Solution and is not perfect. According to the documentation what is missing in this solution is precisely what the Solution should do. So let’s try it.
Continue reading VST plugin AGain reloaded with a Qt GUI

Interactive Raytracer 4: Reflection rays

Now, I will show the implementation of reflection (from the Whitted approach). It is basically using the reflection law and recurse the ray cast.

Reflection rays

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

Parallel Studio: Using Advisor Lite

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

Interactive Raytracer 3: Lights and shadows

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

Book review: Effective C++: 55 Specific Ways to Improve Your Programs and Designs

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

Profiling with Visual Studio Performance Tool

After presenting Valgrind as an emulation profiler, I will present Microsoft solution, Visual Studio Performance Tool. It is available in the Team Suite editions, and offers a sampling- and an instrumentation-based profiler. Of course, it is embedded in Visual Studio IDE and accessible from a solution.
Continue reading Profiling with Visual Studio Performance Tool