any chance of cartoon shading?

BlitzMax Forums/MiniB3D Module/any chance of cartoon shading?

JustLuke(Posted 2007) [#1]
I'm happy to see that people have started to implement normal maps/bump mapping and other similar things, but I feel that non-realistic rendering techniques are often sadly overlooked. Has any enterprising chap considered implementing cartoon (cel) shading?


Chris C(Posted 2007) [#2]
to get an outline effect, edit the model so it has another copy of the mesh scaled slightly larger and with faces flipped

to get the shading right use a shader! (klepto's site has a version of minib3d with which you can use shaders)


gman(Posted 2007) [#3]
the nehe tuts also have a cell shading example if someone feels like tackling the application to MiniB3D.


JustLuke(Posted 2007) [#4]
Chris:

The outline method that you mention produces poor quality results because you can't produce lines of a consistent thickness. Also, it the polygon count of any model that it is applied to. Also, simply scaling a model up doesn't work for complex meshes; it's fine for simple objects such as cubes, but try it with a humanoid figure (for example) and it messes up in lots of places (such as fingers). To get it to work iyou have to expand each vertex outward from their original position which is a little different from simply expanding the model - and both fiddly and time consuming if you don't have a plug in to automate the task (which I don't).

In regards to klepto's version of minib3, I am aware that it supports shaders, but I have no idea how to get a cel shader shader (if you see what I mean) working with it.


bradford6(Posted 2007) [#5]
Once we get our heads around shaders in general, implementing cel shading in particular should be a no-brainer. I would suspect just changing the vert & frag programs(the shaders) in klepto's example would give the desired effect. there are lots of shader editors out there. 3D labs shaderGen is one of my faves so far


Picklesworth(Posted 2007) [#6]
There are tons of toon shader examples that come with those editors, too.

Although, if you don't want to go the shader rout then the two meshes, one flipped idea works well. (Although it is possible with multiple rendering passes. I built that one and then I stupidly deleted it! It's probably slower anyway, but it was so cool!).