This is a basic Gouraud Shader based on Henri Gouraud's original paper; "Continues Shading of Curvad Surfaces". It only does it on one surface in a 2D environment as a hobby project, I'm going to write a full global illuminiation ray tracer and the right implementation will be there.
This is the normal shader. Both of the bottom sides are black and therefore the top color gates faded through the edges:
This is if you change the volume_a
and volume_b
in the combine_colors function and set pure red, green and blue as light sources:
You must have LLVM or GCC on your system with support of C++11 at least. Also you must make sure you have OpenGL and GLUT installed on your system. GNU Make is also needed. Then you can simply run:
% make run