3 registered members (Ayumi, Akow, monk12),
1,413
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
Expert
|
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.
// 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
OP
Expert
|
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: ello]
#236031
11/11/08 15:35
11/11/08 15:35
|
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B
OP
Expert
|
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: xXxGuitar511]
#236176
11/12/08 15:37
11/12/08 15:37
|
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B
OP
Expert
|
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-narutoWhat 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
|
|
|
|