Page 1 of 1

is there an easy way to get cel shading

Posted: Sun Jul 12, 2009 8:53 am
by ramy
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.

Re: is there an easy way to get cel shading

Posted: Mon Jul 13, 2009 7:44 pm
by carbonization
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.

Re: is there an easy way to get cel shading

Posted: Mon Jul 13, 2009 8:08 pm
by Kencho
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)

Re: is there an easy way to get cel shading

Posted: Mon Jul 13, 2009 9:40 pm
by ramy
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...

Re: is there an easy way to get cel shading

Posted: Mon Jul 13, 2009 10:28 pm
by Kencho
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.