Performance Friendly Cell Shading?

Started by elias4444, October 27, 2007, 18:20:13

Previous topic - Next topic

elias4444

I know of two methods that create the Cell Shading effect in openGL: The one from the NeHe tutorial, where you have to recalculate the light for every triangle every frame (which destroys the use of call lists, only marginally lets you use VBOs, and kills your framerate no matter what), and using a GLSL shader (which I don't actually know how to do, but it creates some rather steep system requirements for a casual game).

Other than those two, are there any performance friendly Cell Shading techniques for openGL? I've been looking for a way to possibly reduce the color range of a glLight, but haven't had any luck with that. It just seems to me like there's got to be an easier way; I mean, after all, aren't we actually simplifying things by using Cell Shading?

Any input is appreciated!

=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

Evil-Devil

The most easiest way I've seen was to go with shaders and let them do the work.

Orangy Tang

Depending on what you want your light to behave like, you may be able to fake something with tex coord generation. A directional light might be faked with a cube map and environment mapping for example. For anything more complicated you'll probably have to go back to early register combiners and/or asm shaders. nVidia had a pdf on their website about doing cell shading on a GeForce 1 IIRC (although the quality was bad and I have no idea what the performance was like).

A GLSL vertex shader might be your best bet. It'll work on GF5xxx and up, plus the intergrated intel chips do GLSL vertex shaders on the CPU so it'll work there too.

bobjob

did you find a nice option for cell shading?

here is something to consider, download the java monkey engine source code, and run the jmetest examples, there is 1 there for cell shading.

Momoko_Fan

Vertex shaders (ARB asm) are an OpenGL 1.4 feature.. my RIVA TNT supports it. So you don't need to use GLSL for this.

elias

Quote from: Momoko_Fan on December 08, 2007, 00:29:29
Vertex shaders (ARB asm) are an OpenGL 1.4 feature.. my RIVA TNT supports it. So you don't need to use GLSL for this.

Yes, but they run in software (on the CPU). Afaik, the first geforce to support vertex shaders in hardware is geforce 3.

- elias