Cell Shading

Discuss whatever you want here--both QB and non-QB related. Anything from the DEF INT command to the meaning of life!

Moderators: Pete, Mods

Post Reply
User avatar
Zamaster
Veteran
Posts: 174
Joined: Wed Jun 15, 2005 1:51 pm
Contact:

Cell Shading

Post by Zamaster » Sat Mar 04, 2006 10:26 pm

What exactly is cell shading? I know what it looks like, but what exactly IS it?
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN

User avatar
rdc
Coder
Posts: 22
Joined: Wed Jan 25, 2006 9:23 am
Location: Texas, USA
Contact:

Post by rdc » Sat Mar 04, 2006 10:48 pm

Really Dysfunctional Coder

User avatar
Zamaster
Veteran
Posts: 174
Joined: Wed Jun 15, 2005 1:51 pm
Contact:

Post by Zamaster » Sun Mar 05, 2006 12:49 pm

Thanks but I said I know what it looks like. Im just curious to know what you're actually doing to the 3D model. Im not looking for the formula or anything. I know about Cartoon chading which is something like modifying the light properties of an object such as specular and diffuse. Im just wondering why cell shaing requires alot of "processor power" when you can aquire the same effects with simpelr methods. What exactly goes on in "cell shading" that makes it so fancy shmancy.
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN

User avatar
Pete
Site Admin
Posts: 882
Joined: Sun Dec 07, 2003 9:10 pm
Location: Candor, NY
Contact:

Post by Pete » Sun Mar 05, 2006 2:44 pm

Cell shading makes 3D models look like they are hand-drawn cartoons by drawing thick black lines around the edges of the model, and putting very simple two-shade shadows on models (like the ones they use in cartoon shadows).

Jet Grind Radio for Dreamcast was the first game to use it... you can see a lot of screenshots here:
http://media.dreamcast.ign.com/media/01 ... mgs_1.html

Check out this before/after picture of the main character from Jet Grind Radio:

Image

Image



Some other good examples are:
Zelda: The Wind Waker (Gamecube)
Auto Modellista (a racing game for PS2)
XIII (first person shooter for PS2)
Viewtiful Joe (fighting/action game for Gamecube / PS2)

Image

Image

User avatar
The Awakened
Veteran
Posts: 144
Joined: Sun Aug 07, 2005 1:51 am

Post by The Awakened » Sun Mar 05, 2006 5:40 pm

All it looks like you do is check whether each colour in the original model is above or below a certain colour intensity. Let's take the above guy from Jet Grind Radio. His shirt is yellow. If the yellow is above a certain intensity, the cel shaded version is the brighter yellow, and if the yellow is below a certain intensity, it's shaded the darker colour. That can probably be done in one pass as you calculate the light intensity.

Then you have to draw the black lines, which doesn't exactly seem to be easy.

Ask Syn9. He's doing one of his Zero-G games with cel-shading.
"Sorry for beating you up with a baseball bat Julian, but I DID think that you were a samsquanch."

User avatar
Zamaster
Veteran
Posts: 174
Joined: Wed Jun 15, 2005 1:51 pm
Contact:

Post by Zamaster » Sun Mar 05, 2006 6:04 pm

I know how the outline is done. A second object is created, slightly larger than the first. It is linked to the original object and uses reverse culling. So you see the inside and not the outside. This creates an outline of the chraracter which moves with it.
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN

syn9
Coder
Posts: 24
Joined: Wed Feb 22, 2006 6:16 pm

Post by syn9 » Mon Mar 06, 2006 7:21 pm

correction, i'm not using cell shading >) i'm not sure how anyone got that impression. it might just look like that because of how high contrast the colors come out

Image

there is a tutorial on creating a cell shading effect on NeHe at

http://nehe.gamedev.net/data/lessons/le ... ?lesson=37

I've never tried to reproduce the effect though so i cannot vouch for the quality of the tutorial

edit:
i saw the note about zgtr being cel shaded in qb express #18, i'll email pete about that.

User avatar
The Awakened
Veteran
Posts: 144
Joined: Sun Aug 07, 2005 1:51 am

Post by The Awakened » Wed Mar 08, 2006 9:11 pm

My mistake. :) I only saw the screenshots in passing.
"Sorry for beating you up with a baseball bat Julian, but I DID think that you were a samsquanch."

Post Reply