Programming assignment 1 INF359
I have 3 shaders that are working, cartoon, cool to warm and simple contours.
Cartoon shading have been implemented by changing the diffuses light.
The diffuse light from the dot-product between the light and normal
vectors define which of 3 values I set diffuse light to,
diffuse light > .8 are set to 0.8
diffuse light between .8 and .2 are set to 0.6
diffuse light below .2 are set to 0.4
Cool to warm shading is the easiest one, I used equation 2 from
gooch_npr_lighting_model paper, and set diffuse lighting to 1.0.
Simple Contours are if the dot product between lightvector and normal
are equal to zero or close to it. I have a slider for selecting limit
for contours, range from 0 to 0.5. The model can be set to white, or
one can keep the color from the color range (from environments)
The fourth selection under shader is not finished.
Its possible to lock the light in relation to the model, so that
lightvector are set to (-1, -1, 0), by using the variable LockLight
Cartoon shading with lightvector (-1, -1, 0)
Cartoon shading where lightvector is the same as viewvector
Cool to warm shading where lightvector is the same as viewvector
Cool to warm shading with lightvector (-1, -1, 0)
Contour where dotproduct <= 0.0 are black
Contour where dotproduct <= 0.1 are black
Contour where dotproduct <= 0.306 are black