Toon Edges in the Game Engine

How do i use toon edges in the game engine?

First you duplicate you mesh. Scale it larger, then flip the normals and vertex paint it black. Make sure its parented to the original mesh.

hmm, thats a vertex-increasing hack. so theres no native way to do it?

What kind of “native” way would you suggest? OpenGL doesn’t provide built-in support for silhouette rendering, and many other ways to get the same effect would be even slower than duplicating the mesh.

Like Wise said there is no Native way, I remeber I had made this possible but I just got tire of tring to learn how to getr buttons for this to work in Blender, which just drew the backsides of the mesh with lines to make an egde. Its faster then duplicating the mesh.

There is probably a graphic card with build in effects like outlining, but I am guessing not many have that card ^_-

that would be it…but opengl doesnt support it. thats what i was looking for.

Ok here the fake toon edges in realtime comes:

  • select your object.
  • Duplicate it : ctrl+d
  • now enter editmode of the duplicated object.
  • select all vertices, and press alt+s, and fatten is a little more then the orginal one.
  • now exit editmode and enter Face select mode (f)
  • select all faces, go to edit buttons and hit the button, Flip Normals.
  • now exit face select mode (F) and enter paintmode by hitting V
  • select a color from the paint buttons and paint your character totally black.
  • now exit paintmode (V) and parent the duplicated object to the original object.
  • add a motion actuator to your original object and hit P to see how it looks in game mode.

Viola Toon edged character.
If you want a toon shaded character, I’ve got a nice source here. :stuck_out_tongue:

This is the method used in Boarder Girl demo,

Is there a method to iluminate a object or character with toon shader?

Nice technique, JD. The problem with it, as has been mentioned before, is that it doubles the vertex count in a game, since if you use it one thing, you pretty much have to use it on everything. For making a game with toon shading I would skip the outlines, since that’s all you see when you run the game engine (I mean that the whole thing doesn’t have edges where you’d want them, like in a comic book), and the results may look somewhat goofy if you have a scene full of black-edged objects.

Just my $0.02.


Ah, so that’s how you did it, cool idea :slight_smile:

I saw someone use a texture with a diagonal gradient used as a sphere map, which gave a pretty good toon shading effect.

Wiseman303: Yeah blengine did, I still have the blend here, it’s quite nice, but still need a duplicated mesh if you want to add some details to the character. It uses a gradient texture that looks simular to a material sphere with toon shading on it if you set that up in the materials options in blender. Then add that one to the duplicated mesh en use reflection options for texture to make it cellshaded instead of toonedged. :stuck_out_tongue:

Compressed of 3 meshes

Cell Shaded Mesh texture

The cell shaded mesh is created by duplicating the mesh and setting that texture ( or something simular) Realtime Texture Mapping to Refelection. Then Use the [Add] and apply to app faces and vertex color to your liking

easiest way to flip all normals is … select all verts, and Shift Ctrl N ( recalculate normals inside. )

How about using this cool thingy I found in 2.34:

I think that “the ancient creators” (the people that made 2.34)
could edit a function from 2.34 and add it to the game engine;
I’m talking about the thingy that appears when you are in shaded mode and then you select an object: Pink lines appear on the object, and they’re perfect! Just change them to black, enable them in the game engine and voila!

Anyway, drawing wireframe AND shaded objects at the same time would be great. I could do loads of things with a few wireframe objects; lightning, rays of death, webbing and similar things. Of course I would have to have full control over which wireframes are drawn and which aren’t.

I’ve done a few toon-shading tests myself. You’ll see when I post my game. You’ll see…

Thank you very much! :smiley:

This toon shader method is much incredible!

Blender, and Blender community is every time impressing me with your creativity. I’m very happy in take part of this community.

Was that for me or the others? Probably not me. :slight_smile:

SkyShark, The tanks go to all, principally for JD-multi e Sutabi. But, you had a good idea.

Here an image of a model in that I have used the real time edge and toon shader technics learned here:

P.S.: I also hate geocities :x

Check this out too:

Make additional polygons to the penguin’s beak MANUALLY so it has toon edges too. Everything can’t be done automatically… :wink: