The basic idea of this shader is to determine how perpendicular the surface of an object is compared to the viewing angle and return black instead of the regular color if some threshold is passed. That is exactly what line 8 does in the code below.
shader outline( color Color = 1, float Angle = 50, output color Cout = 0 ) { float angle = cos(radians(Angle)); if(abs(dot(-I,N)) > angle) Cout = Color; }
No comments:
Post a Comment