Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Ayumi, Akow, monk12), 1,413 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Not sure what this would be called [Re: mpdeveloper_B] #235756
11/09/08 21:18
11/09/08 21:18
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
so, how did it go?


- aka Manslayer101
Re: Not sure what this would be called [Re: mpdeveloper_B] #235787
11/10/08 05:25
11/10/08 05:25
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
...Not exactly what I was hoping for, but close. It uses a lookup texture (Material Texture 1). You'll have to tweak this to adjust the threshold and strength of the effect.

This is just a demonstration and what I am using now.









Code:

// toon.fx
// xXxGuitar511

float4x4 matWorldViewProj;
float4x4 matWorldView;
float4x4 matWorld;
float4x4 matView;
float3  vecViewPos;
texture entSkin1;
texture mtlSkin1;


sampler map_toon = sampler_state
{texture = <entSkin1>;};

sampler map_lookup = sampler_state
{
	texture = <mtlSkin1>;
	AddressU = CLAMP;
	AddressV = CLAMP;
};


struct VS_IN
{
	float4 Pos	: POSITION;
	float2 Tex	: TEXCOORD0;
	float3 Nor	: NORMAL;
};

struct VS_OUT
{
	float4 Pos	: POSITION;
	float2 Tex	: TEXCOORD0;
	float3 Nor	: TEXCOORD1;
	float3 Dir	: TEXCOORD2;
};

struct PS_IN
{
	float2 Tex	: TEXCOORD0;
	float3 Nor	: TEXCOORD1;
	float3 Dir	: TEXCOORD2;
};


VS_OUT VS(VS_IN In)
{
	VS_OUT Out;
	//
	Out.Pos = mul(In.Pos, matWorldViewProj);
	float3 wPos = mul(In.Pos, matWorld);
	Out.Tex = In.Tex;
	//
	Out.Nor = normalize(mul(In.Nor, matWorldView));
	Out.Dir = normalize(wPos - vecViewPos);
	//
	return Out;
}


float4 PS(PS_IN In) : COLOR
{
	float4 Out = {0, 0, 0, 1};
	float3 Col = tex2D(map_toon, In.Tex);
	//
	float3 face = {0, 0, -1};
	float lit = saturate(dot(In.Nor, face));
	//
	float3 Ref = tex2D(map_lookup, float2(lit, 0.25));
	Ref = saturate((Ref - 0.5)*2 + 1);
	Ref += saturate(Ref - 0.5) * 2;
	//
	Out.rgb = Col * Ref;
	//
	return Out;
}


technique toon
{
	pass p1
	{
		VertexShader = compile vs_2_0 VS();
		PixelShader = compile ps_2_0 PS();
	}
}



Last edited by xXxDisciple; 11/10/08 05:27.

xXxGuitar511
- Programmer
Re: Not sure what this would be called [Re: xXxGuitar511] #235856
11/10/08 15:09
11/10/08 15:09
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
Thanks, the shading looks good, it looks very similar to the game's shading. Now I just need to know how to duplicate the inlines that are shown here:



It would help if I had a straight video to show you how they move, but I don't. I can say though that the lines are not always there, so they are not drawn in, they're dynamic.


- aka Manslayer101
Re: Not sure what this would be called [Re: mpdeveloper_B] #235940
11/11/08 01:09
11/11/08 01:09
Joined: Dec 2000
Posts: 4,608
mk_1 Offline

Expert
mk_1  Offline

Expert

Joined: Dec 2000
Posts: 4,608
post processing? render only normals (everything that doesn't have this effect should be plain blue) and check if the normals of adjacent texels differ > 70°


Follow me on twitter
Re: Not sure what this would be called [Re: mk_1] #235988
11/11/08 09:46
11/11/08 09:46
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
i once did some test on this.. been a while:


find it here

maybe it gets you somewhere


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: Not sure what this would be called [Re: ello] #236031
11/11/08 15:35
11/11/08 15:35
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
It looks good, and with some tweaking it would be great, but....PPE....I can't use it. I have A6 Com and the R2T Dll doesn't fully work right. Is there any way that a model's normals can be used to do that? (without the shading, and smoother sketch lines)


- aka Manslayer101
Re: Not sure what this would be called [Re: mpdeveloper_B] #236073
11/11/08 18:37
11/11/08 18:37
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
i dont believe so.. but this meand nothing smile

Re: Not sure what this would be called [Re: ello] #236141
11/12/08 06:43
11/12/08 06:43
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Just add standard toon outlining...


xXxGuitar511
- Programmer
Re: Not sure what this would be called [Re: xXxGuitar511] #236176
11/12/08 15:37
11/12/08 15:37
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
Here's and idea what the toon shading is actually like, a comparance between the ps2 version of naruto and the ps3, the ps2 is traditional toon shading, ps3 is the new one. Granted, the ps3 one has waaaay more polies too.

Link: http://kotaku.com/5082968/the-difference-between-ps2-and-ps3-naruto

What ello made is the shading. The lines dynamically disappear and reappear, but I can't use post processing... oh well. Thanks to all of you, especially you xXxDisciple, you've been extremely helpful.


- aka Manslayer101
Page 2 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