2 registered members (AndrewAMD, dpn),
1,328
guests, and 10
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
error x3000!
#45331
05/06/05 23:00
05/06/05 23:00
|
Joined: Sep 2004
Posts: 1,214 Austin, Texas
Josh_Arldt
OP
Senior Developer
|
OP
Senior Developer
Joined: Sep 2004
Posts: 1,214
Austin, Texas
|
What's wrong with this effect? I always get an error x3000 unexpected token "F": I also get buttload of uninitialised components errors. Code:
matrix matWorldViewProj; matrix matWorld; texture entSkin1; texture mtlSkin1; vector vecLight; technique dot3map { pass p0 { Texture[0] = <mtlSkin1>;//2te Skin im Model ist die Normal Map Texture[1] = <entSkin1>;//1te Skin im Model ist die Textur COLOROP[0] = DotProduct3; COLORARG1[0] = Texture; COLORARG2[0] = Diffuse; COLOROP[1] = Modulate; COLORARG1[1] = Texture; COLORARG2[1] = Current; VertexShaderConstant[0]=<matWorldViewProj>; VertexShaderConstant[4]=<matWorld>; VertexShaderConstant[18]={1F,1F,1F,1F}; VertexShaderConstant[19]={0.5F,0.5F,0.5F,0.5F}; VertexShaderConstant[20]= <vecLight>; VertexShaderConstant[30]={0F,1F,0F,0F}; VertexShaderConstant[31]={1F,0F,0F,0F}; VertexShaderConstant[32]={0F,0F,1F,0F}; VertexShaderConstant[90]={1F,0F,0F,0F}; //damit oFog gefüllt ist VertexShader = decl { Stream 0; Float v0[3]; //Position Float v3[3]; //Normal Float v7[2]; //Textur Koordinaten 0 } asm { vs.1.0 m4x4 oPos, v0, c0 m4x4 r10,v0,c4 m3x3 r8,v3,c4 mov oT0, v7 mov oT1, v7 mov oT2, v7 mov oT3, v7 //calculate texture space matrix from normal and up mul r0,c31,v3.zxyw //-1,0,0 mul r1,c32,v3.yzxw //0,0,-1 sub r0,r1,r0 dp3 r0.w,r0,r0 rsq r0.w,r0.w mul r0,r0,r0.w //normalized right vector mov r1, c30 //0,-1,0 mov r2, r8 sub r9,c20,r10 dp3 r9.w,r9,r9 rsq r9.w,r9.w mul r9,r9,r9.w //normalized light vector m3x3 r3,r9,r0 mov r3.w,c30.w //transform light to texture space add r3,r3,c18 //bias mul r3,r3,c19//scale mov oD0,r3 mov oFog,c90 }; } }
|
|
|
Re: error x3000!
[Re: Nadester]
#45333
05/07/05 04:05
05/07/05 04:05
|
Joined: Sep 2004
Posts: 1,214 Austin, Texas
Josh_Arldt
OP
Senior Developer
|
OP
Senior Developer
Joined: Sep 2004
Posts: 1,214
Austin, Texas
|
Quote:
It's written in DirectX 8 syntax, should be in DirectX 9.
I am aware of this. I need to know what I need to change.
|
|
|
Re: error x3000!
[Re: Nadester]
#45334
05/07/05 14:34
05/07/05 14:34
|
Joined: Jul 2002
Posts: 2,813 U.S.
Nadester
Expert
|
Expert
Joined: Jul 2002
Posts: 2,813
U.S.
|
Havn't tested, but this might work: Code:
matrix matWorldViewProj; matrix matWorld; texture entSkin1; texture mtlSkin1; vector vecLight; technique dot3map { pass p0 { Texture[0] = <mtlSkin1>;//2te Skin im Model ist die Normal Map Texture[1] = <entSkin1>;//1te Skin im Model ist die Textur colorOp[0] = DotProduct3; colorArg1[0] = Texture; ColorArg2[0] = Diffuse; colorOp[1] = Modulate; colorArg1[1] = Texture; colorArg2[1] = Current; VertexShaderConstant[0]=<matWorldViewProj>; VertexShaderConstant[4]=<matWorld>; VertexShaderConstant[18]={1F,1F,1F,1F}; VertexShaderConstant[19]={0.5F,0.5F,0.5F,0.5F}; VertexShaderConstant[20]= <vecLight>; VertexShaderConstant[30]={0F,1F,0F,0F}; VertexShaderConstant[31]={1F,0F,0F,0F}; VertexShaderConstant[32]={0F,0F,1F,0F}; VertexShaderConstant[90]={1F,0F,0F,0F}; //damit oFog gefüllt ist VertexShader=asm { vs.1.0 Stream 0; dcl_position v0; //Position dcl_normal v3; //Normal dcl_texcoord0 v7; //Textur Koordinaten 0
m4x4 oPos, v0, c0 m4x4 r10,v0,c4 m3x3 r8,v3,c4 mov oT0, v7 mov oT1, v7 mov oT2, v7 mov oT3, v7 //calculate texture space matrix from normal and up mul r0,c31,v3.zxyw //-1,0,0 mul r1,c32,v3.yzxw //0,0,-1 sub r0,r1,r0 dp3 r0.w,r0,r0 rsq r0.w,r0.w mul r0,r0,r0.w //normalized right vector mov r1, c30 //0,-1,0 mov r2, r8 sub r9,c20,r10 dp3 r9.w,r9,r9 rsq r9.w,r9.w mul r9,r9,r9.w //normalized light vector m3x3 r3,r9,r0 mov r3.w,c30.w //transform light to texture space add r3,r3,c18 //bias mul r3,r3,c19//scale mov oD0,r3 mov oFog,c90 }; } }
--Eric
|
|
|
Re: error x3000!
[Re: Nadester]
#45335
05/07/05 15:35
05/07/05 15:35
|
Joined: Mar 2001
Posts: 3,298 Beverly, Massachusetts
Rhuarc
Expert
|
Expert
Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
|
Your error is in these: Code:
{1F,1F,1F,1F};
In dx9, any time that a number is followed by a 'f' (meaning float) it must have a decimal in the number, a simple fix is to change it to look like: Code:
{1.0f,1.0f,1.0f,1.0f};
Note- I have also changed the F's to f's, I'm not certain if dx9 recognizes them when uppercase. -Rhuarc
|
|
|
Re: error x3000!
[Re: Rhuarc]
#45340
05/07/05 22:07
05/07/05 22:07
|
Joined: Sep 2004
Posts: 1,214 Austin, Texas
Josh_Arldt
OP
Senior Developer
|
OP
Senior Developer
Joined: Sep 2004
Posts: 1,214
Austin, Texas
|
Quote:
Did you use the changes that Nadester mentioned, the variable declarations changed (note the decl_ lines he added and the decl {} that he removed)?
Oh, oops.
Now I changed that and I get: Quote:
Error in effect: rk_wall(29): error X2000: syntax error: unexpected token 'Stream' (37): error X5326: Read of uninitialized components(*) in v0: *x/0 *y/1 *z/2 *w/3 (38): error X5326: Read of uninitialized components(*) in v0: *x/0 *y/1 *z/2 *w/3 (39): error X5326: Read of uninitialized components(*) in v3: *x/0 *y/1 *z/2 *w/3 (40): error X5326: Read of uninitialized components(*) in v7: *x/0 *y/1 *z/2 *w/3 (41): error X5326: Read of uninitialized components(*) in v7: *x/0 *y/1 *z/2 *w/3 (42): error
Here is the changed code: Code:
matrix matWorldViewProj; matrix matWorld; texture entSkin1; texture mtlSkin1; vector vecLight; technique dot3map{ pass p0 { Texture[0] = <mtlSkin1>;//2te Skin im Model ist die Normal Map Texture[1] = <entSkin1>;//1te Skin im Model ist die Textur COLOROP[0] = DotProduct3; COLORARG1[0] = Texture; COLORARG2[0] = Diffuse; COLOROP[1] = Modulate; COLORARG1[1] = Texture; COLORARG2[1] = Current; VertexShaderConstant[0]=<matWorldViewProj>; VertexShaderConstant[4]=<matWorld>; VertexShaderConstant[18]={1.0f,1.0f,1.0f,1.0f}; VertexShaderConstant[19]={0.5f,0.5f,0.5f,0.5f}; VertexShaderConstant[20]= <vecLight>; VertexShaderConstant[30]={0.0f,1.0f,0.0f,0.0f}; VertexShaderConstant[31]={1.0f,0.0f,0.0f,0.0f}; VertexShaderConstant[32]={0.0f,0.0f,1.0f,0.0f}; VertexShaderConstant[90]={1.0f,0.0f,0.0f,0.0f}; //damit oFog gefüllt ist VertexShader = asm { vs.1.1 Stream 0; dcl_Position v0; //Position dcl_Normal v3; //Normal dcl_Texcoord0 v7; //Textur Koordinaten 0 //} //asm //{ //vs.1.1 m4x4 oPos, v0, c0 m4x4 r10,v0,c4 m3x3 r8,v3,c4 mov oT0, v7 mov oT1, v7 mov oT2, v7 mov oT3, v7 //calculate texture space matrix from normal and up mul r0,c31,v3.zxyw //-1,0,0 mul r1,c32,v3.yzxw //0,0,-1 sub r0,r1,r0 dp3 r0.w,r0,r0 rsq r0.w,r0.w mul r0,r0,r0.w //normalized right vector mov r1, c30 //0,-1,0 mov r2, r8 sub r9,c20,r10 dp3 r9.w,r9,r9 rsq r9.w,r9.w mul r9,r9,r9.w //normalized light vector m3x3 r3,r9,r0 mov r3.w,c30.w //transform light to texture space add r3,r3,c18 //bias mul r3,r3,c19//scale mov oD0,r3 mov oFog,c90 }; } }
|
|
|
|