|
Re: Problem w/ toon shader outline
[Re: MrCode]
#179622
01/24/08 19:53
01/24/08 19:53
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
Maybe posting the asm snippet would be handy so that users who know asm can guide you in the correct direction But I think you can solve the problem by making the outline dependant to a view like in a Blinn-Phong effect. Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
Re: Problem w/ toon shader outline
[Re: frazzle]
#179623
01/25/08 05:21
01/25/08 05:21
|
Joined: Mar 2007
Posts: 677 0x00000USA
MrCode
OP
User
|
OP
User
Joined: Mar 2007
Posts: 677
0x00000USA
|
OK, Check: Code:
technique toon { pass one { VertexShader = compile vs_1_1 toonVS(); PixelShader = compile ps_1_4 toonPS(); } pass two { CULLMODE=CW; vertexShaderConstant[0] = <matWorldViewProj>; vertexShaderConstant[16] = <10/20.>; VertexShader = asm { vs_1_0 dcl_position v0 dcl_normal v3 dcl_texcoord v7 mov r0,v0 mul r1,c16.x,v3 // Scale the normal add r0.xyz,r0.xyz,r1.xyz m4x4 oPos,r0,c0 // Transorm position to clip space mov oD0, c0 mov r0,c0 }; } }
That's the whole technique, in case the problem may be more than just the asm.
void main()
{
cout << "I am MrCode,";
cout << "hear me roar!";
system("PAUSE");
}
|
|
|
Re: Problem w/ toon shader outline
[Re: MrCode]
#179625
01/25/08 19:24
01/25/08 19:24
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
That's exactly the reason why HLSL was developed, to make code reuse look more structured and readable Try ello's suggestions since HLSL is more flexible than asm IMHO Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
|