Toon Shader

Everything related to 3D programming
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Re: Toon Shader

Post 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'
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: Toon Shader

Post 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
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Re: Toon Shader

Post 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 ;)
User avatar
Comtois
Addict
Addict
Posts: 1432
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: Toon Shader

Post by Comtois »

kelebrindae did something about toon shader
http://www.purebasic.fr/french/viewtopi ... 9&start=24

see also here
Please correct my english
http://purebasic.developpez.com/
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Toon Shader

Post 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.
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Toon Shader

Post 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.
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Toon Shader

Post 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
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Toon Shader

Post 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.
Post Reply