Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, AndrewAMD, NewbieZorro), 16,655 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
normap question about A6.2 and rendermonkey? #26980
05/06/04 03:25
05/06/04 03:25
Joined: May 2004
Posts: 14
B
bulljack Offline OP
Newbie
bulljack  Offline OP
Newbie
B

Joined: May 2004
Posts: 14
I have written a code of diffuse shade, which using lowpoly and tangentspace normalmap.I have used the same code in rendermonkey and A6.2,but I got better effect in rendermonkey than in the A6.2.Who can tell me what the reason is? Is it the problem of this code or A6.2? I would appreciate if anyone can tell me the reason.

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
B
bulljack Offline OP
Newbie
bulljack  Offline OP
Newbie
B

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 Offline
Senior Developer
qwerty823  Offline
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: qwerty823] #26983
05/06/04 05:45
05/06/04 05:45
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Drew Offline
Serious User
Drew  Offline
Serious User

Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
NORMAL MAPPING...DROOL.... please post final code if possible!!



Re: normap question about A6.2 and rendermonkey? [Re: Drew] #26984
05/06/04 06:39
05/06/04 06:39
Joined: Oct 2000
Posts: 1,543
Germany
A
Alexander Esslinger Offline
Senior Developer
Alexander Esslinger  Offline
Senior Developer
A

Joined: Oct 2000
Posts: 1,543
Germany
What's so funny?

Re: normap question about A6.2 and rendermonkey? [Re: qwerty823] #26985
05/06/04 15:47
05/06/04 15:47
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
querty, at the moment this doesnot matter. the stream gives us the data in a certain order (position, normal/uv/tangent) no matter which numbers (i have tested this out).

but in books you find different information , there are up to 16 different datas in the stream, which btw. would be very useful to have.

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
B
bulljack Offline OP
Newbie
bulljack  Offline OP
Newbie
B

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
B
bulljack Offline OP
Newbie
bulljack  Offline OP
Newbie
B

Joined: May 2004
Posts: 14


Re: normap question about A6.2 and rendermonkey? [Re: bulljack] #26988
05/06/04 20:58
05/06/04 20:58
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
hey, i use this model too for my experiments. its very good for such purposes

maybe you should mention this in the bug forum since it could be a bug


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: normap question about A6.2 and rendermonkey? [Re: ello] #26989
05/06/04 21:11
05/06/04 21:11
Joined: Oct 2000
Posts: 1,543
Germany
A
Alexander Esslinger Offline
Senior Developer
Alexander Esslinger  Offline
Senior Developer
A

Joined: Oct 2000
Posts: 1,543
Germany
Try using a 32bit TGA for your normalmap.

Page 1 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1