Cartoon Shading Course: Game Programming
This is a project for the course: Game Programming. A program that can read .3ds models and present real-time cartoon shading is developed. Vertex and fragments shaders are programmed in Cg (C for graphics) to utilize the power of gpu computing.
The contour is gained by applying a sobel operator to the normal texture of the model.
In cartoon shading, the result of lighting is not continuous, thus the effect of cartoon shading can be achieved using a piecewise function that maps continuous values from 0 to 1 to discontinuous values.