Edges (cartoon style) in Game Engine?

(hodka) #1

Hi,

is it possible to use cartoon style in Game Engine?

Activation of “Edge” in Render Buttons (F10) which activates cartoon style for normal rendering doesn’t have any effect on presentation of objects in the Game Engine.

Thank you very much for any advices in advance!!

0 Likes

(Monster) #2

You can do following:

Duplicate the mesh. Change the color of the mesh to black or whatever edge color you like. Then switch the normals of all faces to the other direction (inside). Now scale the mesh a little bit (5-10%). This is a common trick to build cartoon like objects.

0 Likes

(Mico27) #3

yes but shouldnt it be easier to use the GLSL script?

0 Likes

(hodka) #4

Thanks for the quick response.

Mico27: What is the GLSL script and how would one use it to get … well lets say… just one sphere in my scene to cartoon style?

0 Likes

(Mico27) #5

http://www.savefile.com/files/1054800<-----NOTGOOD
here’s the .blend file with a basic setup

0 Likes

(Matt_Goles) #6

Ive tried that blend and nothing happens. What version of blender should i use?

0 Likes

(Mico27) #7

OOPS wait forgot to pack the texture …lol
ok there you go http://www.savefile.com/files/1054925

0 Likes

(3D-Penguin) #8

You can do following:

Duplicate the mesh. Change the color of the mesh to black or whatever edge color you like. Then switch the normals of all faces to the other direction (inside). Now scale the mesh a little bit (5-10%). This is a common trick to build cartoon like objects.

As i assume that you know about the shader solution, what is the advantage of your method? It looks A LOT more expensive (in terms of processing resources) to me. Computing power of the GPU is at least tenfold that of the CPU.

0 Likes

(hodka) #9

Mico27, I like your way to get the cartoon style edge and was experimenting a lot. Thanks for the help already!

But I got the following problem:

when I take your example and do the following:

  1. add new UVSphere (Segments: 32, Rings: 32, Radius: 1) next to your Sphere
  2. add Sphere.001 to ShaderObjects in ToonShader2.py
  3. change “shader.setUniform1f(‘silhouetteThreshold’,0.2)” to “shader.setUniform1f(‘silhouetteThreshold’,0.5)”

then my edge looks awful… But yours looks so nice and smooth!

What did you do different to your Sphere??

here is the resulting blend-file: http://www.savefile.com/files/1064575

0 Likes

(Mico27) #10

very easy and obvious answer: your sphere is set to ‘‘solid’’, set it to ‘‘smooth’’

0 Likes

(hodka) #11

OHHHH NOOOO!!!

Thanks… didn’t think of that one.

THANKS AGAIN for all your help!!!

0 Likes

(ChicOrtiz) #12

Yep. But this method doens’t need GLSL support and it is not “that” expensive nowadays. (If you use that hack just for the main character for example or work with low poly stuff).

0 Likes