is there an easy way to get cel shading

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
ramy
Gnoblar
Posts: 5
Joined: Mon Apr 06, 2009 4:45 am

is there an easy way to get cel shading

Post by ramy » Sun Jul 12, 2009 8:53 am

so i'm looking at the cel shading demo, and i'm wondering if there's an easier way to produce cel shading that doesn't involve CG scripts. But i can't seem to export a cell shaded model from, say blender, and make it match in OGRE. anything i'm missing?

r.d.
0 x

carbonization
Gnoblar
Posts: 3
Joined: Wed Dec 31, 2008 5:19 pm

Re: is there an easy way to get cel shading

Post by carbonization » Mon Jul 13, 2009 7:44 pm

No the cel shading effect is done with a shader, CG is preferable because it translates down to HSLS & GLSL, but if you have it in Blender you might be able to export or copy the GLSL shader from Blender.
0 x

User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 1
Contact:

Re: is there an easy way to get cel shading

Post by Kencho » Mon Jul 13, 2009 8:08 pm

I once managed to do it by just using a spheric (though I recommend cubic) reflection map. It actually works, but I suggest it just as a fallback when shaders aren't supported. I find the shaders much better (higher customisation level and better-looking results)
0 x
Image

ramy
Gnoblar
Posts: 5
Joined: Mon Apr 06, 2009 4:45 am

Re: is there an easy way to get cel shading

Post by ramy » Mon Jul 13, 2009 9:40 pm

hmm, i looked into exporting the glsl shader from blender but that turned out to be a dead end.

what about the the Cg script being used in the cel-shading demo, can we just re-use that onto other meshes and materials? sorry if it seems like a ridiculous question, i still haven't gotten into writing cg scripts...
0 x

User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 1
Contact:

Re: is there an easy way to get cel shading

Post by Kencho » Mon Jul 13, 2009 10:28 pm

Yes, it's possible, of course :) But note it doesn't use the model's texture. You should add another sampler to the shader (and another texture unit with the real object texture), then take the texture colour in the shader, and then multiply the lighting and the texture colour to tint it.

Anyways, to add the shader to the material, just add the references (fragment_program_ref and so on) like in the example material.
0 x
Image

Post Reply