Skip to content

homfarnam/gouraud-shader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Acknowledgments

Henri Gouraud for finding the algorithm! and Dr. Pourbenyamin for helping me fix the algorithm.

About

A basic Gouraud Shader for fun

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 99.0%
  • Makefile 1.0%