You can of course choose to return completely black or somewhat grey in the shade, or use colors so that everything in the shade has a blue or red tone. This can be done in many ways, sampling a texture gradient, some logic in the shader etc. If the dot product is larger than X, it is lit (1) if it is below X it is in shade (0) We want to take this and modify it so it does This gives the smooth shadows, because the dot product can take on any value 0 to 1. (change the range of the dot product so it goes from 0 to 1 instead of -1 to 1, usually built in function like "saturate" or "clamp") Light = (normal dot direction of light) * color of light The cel shading is almost always done at the shader stage, before any post processing. I've been researching this on/off the last half year. And most 3d editors have built-in shaders that can be exported with the object to handle cel shading, that you can then fork and tweak if you find the effect underwhelming. What's neat, though, is that you can decide on this on a per-sub-object basis, via material choices. Meanwhile, the vertex shader is going to be way more efficient at working out the camera-facing blobs of color and the shape of their delineations - still, even that's a complex question to get right for the application (do you want a smooth sweep, or do you need to keep sharp angles?) Then you have fancy lineart applications implemented with pixel shaders, like how they achieved a Sumi-e effect in Okami (still technically cel-shaded, but in a particular style). If the pixel shader has access to the camera angle and the pixel's normal, it's capable of deciding on the line art portion with much better accuracy than a vertex shader would. As I found out trying to answer this question (turns out, it's a hard one to answer), it can be both.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |