⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m2.mht

📁 介绍魔兽世界M2具体压缩格式
💻 MHT
📖 第 1 页 / 共 5 页
字号:
<P>One model is of special interest, =
<TT>Creature/KelThuzad/KelThuzad.m2</TT>,=20
which is the only one that has an nL of 3, and has three texture units =
specified=20
for some of its submeshes. Sure enough, two of those map to 0 and 1, and =
one=20
maps to -1. </P>
<P>More confusion thanks to my favorite "weird" model,=20
<TT>World/Generic/Gnome/Passive =
Doodads/GnomeMachine/GnomeSubwayGlass.m2</TT>,=20
which is the translucent, environment mapped glass tunnel in the Deeprun =
Tram.=20
It only has a single value in this block, -1, which is used for the =
single=20
texture layer in both render operations in the model. This and the magic =
with=20
rendering flags/blend modes make up the neat transparent-reflective =
glass=20
effect, but confuse me even more about how envmapping and such is =
handled. (and=20
where it seems to get the bluish color from - is it in the model (no =
color=20
blocks in this particular model), the wmo, a solid background color, or =
simply=20
the result of the blending used?) </P>
<P>As a side note, on my (dated) system WoW does every texture unit in a =
single=20
pass. </P>
<P><BR></P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&amp;a=
ction=3Dedit&amp;section=3D19">edit</A>]</DIV><A=20
name=3DColors_and_transparency></A>
<H2>Colors and transparency </H2>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&amp;a=
ction=3Dedit&amp;section=3D20">edit</A>]</DIV><A=20
name=3DColors></A>
<H3>Colors </H3>
<P><I>nColors</I> records of 0x38 bytes starting at <I>ofsColors</I>, =
followed=20
by data referenced in these records. </P>
<P>For some swirling portals and volumetric lights, these define vertex =
colors.=20
Referenced from the Texture Unit blocks in the LOD part. Contains a =
separate=20
timeline for transparency values. If no animation is used, the given =
value is=20
assumed to be constant. </P>
<P><BR></P>
<TABLE class=3Dfileformat>
  <TBODY>
  <TR>
    <TH>Offset </TH>
    <TH>Type </TH>
    <TH>Description </TH></TR>
  <TR>
    <TD>0x00 </TD>
    <TD>AnimationBlock (float,float,float) </TD>
    <TD>Data for RGB color values </TD></TR>
  <TR>
    <TD>0x1C </TD>
    <TD>AnimationBlock (short) </TD>
    <TD>Data for opacity values </TD></TR></TBODY></TABLE>
<P><BR>Opacity values: 32767 =3D opaque, 0 =3D transparent. </P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&amp;a=
ction=3Dedit&amp;section=3D21">edit</A>]</DIV><A=20
name=3DTransparency_lookup_table></A>
<H3>Transparency lookup table </H3>
<P><I>nTransLookup</I> 16-bit integers starting at =
<I>ofsTransLookup</I>.=20
(values: 0 to <I>nH</I>-1&nbsp;?) </P>
<P>Contains indices into the Transparency block. Used by the texture =
unit=20
definitions in the LOD block. </P>
<P><BR></P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&amp;a=
ction=3Dedit&amp;section=3D22">edit</A>]</DIV><A=20
name=3DTransparency></A>
<H3>Transparency </H3>
<P>Specifies global transparency values (in addition to the values given =
in the=20
Color block - I assume these are multiplied together eventually?) </P>
<P><I>nTransparency</I> records of 0x1C bytes starting at=20
<I>ofsTransparency</I>, followed by data referenced in these records. =
</P>
<P><BR></P>
<TABLE class=3Dfileformat>
  <TBODY>
  <TR>
    <TH>Offset </TH>
    <TH>Type </TH>
    <TH>Description </TH></TR>
  <TR>
    <TD>0x00 </TD>
    <TD>AnimationBlock (short) </TD>
    <TD>Data for transparency values </TD></TR></TBODY></TABLE>
<P><BR>Transparency: 32767 for fully opaque, 0 for fully transparent =
</P>
<P><BR></P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&amp;a=
ction=3Dedit&amp;section=3D23">edit</A>]</DIV><A=20
name=3DTextures></A>
<H2>Textures </H2>
<P>Textures are defined globally in a list, additionally, a lookup table =
is=20
given, referenced during rendering, to select textures. </P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&amp;a=
ction=3Dedit&amp;section=3D24">edit</A>]</DIV><A=20
name=3DTexture_lookup_table></A>
<H3>Texture lookup table </H3>
<P>Just a list of 16-bit integers. <I>nTexLookup</I> items starting at=20
<I>ofsTexLookup</I>. </P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&amp;a=
ction=3Dedit&amp;section=3D25">edit</A>]</DIV><A=20
name=3DTexture_definitions></A>
<H3>Texture definitions </H3>
<P>First is a list of <I>nTextures</I> texture definition records, 16 =
bytes per=20
record, starting at <I>ofsTextures</I>. After it comes a string block =
with the=20
texture filenames. </P>
<P><BR></P>
<TABLE class=3Dfileformat>
  <TBODY>
  <TR>
    <TH>Offset </TH>
    <TH>Type </TH>
    <TH>Description </TH></TR>
  <TR>
    <TD>0x00 </TD>
    <TD>uint32 </TD>
    <TD>Texture type (aka replacable id) </TD></TR>
  <TR>
    <TD>0x04 </TD>
    <TD>uint16 </TD>
    <TD>Unknown, usually 0 </TD></TR>
  <TR>
    <TD>0x06 </TD>
    <TD>uint16 </TD>
    <TD>Flags </TD></TR>
  <TR>
    <TD>0x08 </TD>
    <TD>uint32 </TD>
    <TD>Filename length </TD></TR>
  <TR>
    <TD>0x0C </TD>
    <TD>uint32 </TD>
    <TD>Offset to filename </TD></TR></TBODY></TABLE>
<P><BR>Texture type is 0 for regular textures, nonzero for skinned =
textures=20
(filename not referenced in the M2 file!) For instance, in the =
NightElfFemale=20
model, her eye glow is a type 0 texture and has a file name, the other 3 =

textures have types of 1, 2 and 6. The texture filenames for these come =
from=20
client database files: </P>
<P><TT><A title=3DDBFilesClient\CharSections.dbc=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php/DBFilesClient\Ch=
arSections.dbc">DBFilesClient\CharSections.dbc</A><BR><A=20
title=3DDBFilesClient\CreatureDisplayInfo.dbc=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php/DBFilesClient\Cr=
eatureDisplayInfo.dbc">DBFilesClient\CreatureDisplayInfo.dbc</A><BR><A=20
title=3DDBFilesClient\ItemDisplayInfo.dbc=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php/DBFilesClient\It=
emDisplayInfo.dbc">DBFilesClient\ItemDisplayInfo.dbc</A><BR></P>
<P></TT>(possibly more) </P>
<P><BR></P>
<TABLE class=3Dfileformat>
  <TBODY>
  <TR>
    <TH>Value </TH>
    <TH>Meaning </TH></TR>
  <TR>
    <TD>0 </TD>
    <TD>Texture given in filename </TD></TR>
  <TR>
    <TD>1 </TD>
    <TD>Body + clothes </TD></TR>
  <TR>
    <TD>2 </TD>
    <TD>Cape </TD></TR>
  <TR>
    <TD>6 </TD>
    <TD>Hair, beard </TD></TR>
  <TR>
    <TD>8 </TD>
    <TD>Tauren fur </TD></TR>
  <TR>
    <TD>11 </TD>
    <TD>Skin for creatures </TD></TR>
  <TR>
    <TD>12 </TD>
    <TD>Skin for creatures #2 </TD></TR>
  <TR>
    <TD>13 </TD>
    <TD>Skin for creatures #3 </TD></TR></TBODY></TABLE>
<P><BR></P>
<P>Flags: </P>
<TABLE class=3Dfileformat>
  <TBODY>
  <TR>
    <TH>Value </TH>
    <TH>Meaning </TH></TR>
  <TR>
    <TD>1 </TD>
    <TD>Texture wrap X </TD></TR>
  <TR>
    <TD>2 </TD>
    <TD>Texture wrap Y </TD></TR></TBODY></TABLE>
<P><BR></P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&amp;a=
ction=3Dedit&amp;section=3D26">edit</A>]</DIV><A=20
name=3DTexture_animation_lookup_table></A>
<H3>Texture animation lookup table </H3>
<P><I>nTexAnimLookup</I> 16-bit integers starting at =
<I>ofsTexAnimLookup</I>.=20
(values: -1, 0 to <I>nTexAnims</I>-1) </P>
<P>Contain indices into the texture animations list, or -1 meaning a =
static=20
texture. </P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&amp;a=
ction=3Dedit&amp;section=3D27">edit</A>]</DIV><A=20
name=3DTexture_animations></A>
<H3>Texture animations </H3>
<P>This block contains definitions for texture animations, for example, =
flowing=20
water or lava in some models. The keyframe values are used in the =
texture=20
transform matrix. </P>
<P><I>nTexAnims</I> records of 0x54 bytes starting at =
<I>ofsTexAnims</I>,=20
followed by data referenced in these records. </P>
<P><BR></P>
<TABLE class=3Dfileformat>
  <TBODY>
  <TR>
    <TH>Offset </TH>
    <TH>Type </TH>
    <TH>Description </TH></TR>
  <TR>
    <TD>0x00 </TD>
    <TD>AnimationBlock (float, float, float) </TD>
    <TD>Translation </TD></TR>
  <TR>
    <TD>0x1C </TD>
    <TD>AnimationBlock (float, float, float&nbsp;???) </TD>
    <TD>Rotation? </TD></TR>
  <TR>
    <TD>0x38 </TD>
    <TD>AnimationBlock (float, float, float) </TD>
    <TD>Scaling? </TD></TR></TBODY></TABLE>
<P>The three subrecords specify texture transforms. Translation seems to =
work,=20
producing nice flowing lava and waterfalls. </P>
<P><BR></P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&amp;a=
ction=3Dedit&amp;section=3D28">edit</A>]</DIV><A=20
name=3DEffects></A>
<H1>Effects </H1>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&amp;a=
ction=3Dedit&amp;section=3D29">edit</A>]</DIV><A=20
name=3DRibbon_emitters></A>
<H2>Ribbon emitters </H2>
<P><I>nRibbonEmitters</I> records of 0xDC bytes starting at=20
<I>ofsRibbonEmitters</I>, followed by data referenced in these records. =
</P>
<P>These are called ribbon emitters in the strings buried in wow.exe. I =
guess=20
these are some sort of ribbon-like visual effects similar to particles. =
In=20
Warcraft 3 (of which the WoW engine is quite loosely based off of) there =
was=20
also the possibility of ribbon-like effects in trails and flowing =
clothing. This=20
is also how in WoW the feathers of the gryphons, hippogryphs, and bats =
flow in=20
the wind as you rise and descend. </P>
<P>Note: the models that contain ribbon emitters and are viewable in the =
game=20
world are: wisps in BFD, and <A class=3Dexternal=20
title=3Dhttp://wowmapview.sourceforge.net/ribbon.jpg=20
href=3D"http://wowmapview.sourceforge.net/ribbon.jpg" =
rel=3Dnofollow>energy=20
trails</A><SPAN=20
class=3Durlexpansion>&nbsp;(<I>http://wowmapview.sourceforge.net/ribbon.j=
pg</I>)</SPAN>=20
in the COT (not the actual instance, but the entrance cave in Tanaris =
Desert).=20
The only other models with ribbon emitters are spells and effects. =
Gryphons/etc=20
don't have ribbon emitters, the feathers are part of their geometry. =
</P>
<P>What about the ribbons in the model of the Ziggurat (or spirit tower, =
haven't=20
played warcraft 3 in awhile) that seem to swirl around the Ziggurat's =
crystal in=20
Stratholme? (It's probably a good idea to play this in WoW to see what =
i'm=20
talking about.) -DG </P>
<UL>
  <LI>must be one of those server-side specified objects because I can't =
see=20
  them in wowmapview. </LI></UL>
<P><BR>The records have the following structure: </P>
<P><BR></P>
<TABLE class=3Dfileformat>
  <TBODY>
  <TR>
    <TH>Offset </TH>
    <TH>Type </TH>
    <TH>Description </TH></TR>
  <TR>
    <TD>0x00 </TD>
    <TD>int32 </TD>
    <TD>ID? always -1 </TD></TR>
  <TR>
    <TD>0x04 </TD>
    <TD>int32 </TD>
    <TD>Bone ID </TD></TR>
  <TR>
    <TD>0x08 </TD>
    <TD>float[3] </TD>
    <TD>position </TD></TR>
  <TR>
    <TD>0x14 </TD>
    <TD>int32 </TD>
    <TD>Number of texture refs </TD></TR>
  <TR>
    <TD>0x18 </TD>
    <TD>int32 </TD>
    <TD>Offset to texture refs (ints) </TD></TR>
  <TR>
    <TD>0x1C </TD>
    <TD>int32 </TD>
    <TD>Number of ints #2 </TD></TR>
  <TR>
    <TD>0x20 </TD>
    <TD>int32 </TD>
    <TD>Offset to list of ints #2 </TD></TR>
  <TR>
    <TD>0x24 </TD>
    <TD>AnimationBlock (float, float, float) </TD>
    <TD>Color </TD></TR>
  <TR>
    <TD>0x40 </TD>
    <TD>AnimationBlock (short) </TD>
    <TD>Opacity </TD></TR>
  <TR>
    <TD>0x5C </TD>
    <TD>AnimationBlock (float) </TD>
    <TD>Height above </TD></TR>
  <TR>
    <TD>0x78 </TD>
    <TD>AnimationBlock (float) </TD>
    <TD>Height below </TD></TR>
  <TR>
    <TD>0x94 </TD>
    <TD>float </TD>
    <TD>Something about length/lifespan? </TD></TR>
  <TR>
    <TD>0x98 </TD>
    <TD>float </TD>
    <TD>Something about length/lifespan? </TD></TR>
  <TR>
    <TD>0x9C </TD>
    <TD>float </TD>
    <TD>Usually 0 </TD></TR>
  <TR>
    <TD>0xA0 </TD>
    <TD>short[2] </TD>
    <TD>(blending modes maybe?) (1,1) </TD></TR>
  <TR>
    <TD>0xA4 </TD>
    <TD>AnimationBlock (int) </TD>
    <TD>&nbsp;? (always 0) </TD></TR>
  <TR>
    <TD>0xC0 </TD>
    <TD>AnimationBlock (int) </TD>
    <TD>&nbsp;? (always 1) </TD></TR></TBODY></TABLE>
<P><BR>Parameters from the MDL format that are probably in here =
somewhere: life=20
span, emission rate, rows, cols ...? </P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&amp;a=
ction=3Dedit&amp;section=3D30">edit</A>]</DIV><A=20
name=3DParticle_emitters></A>
<H2>Particle emitters </H2>
<P><I>nparticleEmitters</I> records of 0x1F8 bytes starting at=20
<I>ofsParticleEmitters</I>, followed by data referenced in these =
records. </P>
<P>The records have the following structure: </P>
<P><BR></P>
<TABLE class=3Dfileformat>
  <TBODY>
  <TR>
    <TH>Offset </TH>
    <TH>Type </TH>
    <TH>Description </TH></TR>
  <TR>
    <TD>0x000 </TD>
    <TD>int32 </TD>
    <TD>id (always -1?) </TD></TR>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -