What's new

Metroid Prime 3 Models

antidote

New member
So I got back into hacking Metroid Prime recently, and decided to tackle MP3 which we were unable to get rendering consistently and discovered something rather silly of us to not to notice: Retro had swapped the Vertex and Normal indices in the face definitions!

Knowing that I was able to get this:
MP3Gunship.png
 

revel8n

New member
The vertex/normal indices are not swapped.

There are some models that include matrix indices in their vertex attribute definitions. These one-byte indices come before the vertex and matrix attributes so the vertex index etc. simply come later in the display list entries.

In MP1/2 the attribute definition value comes after the the texture index array in the Material Groups. You have probably seen the value of the form: 0x00003F0F.

In MP3 the attribute definition value comes at offset 0x0C in the Material Group data.

They work mostly the same, but there is a slight difference with MP2/MP3.

For MP1 all 4 bytes are actually separate 2-bit "presence" indicators specifying which elements have indices in the vertex attribute definitions. They come in the standard order that values for vertex attributes are defined:
position, normal, color0, color1, Tex0-7, etc.

The value is either 3 or 0 to indicate included or excluded in the vertex attribute definition respectively.

MP2/MP3 are the same as MP1, but only for the first 3 bytes, and they are now actual attribute data type specifiers: 3 - uint16 index, 2 - uint8 index, or not present.
The 4th byte is treated as (8) 1-bit indicators. Have not determined the order for these yet, but they are the reason some of the meshes do not show with the former code. These one-byte indices appear first in the vertex attribute entries in the display lists.
 
Last edited:
OP
A

antidote

New member
It's odd that it displays, but I see what you're saying now, fraking weird it works at all.
 
Last edited:
OP
A

antidote

New member
PED.png


Thanks to revel8n, MP3 models are now properly supported.


We also have a logo for the program now:
MPxViewer.png
 

flarespire

New member
Nice work so far! I'm glad to see that this has been picked up again.
One question though, are you still using OpenGL to render these models within the program or are you using DirectX?
Anyway, nice work and I can't wait to see how this progresses. :D
 
OP
A

antidote

New member
We're still using OpenGL as I pretty much use Linux exclusively, unfortunately I'm not very experienced with OpenGL and most everything is really hacky and uses the fixed function pipeline, I could really use some help getting it to be OpenGL 3.

Heck, just today I managed to get multitexturing to work xD.
 
OP
A

antidote

New member
Anyone recognize this little guy from MP2?
Because I certainly don't
MP2_critter.png


- - - Updated - - -

I've found out what it is, it's the Metaree!!!
In it's ANCS file, in Metroid3.pak (Agon Waste) look for 18CAC5E6.ANCS, look for 0xF989375C, that value is the model.
 
Last edited:

Top