2 registered members (TipmyPip, 1 invisible),
18,699
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: normap question about A6.2 and rendermonkey?
[Re: bulljack]
#26981
05/06/04 03:31
05/06/04 03:31
|
Joined: May 2004
Posts: 14
bulljack
OP
Newbie
|
OP
Newbie
Joined: May 2004
Posts: 14
|
Code:
material mat_normalmap
{
flags = tangent;
effect =
"
texture entSkin1;
texture entSkin2;
matrix matWorldViewProj;
matrix matWorld;
vector vecSkill41;
vector vecViewPos;
technique specular
{
pass p0
{
VertexShaderConstant[0] = <matWorld>; //World Matrix
VertexShaderConstant[4] = <matWorldViewProj>; //World*View*Proj Matrix
VertexShaderConstant[16] = <vecSkill41>; //Light Direction
VertexShaderConstant[33] = (0.5f,1.2f,0.4f,0.0f);
Texture[0] = <entSkin1>; //basecolor
Texture[1] = <entSkin2>; //normal
VertexShader=
decl
{
stream 0;
float v0[3]; //position
float v1[3]; //normal
float v2[3]; //uv
float v3[3]; //tangent
}
asm
{
vs.1.1
m4x4 oPos,v0,c4
mov oT0,v2 // output uvs
mov oT1,v2 // output uvs
mov r3,v3
mov r5,v1
//gen binormal via Cross product
mul r0,-r3.zxyw,r5.yzxw;
mad r4,-r3.yzxw,r5.zxyw,-r0;
//lightvector
mov r10,c16
dp3 r11.x, r10.xyz,r10.xyz
rsq r11.xyz,r11.x
mul r10.xyz,r10.xyz,r11.xyz
dp3 r8.x,r3,-r10
dp3 r8.y,r4,-r10
dp3 r8.z,r5,-r10
mad oD1.xyz,r8.xyz,c33.x,c33.x
};
PixelShader=
asm
{
ps.1.1
tex t0 //sample base map
tex t1 //sample normal
dp3 r0,v1_bx2,v1_bx2
mad r0,v1_bias,1-r0,v1_bx2 //lightvector normalizer
dp3 r1,r0,t1_bx2 //L.N
mul r0,t0,r1
};
}
}
";
}
ACTION model1
{
my.skill41=float(-500);
my.skill42=float(153);
my.skill43=float(-57);
my.skill44=float(1);
MY.material= mat_normalmap;
while(1)
{
my.PAN+= 0.4;
wait(1);
}
}
Last edited by bulljack; 05/07/04 19:14.
|
|
|
Re: normap question about A6.2 and rendermonkey?
[Re: bulljack]
#26982
05/06/04 03:55
05/06/04 03:55
|
Joined: Oct 2003
Posts: 1,258 Virginia, USA
qwerty823
Senior Developer
|
Senior Developer
Joined: Oct 2003
Posts: 1,258
Virginia, USA
|
The first thing i notice is that the uv's are in v7 and v8 (tangent). I dont think you can override them. Try changing your v2 -> v7, and v3 -> v8 and see if it works.
Never argue with an idiot. They drag you down to their level then beat you with experience
|
|
|
Re: normap question about A6.2 and rendermonkey?
[Re: bulljack]
#26986
05/06/04 20:33
05/06/04 20:33
|
Joined: May 2004
Posts: 14
bulljack
OP
Newbie
|
OP
Newbie
Joined: May 2004
Posts: 14
|
Thank your reply. I have tested V2->V7,V3->V8,but I got the same result. I will post the pictures, and you will understand my meaning.
Additionaly, IN A6.2,I found an interesting thing, this code works well for the simple sphere and cube,but it doesn't work for the complex object,such as the character. But in RENDERMONKEY, the same code,texture and model can work well, why?
to DREW:because of this problem,then I can't finish the final code.
[image]http://pic8.album.tom.com/album_pic/2004/5/6/1083842260_34274.jpg?%75%4f%65%41%66%77%45%73%6b%7c[/image]
Last edited by bulljack; 05/07/04 03:11.
|
|
|
Re: normap question about A6.2 and rendermonkey?
[Re: bulljack]
#26987
05/06/04 20:51
05/06/04 20:51
|
Joined: May 2004
Posts: 14
bulljack
OP
Newbie
|
OP
Newbie
Joined: May 2004
Posts: 14
|
|
|
|
|