simple toon shading

Posted By: ventilator

simple toon shading - 02/05/04 07:09

i did a simple toon shader and added it to my wiki!
Posted By: fuxerz

Re: simple toon shading - 02/05/04 07:28

WONDERFUL!works gr8. thanks ventilator
Posted By: Drew

Re: simple toon shading - 02/05/04 08:02

AWESOME! thank you , great work!


Posted By: Orange Brat

Re: simple toon shading - 02/05/04 08:47

Cool beans. It says you can adjust the black line...can it be turned off or made invisible? In other words will setting "my.skill41=float(0.8); // outline_thickness" to 0 do the trick(or crash it?)

Posted By: ventilator

Re: simple toon shading - 02/05/04 08:57

@drew: wow, the structure looks nice with the outline on it...

if you don't want the outline the best way is to comment out the entire second pass. setting the thickness or the alpha to 0 should work too but it would be a bit inefficent to do it that way...
Posted By: fuxerz

Re: simple toon shading - 02/05/04 09:21

looks cool with characters too

Posted By: ello

Re: simple toon shading - 02/05/04 09:44

thanks for this.
Posted By: ventilator

Re: simple toon shading - 02/05/04 10:49

i quickly put together a small demo -> test.zip ~2mb

a s d w - rotate light
space - toggle animation
Posted By: Drew

Re: simple toon shading - 02/05/04 11:06

WOW!!! that fur is amazing. so are the others!
Thanks for the demo! It would be a great trend if every shader had a demo connected to it..

Posted By: Orange Brat

Re: simple toon shading - 02/05/04 15:15

Hey, thanks for the script...I've cooked up some nice stark shading, though I really need to redo the old guard model with a flat skin. The only thing I can't figure out is why my model's alpha fading is screwed up. When it is supposed to occur, the model turns completely black instead of fading out. Any ideas on how to make the shader work with it?
Posted By: ello

Re: simple toon shading - 02/05/04 16:52

if u use vecSkill41 for the pixelShaderConstant[c0] , too and use its .w component in the vertexshader then the other 3 skills can go as rgb data into the pixelshader u can change the effects color within the entity-skills. i added c1 constant with value 1in alpha position and a mov r0.a,c1.a after the rgb values have been passed because the skill41.a component is still the line thickness. this way you can set the style for every entity using the same shader:



Posted By: Drew

Re: simple toon shading - 02/05/04 17:16

ventilator-
what are your settings for the fur? my fur looks good straight on, but flat on the edges
Thanks!
Posted By: ello

Re: simple toon shading - 02/05/04 17:18

use transparent flag or even bright flag

and i found out that setting nofog flag is good, too
Posted By: Orange Brat

Re: simple toon shading - 02/05/04 17:24

Is it possible to adapt the toon shader to react to regular dynamic lights(instead of the sun) or will that have to wait until the light management stuff is implemented.
Posted By: Drew

Re: simple toon shading - 02/05/04 17:45

@ello- That seemed to make an improvement
maybe its my base texture...still doesnt look nearly as cool as ventilaors character in the demo...


Posted By: Drew

Re: simple toon shading - 02/05/04 18:03

OKAY. its my models, just try it on the warlock...
Posted By: ello

Re: simple toon shading - 02/05/04 18:22

some fine noise texture should work well, too
Posted By: ventilator

Re: simple toon shading - 02/05/04 22:05

Quote:

The only thing I can't figure out is why my model's alpha fading is screwed up. When it is supposed to occur, the model turns completely black instead of fading out. Any ideas on how to make the shader work with it?


i think the problem is that the outline model is visible through the hole in the model. in order to get it to work you would have to use the alpha channel on the second pass too.

try something like:

Code:

pass p1
{
texture[0]=<entSkin1>; // !NEW!
cullMode=cw;
vertexShaderConstant[0]=<matWorldViewProj>;
vertexShaderConstant[16]=<vecSkill41>; // outline_thickness, 0, 0, 0
vertexShader=
decl
{
stream 0;
float v0[3];
float v3[3];
float v7[3];
}
asm
{
vs.1.1
mov r0,v0
mul r1,c16.x,v3// scale normal
add r0.xyz,r0.xyz,r1.xyz// shell offset (vertex position + scaled normal)
m4x4 oPos,r0,c0// transform position to clip space
mov oT0,v7 // !NEW! output uvs
};
pixelShader=
asm
{
ps.1.3
def c0,0,0,0,1// outline rgba
tex t0 // !NEW! fetch texture
mov r0,c0
mov r0.a,t0.a // !NEW! use alpha channel
};
}



i haven't tested it but it should work this way. ...i don't know how such an effect would fit to toon shading though?
Posted By: ello

Re: simple toon shading - 02/05/04 22:11

i made a slight change so u can set outlines thikness and color thru the entity skills. look here
Posted By: Orange Brat

Re: simple toon shading - 02/06/04 13:23

Quote:

i haven't tested it but it should work this way. ...i don't know how such an effect would fit to toon shading though?





Like with a 3rd person camera...when you rotate into a wall and the camera gets close to or enters the player...they fade out...at a certain distance they vanish. I'll try out what you suggested, however when I use the 2nd pass, my models ends up at the other end of the level when it starts. Without pass 2, it begins where I have him set in WED. Odd and there is no visual difference between using both passes or only using the first one.
Posted By: ventilator

Re: simple toon shading - 02/06/04 20:57

Quote:

Is it possible to adapt the toon shader to react to regular dynamic lights(instead of the sun) or will that have to wait until the light management stuff is implemented.


yes, this will be much easier once the new light management is implemented!

Quote:

Like with a 3rd person camera...when you rotate into a wall and the camera gets close to or enters the player...they fade out...at a certain distance they vanish.


oh! now i understand what you want. i will think of something if i have some time. in theory you only have to pass the model's alpha to the shader and use it in both passes.

i thought you want to use a model texture with alpha channel and the solution above would be for that (if it worked)...


Posted By: Zerodin

Re: simple toon shading - 02/08/04 09:27

That is some FANTASTIC work
I applaude you!!!
I have been wanting a toonshader for quite some time!
Question.
How do you make so say, an object has both the shader property, as well as a pickup property?
like a shotgun.

Posted By: PoLaRiS69

Re: simple toon shading - 02/17/04 19:41

Is There some way to make A6 totaly render only toonshader? or do I have to apply this to every entity?
Posted By: ello

Re: simple toon shading - 02/17/04 19:49

its in betatesting, but there are some problems i think
Posted By: PoLaRiS69

Re: simple toon shading - 02/18/04 02:29

I am willing to help test

I have some great toonshader models...

I also have a realy fast method of makeing a model, and automaticaly generateing a color skin/texture, in just a couple of clicks Maby I will post in the help wanted section...

I use wings 3d to model, then I UV map it in wings, and VOLA! it takes all my vertex colors and paints tthem on a texture for me on the correct UV cords

The models could be totaly done at that point if I had a toonshadder!

here is a fun toon shader photo I made a while back in TS 6.6


http://www.pixolator.com/zbc-bin/ultimatebb.cgi?ubb=get_topic&f=1&t=014155
Posted By: PoLaRiS69

Re: simple toon shading - 02/18/04 02:37

BTW the models in photo are madein ZBRUSH... Except the big "Mech" in the background, I made him in wings one morning while talking to my mom on the Phone...


Posted By: mjbee2

Re: simple toon shading - 02/19/04 03:44

let me ask some stupid questions (I KNOW there is no such thing but I got to ask anyway):

Is this "fake shading" like using the fatboy shading idea with Milkshape or is this true DirectX shading?

Does it affect the FPS?

There, that ought to do it. You might ask why I would be interested, well I'm a "toon" kind of guy: http://www.newrev7.com/indexblog.html
Posted By: msKEN

Re: simple toon shading - 02/19/04 04:28

This is purely a shader, its not a faking system like the fatboy trick method. There is no doubling of polygons or anything like that. Just have the item you want to be toon shaded call the toon shade function on a normal object and your good to go.
Posted By: ventilator

Re: simple toon shading - 02/19/04 10:16

the shader does double the polygons! the second pass renders a slightly bigger inversed black model. the advantage is that you don't have to prepare the outline model yourself...

the shader does affect fps (every shader does!), but not much. other more advanced toonshaders would be much slower...
Posted By: mjbee2

Re: simple toon shading - 02/19/04 10:41

thanks for clearing that up (I think)... if that's the case then it is not a true shader in the sense of the DirectX Cellshading call (unless I am wrong again). Anybody else want to fill me in more?
Posted By: ventilator

Re: simple toon shading - 02/19/04 10:48

it's a true shader!

what do you mean with "directx cellshading call"?
Posted By: Orange Brat

Re: simple toon shading - 02/19/04 11:33

What exactly is the difference between this shader and a more advanced one?
Posted By: ventilator

Re: simple toon shading - 02/19/04 12:02

the painting part could react to more light sources for example and the inking part could look more like drawn by a human with sketchy looking, varied line-styles and things like that...
Posted By: Inferno2k3

Re: simple toon shading - 02/28/04 23:05

Can i use this shader with the demo version of gamestudio?

cu
Inferno2k3
Posted By: robertternes

Re: simple toon shading - 02/29/04 01:58

No, you cannot. Shaders are only available in A6 6.20 Commercial & Professional.
The actual demo is only the version 6.11.4 and can't already support shaders. And it is also the Extra version so it also wouldn't support shaders 'cause this works only wirh Commercial or higher, doesn't it?
Posted By: clubCarl

Re: simple toon shading - 03/02/04 13:43

Hey,

Great demo. Where did the code go? Wanted to test it on some new models and the links are gone.

If you can repost it or let me know where I could get it it would be appreciated.

Thanks,

Carl
Posted By: PurpleTaiters

Re: simple toon shading - 03/10/04 10:22

Cool shader. Did you know that if you comment out the pixel shading part then your end up with the rainbow color map on your model. I'm gonna try to edit it now so that the rainbow shifts!
Posted By: Virtual_User

Re: simple toon shading - 03/10/04 10:30

Quote:

i quickly put together a small demo -> test.zip ~2mb

a s d w - rotate light
space - toggle animation




Ventilator... can you put this demo back up? I have not jumped into the world of shaders and would really be interested in seeing this toon shader in action.

Thanks!
Posted By: ello

Re: simple toon shading - 03/10/04 17:21

its also part of the materialeditor (see showcase1) there you can play round with the values
Posted By: Virtual_User

Re: simple toon shading - 03/10/04 22:42

Thanks! I will get it and try it out.
Posted By: A.Russell

Re: simple toon shading - 03/21/04 23:35


I just gave it a try, but my model just comes up black. Does this only work in outdoor levels?


Posted By: Captain_Kiyaku

Re: simple toon shading - 05/14/04 23:15

hi,
i want to give an transparent model the shader too, but it doesn't work :/, i tried the code from ventilator but it's still black, overall. So what must i change?

bye

sry for my bad english :*)
Posted By: Orange Brat

Re: simple toon shading - 10/05/04 16:45

Has this shader been fixed for DX9? It won't work, now but because of a known bug, I can't see the error message. For now, I'll just assume it's the usual one if a DX8 shader is used in a DX9 setup.

http://www.conitecserver.com/wiki/index.php/SimpleToonShading

Has anyone tried their hand at a different one? Isn't it time to move beyond "simple" toon shading?
Posted By: SingleCell

Re: simple toon shading - 10/08/04 13:13

Mr Ventilator... Please can you fix this to work in DX 9 I was using this shader (or at least just the Inker part.) and since 6.3 it wont work.

I tried making the changes in the 6.3 help, but alas... its still broken and im a complete novice with shaders - wouldnt know where to start.... Pleeeeaaaaaasssssseeeeeee............. (Best whiny pleading voice.)

Tone
Posted By: Orange Brat

Re: simple toon shading - 10/09/04 00:15

And anyone else who can convert Rendermonkey/Composer shaders to 3DGS ones please look here:

http://www.conitecserver.com/ubbthreads/showflat.php?Cat=&Number=435236
Posted By: theomega

