Jump to content
  • Advertisement
Sign in to follow this  
TheKrust

QUICK! Need shading advice!

This topic is 4130 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
No, the technique doesn't require any more triangles than rendering the model normally.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!