gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > Cel-Shading.

#13701 - AcidGame - Sun Dec 21, 2003 12:29 am

Ok, just posting this for a future-reference answer. How would one go about cel-shading a GBA scene? Would the images have to be pre-celshaded, or is there a code that can do it for me?

note. i understand celshading is used for 3d, but i have an idea, and it requires celshading..

or.. is this even possible?

#13702 - Nessie - Sun Dec 21, 2003 12:34 am

Applying the cel-shading 'off-line' would be the easiest approach. The artwork could be drawn that way, or if you really want, attempt to devise some code to process your artwork to give it a cel-shaded look.

Or is there some reason you need to calculate and apply the cel-shading run-time? Doing 3D? If so, I can't imagine you'd want to tack on the cost of cel-shading on top of rasterizing a 3D scene.

#13704 - AcidGame - Sun Dec 21, 2003 1:29 am

I know that that would be the easiest approach. But forget this post. :P
I decided what i thought of, wasnt worth it. lol

#13706 - DekuTree64 - Sun Dec 21, 2003 1:39 am

Actually my goraud tri filler is more of a 1D texture mapper, so if you use something like that cel shading is nice and cheap. Just make the goraud color map half light and half dark or whatever
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#13973 - funkeejeffou - Fri Dec 26, 2003 8:02 pm

Cel shading requires somehow a lot of processing. Mapping a 1D texture isn't hard and CPU consumming, but filling the edges is.
You must draw in black flat filling all the back facing polygones with a larger scale than the original so that it will be seen after the front facing polygon will be mapped (scale ~ 1.1). Also, you can plot all segments that are shared between frontfacing and backfacing polygones.
Anyway, generally cel shading is a mix of a regular 2D texture mapping with a 1D lighting texture mapping (cartoon style light progression). Add to this the difficulty of drawing edges (traditionnal bresenham won't be enough if you wanna enlarge the lines and make the edges stick together), and you'll find it hard to make it run properly on the GBA.
Of course, someone might be able to but it won't be a piece of cake.