|
Re: simple toon shading
[Re: ello]
#22909
02/05/04 17:16
02/05/04 17:16
|
Joined: Jan 2002
Posts: 1,276 trapped in a paper bag
Drew
Serious User
|
Serious User
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
|
ventilator- what are your settings for the fur? my fur looks good straight on, but flat on the edges  Thanks!
|
|
|
Re: simple toon shading
[Re: ello]
#22915
02/05/04 22:05
02/05/04 22:05
|
Joined: May 2002
Posts: 7,441
ventilator
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2002
Posts: 7,441
|
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?
|
|
|
|