pouyakary / basic-gouraud-shader

A basic Gouraud Shader for fun

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gouraud Shader

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.

Gallery

This is the normal shader. Both of the bottom sides are black and therefore the top color gates faded through the edges:

The original gouraud shader

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:

Building

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

About

A basic Gouraud Shader for fun


Languages

Language:C++ 99.0%Language:Makefile 1.0%