Re: simple toon shading - 10/17/04 21:11

how do I use this shader? Is there any tutorial?
Posted By: thegamedesigner

Re: simple toon shading - 10/19/04 13:04

How do I get the first shader ventilator was talking about, whats a "wiki"?

thanks, and love the screen shots, the shader looks really good.

thegamedesigner
Posted By: Orange Brat

Re: simple toon shading - 10/19/04 13:19

Wiki is at the bottom of the page. This shader only works with the DirectX 8.1 versions of A6. I provided some raw DX9 versions in the link a few posts up. Currently waiting for someone to convert the 2nd one.
Posted By: thegamedesigner

Re: simple toon shading - 10/20/04 00:59

Thanks

thegamedesigner
Posted By: Jonah

Re: simple toon shading - 12/08/04 14:51

I tested it and it has no effect...
Can someone tell how to use it
Posted By: Wiz

Re: simple toon shading - 01/19/05 22:53

I can't seem to get this shader to work...can anyone make a quick tutorial or just go through the steps of using this shader?
Posted By: Braxton

Re: simple toon shading - 01/20/05 07:18

I can't find the site where the shader is located
Posted By: Braxton

Re: simple toon shading - 01/21/05 08:12

Come on guys, I need help. What is your sites url. I want that shader!!! And when you mean wiki, you don't mean conitecs right???
Posted By: Rhuarc

Re: simple toon shading - 01/21/05 08:27

Braxton, you've been here how long and been reminded how many times of this lovely thing called a search feature? Use it.

http://www.conitecserver.com/ubbthreads/showflat.php?Cat=&Board=SHADER&Number=450277&Forum=All_Forums&Words="Dx9%20Toon%20Shader"&Searchpage=0&Limit=25&Main=450277&Search=true&where=bodysub&Name=&daterange=1&newerval=3&newertype=m&olderval=&oldertype=&bodyprev=#Post450277

-Rhuarc
Posted By: Braxton

Re: simple toon shading - 01/21/05 08:34

I wanted a link to his site, but thanks anyways RUHIC, that will be the last time you have to say that. SORRY!!!

Can't wait ot test it.


Also it says that it is a DX9 shader, does that mean that i caN use it w/out a .dll. I DON"T KNOW ANYTHING ABOUT SHADERS!!! Lol...
Posted By: Braxton

Re: simple toon shading - 01/21/05 13:17

Hey Drew i like your screenshot!!!
Posted By: Braxton

Re: simple toon shading - 01/22/05 08:59

Rhuark - THat shader doesn't work!!! It makes only black models (I think my graphics card is too old). I would like to have his so I can use it. I just need a link to his site.
Posted By: JvsJGameDesign

Re: simple toon shading - 01/22/05 12:41

Braxton, why do you Double/Tripple post so extremely much?!
There is an EDIT button so you can EDIT your message.

BTW, I replyed on your messageS in that other toon shader topic.

Quote:

Rhuark - THat shader doesn't work!!! It makes only black models (I think my graphics card is too old). I would like to have his so I can use it. I just need a link to his site.



This black model is because you have an old videocard that does not support pixelshader and/or DirectX 9.0.
Time to buy a new one perhaps?
Posted By: Wiz

Re: simple toon shading - 01/24/05 02:47

I get the same effect that Braxtons screenshot shows and I have an ATI x800 PRO with the newest driver update. All the shaders I have tried from the forum that has a demo runs fine, but when I try it myself I get this result. Is there anything I forgets that makes this effect?
Posted By: Braxton

Re: simple toon shading - 01/24/05 03:23

@ 3DGS_4_Life- Sorry.

@ Wiz- I don't know. Try talking to one of the shader gods.
Posted By: b_102373

Re: simple toon shading - 01/28/05 17:20

Quote:

I get the same effect that Braxtons screenshot shows and I have an ATI x800 PRO with the newest driver update. All the shaders I have tried from the forum that has a demo runs fine, but when I try it myself I get this result. Is there anything I forgets that makes this effect?




Most likely it doesnt support your card.
© 2024 lite-C Forums