[ Nomad Programming, Graphics, and Algorithms Tutorial ] [ Part 02 - HOW CEL-SHADING WORKS ] [ http://developer.nomadph.com ] <<------------------------------------------------------>> [ DISCLAIMER ] I will hold no responsibility to whatever happens to you, your computer, your sanity, your pet, or whatever that may happen to your existence for your reading the texts given in each tutorial. So in short, read at your own risk!
[ INTRODUCTION ] This tutorial shall teach you how cel-shading works (its algorithm) and how to make it work in your project. I shall be discussing the popular 1-dimensional texture method of cel-shading. Some of you might be asking why another cel-shading tutorial when there are already others in the Internet. Well, my tutorials are also my notes since I currently do this graphics programming stuffs in my spare time. Hey, at least I am sharing my notes in a tutorial manner. :) SideNote: You should know at least what a dot product, cross product, and normal is to continue... oh alright, I'll add some brief explanation of what they are later...:) [ TUTORIAL ] First of all..what is cel-shading? You probably know it already, which is why you are reading this. But just the same, I'll tell you because that's the kind of tutorial this is... Well, my definition for it is that cel-shading is the process of churning out cartoon-like renderings. (Alright, so my definition is not original, not my fault if it could not be made any simpler...:) ). A "cel" is this plastic thing (a clear sheet of acetate or nitrate paper) that artists paints on (by hand, of course). It is usual for a cartoon to use thousands of these "cel"s. Now, if you try to notice how many cartoons are drawn , you will instantaneously notice that they all have something in common: they have sudden changes in color. Yes my friends, the cartoons we grew up in and loved, doesn't have many shades of color in them. Shocking, isn't it? Ok, so maybe not so shocking. Let us move along... Anyway, depending on the cartoon, you will also notice that they have basic lighting done on the characters (ie, some parts of the characters are dark, while other parts are light). Most television cartoons usually do not have the basic lighting on them -- they usually reserve them for their movie versions, I guess. So how to make it work in your program and-slash-or game? Well, first is the required one-dimensional texture. Just open up any paint program with a height of one pixel and any length. Let us assume you have a 16x1 pixel texture like so: AAAoooooCCCCCCCC Where all the 'A's are black pixels, all the 'o's are gray pixels, and all the 'C's are white sharks...no wait...I mean all the 'C's are white pixels...(I got you there, didn't I? harhar :) ) Next is to have a dot product function as well as a function to compute a normal vector. Now this cel-shading thing is really stra So what use is this chatting through telnet? What's the whole point of this tutorial? Well, if you know sockets programming, by now you'll know how to start creating a simple IRC client application. You just create a socket connection to the server, then send string messages to the server and respond accordingly to its responses! :) Oh yeah, more commands can be found at: http://www.irchelp.org/irchelp/rfc/chapter4.html Just follow it and you'll be an expert on it in no time! :) That's it! Hope you enjoyed this tutorial! [ ENDING ] And that's that! Not hard eh? If there is anything that's not clear to you, your mind, or to that part of you that lets you comprehend the things here, you may email me at: willietang@yahoo.com Now this ends my second miscellaneous tutorial. I hope you find the information here useful. <<------------------------------------------------------>> [ Written By: Willie Tang ] [ Written On: 0?.??.2005 ]