It is currently Fri Aug 22, 2014 10:48 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 69 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
PostPosted: Wed Mar 26, 2014 9:13 am 
Offline
Registered Member

Joined: Sun Sep 08, 2013 10:49 am
Posts: 85
majestic wrote:
Heh nice :) I'm currently working on my own verticies welding script to reduce amount of vertices in the model (I can't use meshop.deleteIsoVerts I think you know why). I can't use 3ds-max welding tool because it welds all vertices, but I need to weld only certain vertices to make the model looks like original one and also DFF IO can't export normals properly from the mesh builded from separate triangle strips without some corrections into DFF export script.
Here comparsion:

Image

Looks good, man!

I really do not know why you can't use meshop.deleteIsoVerts .
I can use this function to remove 443 vertices.(original have 3506 vertices)

You only need to remove an equal vertices and vertices not used by a face.


Top
 Profile  
 
PostPosted: Wed Mar 26, 2014 10:36 am 
Offline
Registered Member
User avatar

Joined: Tue Sep 03, 2013 10:51 am
Posts: 274
Location: HEXadecimal World :)
meshop.deleteIsoVerts totally broke normals in my mesh, but after welding vertices I can do anyhing with the mesh. Anyway output welded model looks like original one.

Middle model - welded with 3ds max tools. Other two - original and welded with my algorithm. Can you guess which one from those two is original? :)
Image

_________________
Image

Download PS2 to PC BSP Converter (PS2 Beta/Retail)
Download Complete Mace Mod (PC)
Download Manhunt 2 TEX/TXD Editor (PC,PS2,PSP,Wii support)
Download Manhunt 2 BSP Importer v1.0 (PC)
Download Manhunt 2 TEX WorkShop v1.1 (PC)


Top
 Profile  
 
PostPosted: Thu Mar 27, 2014 7:34 am 
Offline
Registered Member

Joined: Sun Sep 08, 2013 10:49 am
Posts: 85
majestic wrote:
meshop.deleteIsoVerts totally broke normals in my mesh, but after welding vertices I can do anyhing with the mesh. Anyway output welded model looks like original one.

Middle model - welded with 3ds max tools. Other two - original and welded with my algorithm. Can you guess which one from those two is original? :)
Image


To be honest,Can't see what is different on both sides. Well done! :lol:
I do not think meshop.deleteIsoVerts would broken normal.
left is original,right is After execution. :wink:
Image


Top
 Profile  
 
PostPosted: Thu Mar 27, 2014 9:39 am 
Offline
Registered Member
User avatar

Joined: Tue Sep 03, 2013 10:51 am
Posts: 274
Location: HEXadecimal World :)
Hm strange. Here imported Leo through my old MH2 PS2 mesh importer which I have used for converting some beta stuff to PC. Originally model should look like that in render (except flipped faces of course :) ):
Image
And only after "execution" that model will look like on your screen. Seems you already broke normals while importing mesh.

Also I notice you found a solution for flipped faces already?

_________________
Image

Download PS2 to PC BSP Converter (PS2 Beta/Retail)
Download Complete Mace Mod (PC)
Download Manhunt 2 TEX/TXD Editor (PC,PS2,PSP,Wii support)
Download Manhunt 2 BSP Importer v1.0 (PC)
Download Manhunt 2 TEX WorkShop v1.1 (PC)


Top
 Profile  
 
PostPosted: Thu Mar 27, 2014 10:41 am 
Offline
Registered Member

Joined: Sun Sep 08, 2013 10:49 am
Posts: 85
majestic wrote:
Hm strange. Here imported Leo through my old MH2 PS2 mesh importer which I have used for converting some beta stuff to PC. Originally model should look like that in render (except flipped faces of course :) ):
Image
And only after "execution" that model will look like on your screen. Seems you already broke normals while importing mesh.

Also I notice you found a solution for flipped faces already?


Perhaps this is the cause of the error:
1.In the code below I had just added a "update msh", this function resets the normals.
2.There is another reason: When I give mesh a texture map will appear this problem.
3.After the execution would indeed destroy normal. :P

Like this? This should be a correct normal!
Image

Yes, I have a solution, but like I said, some models face still have this problem. Not 100% solved!
I can send you solution by bbs PM .I do not want published. Not to the time.Because I did not publish the new script .:)


Top
 Profile  
 
PostPosted: Thu Mar 27, 2014 11:14 am 
Offline
Registered Member
User avatar

Joined: Tue Sep 03, 2013 10:51 am
Posts: 274
Location: HEXadecimal World :)
Normals destroying because seems after any meshop 3ds max update the mesh what causes normals reset. So I don't use any meshop because of that. Interesting that when I choose "Skin" modifier in stack - all normals recalculating and fucked up, but if I select "Editable Mesh" all original normals are back again :)

Can you send to me your solution for flipped faces?

_________________
Image

Download PS2 to PC BSP Converter (PS2 Beta/Retail)
Download Complete Mace Mod (PC)
Download Manhunt 2 TEX/TXD Editor (PC,PS2,PSP,Wii support)
Download Manhunt 2 BSP Importer v1.0 (PC)
Download Manhunt 2 TEX WorkShop v1.1 (PC)


Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 11:05 pm 
Offline
Registered Member
User avatar

Joined: Tue Sep 03, 2013 10:51 am
Posts: 274
Location: HEXadecimal World :)
Here another Vcolor decoding script for PSP:

Code:
VertColor = ReadShort MDL #unsigned               
VertColorRed = (bit.and VertColor 0x001F)*8
VertColorGreen = (bit.shift (bit.and VertColor 0x03E0) -5)*8
VertColorBlue = (bit.shift (bit.and VertColor 0x7C00) -10)*8
VertColorAlpha = (bit.shift (bit.and VertColor 0x8000) -15)*255


Code written by me so you can use it if you want instead of previous code which I took from MDL Importer by AK-73.

Also this may help you to reduce your code:

VertexElementTypesPS2:

Code:
VertexDataFlags = ReadByte MDL

ModelHasSkinData = bit.get VertexDataFlags 5
ModelHasNormals = bit.get VertexDataFlags 2
ModelHasVCol = bit.get VertexDataFlags 4
Models always have UV so constantly ModelHaveUV = true


VertexElementTypesPSP:

Code:
VertexDataFlags = ReadByte MDL
ReadByte MDL
SkinFlag = ReadByte MDL #unsigned

SmallCoords = bit.get VertexDataFlags 8 //In GTA models of weapons use signed bytes instead of signed shorts to store vertex coords. You'll need to divide them to 127.0 like normals to get coords. Maybe Manhunt2 don't use that way to store coords at all but who knows :)
ModelHasNormals = bit.get VertexDataFlags 6
ModelHasUV = bit.get VertexDataFlags 1 // In few models in GTA I have noticed no UV data. I don't know maybe some Manhunt2 models have no UV too
ModelHasVCol = bit.get VertexDataFlags 3
if SkinFlag>1 then ModelHasSkinData= true


Check other bytes to determine other vertex element types. In GTA seems to be used only these

Hope this helps you somehow

_________________
Image

Download PS2 to PC BSP Converter (PS2 Beta/Retail)
Download Complete Mace Mod (PC)
Download Manhunt 2 TEX/TXD Editor (PC,PS2,PSP,Wii support)
Download Manhunt 2 BSP Importer v1.0 (PC)
Download Manhunt 2 TEX WorkShop v1.1 (PC)


Top
 Profile  
 
PostPosted: Sat Apr 12, 2014 1:55 pm 
Offline
Registered Member

Joined: Sun Sep 08, 2013 10:49 am
Posts: 85
majestic wrote:
Here another Vcolor decoding script for PSP:

Code:
VertColor = ReadShort MDL #unsigned               
VertColorRed = (bit.and VertColor 0x001F)*8
VertColorGreen = (bit.shift (bit.and VertColor 0x03E0) -5)*8
VertColorBlue = (bit.shift (bit.and VertColor 0x7C00) -10)*8
VertColorAlpha = (bit.shift (bit.and VertColor 0x8000) -15)*255


Code written by me so you can use it if you want instead of previous code which I took from MDL Importer by AK-73.

Also this may help you to reduce your code:

VertexElementTypesPS2:

Code:
VertexDataFlags = ReadByte MDL

ModelHasSkinData = bit.get VertexDataFlags 5
ModelHasNormals = bit.get VertexDataFlags 2
ModelHasVCol = bit.get VertexDataFlags 4
Models always have UV so constantly ModelHaveUV = true


VertexElementTypesPSP:

Code:
VertexDataFlags = ReadByte MDL
ReadByte MDL
SkinFlag = ReadByte MDL #unsigned

SmallCoords = bit.get VertexDataFlags 8 //In GTA models of weapons use signed bytes instead of signed shorts to store vertex coords. You'll need to divide them to 127.0 like normals to get coords. Maybe Manhunt2 don't use that way to store coords at all but who knows :)
ModelHasNormals = bit.get VertexDataFlags 6
ModelHasUV = bit.get VertexDataFlags 1 // In few models in GTA I have noticed no UV data. I don't know maybe some Manhunt2 models have no UV too
ModelHasVCol = bit.get VertexDataFlags 3
if SkinFlag>1 then ModelHasSkinData= true


Check other bytes to determine other vertex element types. In GTA seems to be used only these

Hope this helps you somehow


Thank you guys! Recent business trip, busy. Did not get back to you.


Top
 Profile  
 
PostPosted: Thu Apr 24, 2014 9:07 pm 
Offline
Registered Member

Joined: Fri Aug 03, 2012 1:04 am
Posts: 497
K. So how do we import those PSP models? I would like to fix this:
Image

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 69 posts ]  Go to page Previous  1, 2, 3, 4, 5

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group