Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
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 Offline OP

Expert
Blink  Offline 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 Offline
Senior Expert
ello  Offline
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:
Code:
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.de
quoted: 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 Offline OP

Expert
Blink  Offline 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 Offline OP

Expert
Blink  Offline 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: Blink] #222894
08/21/08 14:34
08/21/08 14:34
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
you can adjust the thickness. btw, you can use vs_1_1 as well

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 Offline OP

Expert
Blink  Offline 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: Blink] #222989
08/21/08 20:29
08/21/08 20:29
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
you could try that. i had no such massiv fps dropdowns when i created the ready2use

the code i posted is just creating the outline and can be combined with whatever you want


www.earthcontrol.de
quoted: 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] #222990
08/21/08 20:31
08/21/08 20:31
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Blink, the outline is a feature of the shader!

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 Offline OP

Expert
Blink  Offline 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."
Re: toon shader...how to use? [Re: Blink] #223065
08/22/08 07:49
08/22/08 07:49
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
oh and btw, i dont have such thick lines. did you use it with lite-c? in that case you need to use floatv instead of float... dunno, just a guess

Page 1 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1