Aller au contenu

Photo

Does anyone understand these normal maps?


  • Veuillez vous connecter pour répondre
9 réponses à ce sujet

#1
Redfender

Redfender
  • Members
  • 33 messages
You'll have to forgive me, I'm used to Oblivion normal maps.  I'm used to each channel representing up/down, left/right, and depth.  I'm using that kind of map right now on my own sword and its not working with the graphics engine correctly, like not reflecting light properly.  Looking at the channels of the game's stock maps, the RGB channels seem to be basically the same. while the alpha channel is different.  Is the RGB a grayscale normal map?  And then whats the alpha for?

Please help

#2
Redfender

Redfender
  • Members
  • 33 messages
err nevermind i found the answer

To quote DarthParametric:

"w_lsw_ls01a_0n <- Normal map. Bioware (for some reason) use a screwy non-standard normal map. A regular normal map is RGB, the channels representing X, Y, and Z respectively. Bioware however use a 4 channel image but only effectively use 2 channels. X is in the Alpha channel and Y is duplicated across the RGB channels. The only reason seems to be to make our life more difficult."



So why don't they care about the z? is it combined with one of the other directions?


#3
Redfender

Redfender
  • Members
  • 33 messages
actually i think y (up/down) is in the alpha and left/right is in RGB. or at least that way it seems to be lighting correctly in the game for me.

#4
Redfender

Redfender
  • Members
  • 33 messages
oh brother its still not lighting right. do i need to include this LM.dds in my resource file?

#5
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
Try this in your model's MAO:

<MaterialObject Name="[i][color="#ff0000"]name[/color][/i]">
    <Material Name="Static.mat"></Material>
    <DefaultSemantic Name="Default"></DefaultSemantic>
    <Texture Name="mml_tDiffuse" ResName="[color="#ff0000"]diffuse_map[/color].dds"></Texture>
    <Texture Name="mml_tNormalMap" ResName="[color="#ff0000"]normal_map[/color].dds"></Texture>
    <Texture Name="mml_tLightmap" ResName="LM.dds" RequiresID="true"></Texture>
</MaterialObject>

I'm still experimenting, but in a test I did last night I did seem to get a normal map working properly on a custom level model using this.

Modifié par DarthParametric, 05 janvier 2010 - 08:01 .


#6
Redfender

Redfender
  • Members
  • 33 messages
okay. is the red supposed to be replaced by my names, or are you saying to use those names literally?  i have my .mao set up similarly already.  its weird, because the diffuse reflection from sunlight seems to be correct, but diffuse reflections from say a camp fire don't seem to work at all, while specular reflections do.

thanks

Modifié par Redfender, 05 janvier 2010 - 04:07 .


#7
Redfender

Redfender
  • Members
  • 33 messages
p.s.

i was thinking about why they don't include depth in the normal map and thats probably because you can calculate depth im guessing off of the x and y.

i wonder if anybody familiar with coding python could work out a script that only bakes out the x and y directions in blender instead of all directions. of course i guess you record an action in photoshop to do it. anyway it still creates an extra step.

#8
DarthParametric

DarthParametric
  • Members
  • 1 409 messages

Redfender wrote...

okay. is the red supposed to be replaced by my names

Yes, replace with your filenames.

#9
tmp7704

tmp7704
  • Members
  • 11 156 messages

Redfender wrote...

So why don't they care about the z? is it combined with one of the other directions?

Dragon Age normal maps most likely use the DXT5 compression format to achieve better quality results compared to the "regular" normal maps. It's the same trick used in Doom 3 -- the X component of the vector is stored in the Alpha channel, the Y is stored in Green channel which has 6 bits of fidelity compared to 5 bits in Red and Blue channels and the Z is rebuilt on the fly by the shader from the other two components (the normal vectors are supposed to have length of 1.0 so it's matter of pretty simple math)

You can read the details in nVidia paper here: http://http.download...Compression.pdf

pages 7 and 8, specifically.

#10
Redfender

Redfender
  • Members
  • 33 messages
i somehow got the model reflecting light properly. i think it had to do with the xml in my mao ultimately. although i still have the mesh smoothing problem i mentioned in a previous post. but its progress.
anyway if anybody wonders what my fully working mao finally looks like I basically ended writing over the mao i got from tazpn's tool with a stock mao and changed the file names:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MaterialObject Name="w_lsw_ka01a_0">
     <Material Name="Weapon.mat"></Material>
     <Texture Name="mml_tLightmap" ResName="LM.dds" RequiresID="true"></Texture>
     <Texture Name="mml_tDiffuse" ResName="w_lsw_ka01a_0d.dds"></Texture>
     <Texture Name="mml_tNormalMap" ResName="w_lsw_ka01a_0n.dds"></Texture>
 <Texture Name="mml_tSpecularMask" ResName="w_lsw_ka01a_0s.dds"></Texture>
 <Vector4f Name="mml_vFalloffParams" value="0.00 1.00 1.29 1.02"></Vector4f>
 <Float Name="mml_fSpecularReflectionMult" value="0.50"></Float>
</MaterialObject>

Probably could have done that all along instead of trying to come up with a working file myself.

Modifié par Redfender, 06 janvier 2010 - 03:07 .