Page 1 of 1

Re: Toon Shader

Posted: Wed Aug 21, 2013 3:30 pm
by Num3
You'll have to hunt down a shader that works in ogre and does that.
I've seen that effect on League of Legends game, where characters have there body 'outlined'

Re: Toon Shader

Posted: Wed Aug 21, 2013 3:53 pm
by PMV
Shaders are referenced inside of a material-script. PB loads
one material-script for every entity (when using #PB_Material_None).
At this point, PB supports the whole functionality of a material-script,
that includes shaders. As i remember, there is the possibility to
set (and get?) shader-variables. But i haven't done anything
with that ... so i can't give you a working example or a hint,
how a shader needs to be implemented in a material-script :)
There shouldn't be much differences from PB-OGRE and
OGRE itself. So if there is an example in the OGRE-SDK,
that does this ... you can use the resource from that as a
beginning. :wink:

But if you get a toon-shader working with OGRE and PB, i
would be glade to have an example, too. :D

MFG PMV

Re: Toon Shader

Posted: Wed Aug 21, 2013 3:58 pm
by Num3
Is this what you are trying to do?
https://www.youtube.com/watch?v=uKamhvUIAQk


Different shaders can be applied to different meshes, but it must be done with material scripts.
Troll the Ogre forums, there are a lot of shader and material scripts there you can use ;)

Re: Toon Shader

Posted: Wed Aug 21, 2013 4:35 pm
by Comtois
kelebrindae did something about toon shader
http://www.purebasic.fr/french/viewtopi ... 9&start=24

see also here

Re: Toon Shader

Posted: Wed Aug 21, 2013 8:34 pm
by Samuel
Hello Everyone,

Is this the desired effect, Alexi?


http://imageshack.us/photo/my-images/689/lgf1.png/


If it is then I can post the code later on when I have some spare time.

Also, if you want multiple outline colors. The only way I know how to get it is by using separate meshes.
Using your picture for example. You would have the body as one mesh with a purple outline. Then for the tail and head hair you would have separate meshes
with a dark blue outline. Then just attach the meshes together to get the desired effect.

Let me know what you guys think.

Re: Toon Shader

Posted: Thu Aug 22, 2013 12:41 am
by Samuel
The specular highlights can be turned on or off. They work off of purebasic's light commands so it's easy to adjust.
Unfortunately, I don't think I'll be much help with the inside outlines. Sorry...

I wont be able to post it for at least a few hours yet, but I thought I would let you know that this uses The Nvidia Cg Toolkit.
Here's the link if you need it.

https://developer.nvidia.com/cg-toolkit

I'll get started on this right after I'm done with work.

Re: Toon Shader

Posted: Thu Aug 22, 2013 9:36 am
by Samuel
Everything about the shader ended up being big. So, I created a separate topic. I didn't want to engulf this one.
I hope it helps. :D

http://www.purebasic.fr/english/viewtop ... 36&t=56159

Re: Toon Shader

Posted: Wed Aug 28, 2013 7:20 pm
by Samuel
I searched the ogre forums, but I couldn't find any info on a toon compositor. It's possible I missed something though.
You may have to write your own. That or find one that's similar and just tweak it to your liking.