Cell Shading

Ask anything your want about the 32X Mushroom programming.

Moderator: BigEvilCorporation

Post Reply
evildragon
Very interested
Posts: 326
Joined: Mon Mar 12, 2007 1:53 am
Contact:

Cell Shading

Post by evildragon » Wed Oct 10, 2007 3:51 am

So, I'm planning out a plot to a video game for the Sega CD/32X (and will be in 3D with a "almost" full 3D world).

What I want to do is make the 32X be the graphics engine, Genny be the core game engine, and the CD being the storage, AND sound engine (via PCM).

But, I want cell shading. Can this be done on the 32X?

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Oct 10, 2007 4:10 pm

You would do shading in the rasterizer. How complex would determine how much it slows the drawing. If you're doing subdivided affine mapping, your best bet would be Gouraud shading - calculate the shading interpolation deltas at the boundaries just the same as you would the texture walking deltas. It's not as accurate, but then neither is subdivided affine texture mapping. The point is to make it CLOSE while keeping the speed up.

My own experiments with subdivided affine mapping on a 320x200 display (on an Amiga to be precise) showed steps of 8 pixels to be the best for speed vs visual accuracy. More pixels per step made it a little faster, but gave really nasty looking results. Fewer pixels looked a little better, but slowed things down too much.

evildragon
Very interested
Posts: 326
Joined: Mon Mar 12, 2007 1:53 am
Contact:

Post by evildragon » Wed Oct 10, 2007 8:38 pm

Ok, I'll pass that information to my friends (whom are doing the coding).

(I'm more of a director for the games plot. The only coding I'm doing is the title screen splash, and intro graphics, which are nothing more than stills, like how Castlevania Drac X on the SNES does for it's intro demo)

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Oct 10, 2007 10:38 pm

They REALLY want to look at Chris Hecker's articles on texture mapping. What he covers is about the limit of what the 32X is capable of. His articles on TM are found here:

http://chrishecker.com/Miscellaneous_Technical_Articles

ob1
Very interested
Posts: 463
Joined: Wed Dec 06, 2006 9:01 am
Location: Aix-en-Provence, France

Post by ob1 » Thu Oct 11, 2007 4:43 am

Ambitious. Really.
I have thought about such a thing one year ago, but without going deeper.
Chilly Willy wrote:... your best bet would be Gouraud shading.
I would have gone for flat shading : a single color by polygon (triangle ?).

@Dragon, your graphics friend can contact me for ASM and parallel optimisations.
Last edited by ob1 on Wed May 28, 2008 9:06 am, edited 1 time in total.

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Thu Oct 11, 2007 5:07 am

It's called 'Cel shading' (aka 'Toon shading'), not 'Cell'. Just read wiki article to understand what you want.. I don't think it's possible for 32x (for realtime in-game graphics).

evildragon
Very interested
Posts: 326
Joined: Mon Mar 12, 2007 1:53 am
Contact:

Post by evildragon » Thu Oct 11, 2007 5:11 am

I'll have her sign up on this site (or she may just use my account, don't know which).

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Oct 11, 2007 4:04 pm

I figured he was talking about lighting as that's what most people mean when they talk about "shading". They want "flat shaded" or "gouraud shaded" or "phong shaded" polygons. Phong is pretty much beyond real-time 32X gfx. Gouraud should be possible. Obviously, flat shaded is what many games use on the 32X.

As "Cel-Shading" is beyond the 32X, I didn't even think about it. :lol:

evildragon
Very interested
Posts: 326
Joined: Mon Mar 12, 2007 1:53 am
Contact:

Post by evildragon » Fri Oct 12, 2007 4:52 am

Ok, then we'll just do regular polygonal world. Don't know how good it'll look though.

Mainly, it's going to be like an RPG, has a storyline that's very deep, and the game will be LONG, and have great battle scenes that's not "menu driven" like Final Fantasy. (unless that finally changed? i last played 7)

I just can't code much anymore though, I got carpal tunnel now :( so all I'm good for, for this game is, designing the storyline.

TMorita
Interested
Posts: 17
Joined: Thu May 29, 2008 8:07 am

Post by TMorita » Thu Aug 14, 2008 7:47 pm

Shiru wrote:It's called 'Cel shading' (aka 'Toon shading'), not 'Cell'. Just read wiki article to understand what you want.. I don't think it's possible for 32x (for realtime in-game graphics).
Depends.

Cel shading is comprised of two techniques: quantized lighting and black outlines.

The quantized lighting can be done with a single AND instruction.
The black outlines are expensive, because they're usually done by rendering the object twice or more times.

So, you can get half the effect for a very low performance cost.

Toshi

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Fri Aug 15, 2008 7:15 am

Well, if you made your subdividing affine mapper output one or two black pixels at the start and end on the line, then did the line with a pre-quantized texture, you could simulate cel-shading fairly fast. That would probably be the closest you could get in real-time on the 32X.

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Fri Aug 15, 2008 7:56 am

Shouldn't gouraud with an AND mask (and possibly a shift) be faster than using a pre-quantized 1D-texture? Since you'd get rid of the extra memory access required for the texel read.
I've never tried to do cel shading in a software renderer though, so I'm not sure.

I'm talking about paletted mode now. The gouraud inner loop gets more complex in direct color mode.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sat Aug 16, 2008 6:55 am

I was talking 2D textures. As I understand it, cel-shading is "cartoonizing" a standard texture mapped render. If the texture gets quantized to a single color, obviously using flat (gouraud) shading would be faster. If your texture doesn't quantize down to one color, then you're back to my suggestion. From the examples I've seen of cel-shading, it generally gets quantized to like four colors or so, so you still have a texture of sorts.

Post Reply