Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, ozgur), 1,392 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 5 1 2 3 4 5
Re: Normal Maps? [Re: ello] #29634
06/30/04 22:41
06/30/04 22:41
Joined: Oct 2003
Posts: 1,258
Virginia, USA
qwerty823 Offline
Senior Developer
qwerty823  Offline
Senior Developer

Joined: Oct 2003
Posts: 1,258
Virginia, USA
Quote:

hmm, could it be, that your normal map has to be inverted. seems that it uses the lightdirection mirrored , or that you need to change something in the shader.




There are some options in Melody that control things like whether the Y axis or Z axis is up, which I haven't played with. I know in 3dgs the Z axis is up, but in DX coords, i believe that Y is up, and I think thats what I'm using, since I'm pretty sure shaders do all there stuff in DX space. There could be other settings that are wrong as well, and who knows, the shader I'm using probably isn's exactly meant for this either. While it might not work exactly, it does seem to offer a level of detail that the original model doesnt have, even if the lighting to it is wrong. I guess maybe its a bad example, but still better than nothing.

I'm all for you or someone else to "one up" me and make something better.

Quote:

what program are you talking about? i did a search on "melody" but got no usable results *you know why*

can you provide a link or something?




For you ello, absolutely!

http://developer.nvidia.com/object/melody_home.html


Never argue with an idiot. They drag you down to their level then beat you with experience
Re: Normal Maps? [Re: qwerty823] #29635
06/30/04 22:56
06/30/04 22:56
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, thanx!

btw, does anybody know what happend to the nveffectbrowser? does anyone have it for download still?

Re: Normal Maps? [Re: ello] #29636
07/01/04 00:09
07/01/04 00:09

A
Anonymous
Unregistered
Anonymous
Unregistered
A



I'm extra happy now. I've searched arround - and I'm beginning to understand how to do this.

I've got NVidia's Melody, and so I'll be able to generate the normal maps from my high and low poly models (by using melody).

Then I'm right in thinking I take the low poly model into MED. I have the texture skin, and the normal map skin and, I found this on another thread, is this the code I need to use?? (as the thread was partly german I got a little confused - but I think I understood correctly that this is a correct version of normal mapping code?).

Code:


MATERIAL bumpmap

{

effect

"

matrix matWorldViewProj;

matrix matWorld;



texture entSkin1;

texture entSkin2;



vector vecLight;



technique dot3map

{

pass p0

{

Texture[0] = <entSkin2>;//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

};

}

}

";

}




action Shader_bumpmap

{

my.material=bumpmap;

}




and I would give that action to the model correct?

OK, my only question is, there is reference to

"Texture[0] = <entSkin2>;//2te Skin im Model ist die Normal Map

Texture[1] = <entSkin1>;//1te Skin im Model ist die Textur"

entSkin2 and 1 being previously defined textures. How do I tell WED/A6/SED/C-Script/MED (whichever needs to know) which texture texture [0] is and which one texture [1] is?

Do I have to assign two skins in MED? the normal map into skin 2 and the actual texture into 1? Have I red this correctly - and if so, how do I do this?

That is the only part I'm stuck on - assigning the two textures to the model, I'm confused as to if I should do this in MED (and if so, how do I assign a second?) or if I have to do it through C-Script.

Thankyou for being patient with me all these times I ask (what to you must seem) basic questions.

Thanks.


Re: Normal Maps? [Re: ] #29637
07/01/04 04:09
07/01/04 04:09
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
A problem im having with Melody,which is HUGE, is not having the ability to keep my UVW coords from max.
Since I texture bake my characters in max, they have very specific uvw info that actually exports to MDL perfectly.
Thing is, when I export my model as .3ds or .obj into melody , I cant seem to hang onto this info. Melody does a great job of creating new uvw coords for the normal map, so I can export it out to med no problem, model and/or normal map. I did try keeping on the skins mapping coords, but they are scrambled... so if anyne know a way to keep my max uvw info all the way into MED, while creating a normal map that can be imported into skin2 without killing skin1's uvw mapping. the person who can get this to work gets a gold star Im still trying... there is a way, just needs testing... BTW , I did get this to work from polybump, so I know it works great, just that polybump is a demo...


Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: Normal Maps? [Re: Drew] #29638
07/01/04 04:18
07/01/04 04:18
Joined: Feb 2003
Posts: 2,826
Margaritaville (Redneck Rivier...
myrlyn68 Offline
Senior Expert
myrlyn68  Offline
Senior Expert

Joined: Feb 2003
Posts: 2,826
Margaritaville (Redneck Rivier...
Are you doing your UVs by hand or just let Max auto-unwrap during the baking process?

If you are using Max to auto-unwrap...why not just have Melody go ahead and do its thing (with messing up your UVs and creating its own) then bring that model back into Max and bake (while disabling the auto-unwrap in Max's Texture Bake).

Just a thought...

I was going to try that out myself (and maybe see if I couldn't figure out the problem you were having specifically...as I don't recall it myself) but my Laptop doesn't support the needed shader version - and I haven't bothered to set my computers back up yet...maybe I'll play abit with it tonight.


Virtual Worlds - Rebuilding the Universe one Pixel at a Time. Take a look - daily news and weekly content updates.
Re: Normal Maps? [Re: myrlyn68] #29639
07/01/04 06:24
07/01/04 06:24
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
sounds like an awesome idea, thanks Ill try it tonight!

heres a shot I had lying around that shows off the difference in models with and without normal maps..heads on the right side are 700 polys (all the heads top to bottom on the right).. the left side head is 120,652!!


edit

Last edited by Drew; 07/01/04 20:15.

Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: Normal Maps? [Re: Drew] #29640
07/01/04 16:12
07/01/04 16:12

A
Anonymous
Unregistered
Anonymous
Unregistered
A



I'm finally getting this - but I don't know how to put 2 skins on a model in MED? Can anyone say how, I've never tried and don't know where to look.

Re: Normal Maps? [Re: ] #29641
07/01/04 20:14
07/01/04 20:14
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
New shot using normal maps from Melody, IN A6 ...FUN




Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: Normal Maps? [Re: Drew] #29642
07/02/04 18:31
07/02/04 18:31
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


Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: Normal Maps? [Re: Drew] #29643
07/02/04 20:59
07/02/04 20:59
Joined: Nov 2003
Posts: 677
There
Julius Offline
Developer
Julius  Offline
Developer

Joined: Nov 2003
Posts: 677
There
Like I said in the other post, "awesome!"

Very nice

Julian


flabadabadab.
Page 4 of 5 1 2 3 4 5

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | 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