QUICK! Need shading advice!

Started by
14 comments, last by TheKrust 16 years, 9 months ago
Ok, does anyone know how to implement cell shading in a 2D eviroment using directX? I know there is the "color rounding" method, but no one seems to give me a straight answer. It seems like an odd question, but I really need to know. Involves a 2D dynamic lighting engine that needs to look more cartoonish.
---------------------------------------- There's a steering wheel in my pants and it's drivin me nuts
Advertisement
A more controllable (and thus more commonly used) method of achieving the color quantization required of cel shading is to use a 1D texture containing the various shades you want to have, or to modulate with, and use a simple lighting coefficient (such as the diffuse term, n-dot-l, as a texture lookup).
I see what you are saying, but doesn't that call for multiple polygons?
---------------------------------------- There's a steering wheel in my pants and it's drivin me nuts
No, the technique doesn't require any more triangles than rendering the model normally.
Ok, thanks, but I did find another way of rendering this look that is a little less complicated (and perhaps less CPU expensive).

But all the tutorials I've seen for cell shading involve 3d lighting to be involved. I have found that 3d lighting doesn't mesh well with 2D polygons that don't have a Z buffer. Were you implying this or is it really possible to have 2d shading with no 3D light source (or just any DirectX default lighting function)
---------------------------------------- There's a steering wheel in my pants and it's drivin me nuts
A major part of the 3d cel shading effect is the way shadows and highlights appear. Without the 3d models and lighting there is no way to determine where the shadows would be.
my point exactly...
---------------------------------------- There's a steering wheel in my pants and it's drivin me nuts
Quote:
Were you implying this or is it really possible to have 2d shading with no 3D light source (or just any DirectX default lighting function)


It is very possible; however, it involves selecting a "fake" fixed source of the light, pretending the 2D objects are embedded in 3D space, or specially baking lighting information into the 2D data. It requires some clever experimentation, largely with your art assets, but it is certainly doable.

It's just not as straightforward.
lol, I just can't say I'm THAT clever.

Not even to mention that I did some research and apparently cell shadig is a whole lot harder on the Graphics card than I thought. Turns out that in games that use cell shading (XIII for instance), end up stuck with a rediculously low poly-count. Although the shading does tend to smooth it out.
---------------------------------------- There's a steering wheel in my pants and it's drivin me nuts
It shouldn't be too difficult, you're taking the standard NdotL (typically), and using it as a texture coordinate for a 1D shading texture. Regardless of polygon count, it's really the surface normals that affect how smooth the result looks. If you add standard bump mapping to this, as well, then you cna potentially get even better shading then just using the vertex normals.

This topic is closed to new replies.

Advertisement