|
|
toon shader...how to use?
#222577
08/19/08 23:49
08/19/08 23:49
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
i am a real noob when it comes to shaders. i finally got the chrome and normal maps for objects to work. my problem is toonshaders. i have a game that i would like to use them, but how do i get it to work? how do i set it up so everything on the level including the player and enemy models are "toon shaded"?
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
Re: toon shader...how to use?
[Re: Blink]
#222737
08/20/08 19:20
08/20/08 19:20
|
Joined: Oct 2002
Posts: 8,939 planet.earth
ello
Senior Expert
|
Senior Expert
Joined: Oct 2002
Posts: 8,939
planet.earth
|
you could use my ready2use toon shader found here or if you just want the outline apply to the standard shading use this:
float4x4 matWorldViewProj;
struct VS_IN
{
float4 pos : POSITION;
float4 nrm : NORMAL;
};
struct VS_OUT
{
float4 oPos : POSITION;
float4 oC0 : COLOR0;
float4 oC1 : COLOR1;
};
VS_OUT OutlineVS (VS_IN In, uniform float scale, uniform float3 rgb)
{
VS_OUT Out;
In.pos.xyz += In.nrm.xyz*scale;
Out.oPos = mul(In.pos,matWorldViewProj);
Out.oC0 = Out.oC1 = float4(rgb,1.0);
return Out;
}
technique test
{
pass p1
{
CullMode = CCW;
}
pass p0
{
CullMode = CW;
VertexShader = compile vs_2_0 OutlineVS(1,float3(0.5,0,0)); // thickness , rgb
}
}
you could than go on and use vecSkill41 for the color and scale, so every entity could have its own color and thickness hope this helps
www.earthcontrol.dequoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
|
|
|
Re: toon shader...how to use?
[Re: ello]
#222759
08/20/08 21:40
08/20/08 21:40
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
thanks ello, but how do i apply it? i added the scripts to my level, what am i missing? there is no change. my card is able to use shadermodel 2.0.
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
Re: toon shader...how to use?
[Re: Blink]
#222768
08/20/08 22:52
08/20/08 22:52
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
ok, i got it working, but there is a thick line around my player and enemy models. what do i do about that?
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
Re: toon shader...how to use?
[Re: ello]
#222968
08/21/08 19:09
08/21/08 19:09
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
i tried the ready2use, that caused a massive amount of slowdown, and the thick outlines. should i be using the code you posted instead?
Last edited by Blink; 08/21/08 19:10. Reason: typo
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
Re: toon shader...how to use?
[Re: Slin]
#223028
08/21/08 23:12
08/21/08 23:12
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
you dont understand Nils, the outline is thicker than the models body. looks like he is encased in a blackhole. its a cool looking effect, but not like the effects i have seen here in the forums.
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
|