ConclusionThat's all! The most extensive article on cel-shading, available only on GameDev.net (just advertising the site in case this article ever gets archived on another site). If you have any problems with the article, just post to the thread attached to this article, because after my last attempt at an article I was flooded with e-mails, and I want my inbox free of questions like "What's the dot product?" and "Can you send me some source code?". I hope the information in this article has been beneficial. Special Thanks:
Further ReadingI've gathered a couple of links that might be useful to you (i.e. they include source code). One of them is for DirectX 8 and uses Vertex Shaders, and the other is for OpenGL and uses the "proper" technique (the DX version tends to look a bit odd with certain objects). Please note that none of these include information about cel-shading textures (I had to figure that one out myself). These are the two links that I found the most useful (the OpenGL being more useful than the other). There are probably more references out there (if there isn't then I am very surprised), but these two should help you out dramatically. Appendix A Multiple Light SourcesFor those of you who have way to many CPU cycles to spare, this is a good method of using them up :-). If you look back to when we calculate the Sharp Lighting value for the vertex, you will see that
it has a minimum value of 0 and a maximum value of 1. Now, if we have another light lighting that vertex, you compare the existing lighting value with the newly created one. If the new light value is higher, then replace the existing one with that. If it's darker, then ignore it. That's just another stupidly simple trick that will make your scene look nicer
(despite running at 1fps).
|