XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Sat Mar 25, 2017 2:51 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Hitman 2016 textures
PostPosted: Sun May 22, 2016 9:20 pm 
Offline
beginner

Joined: Wed Sep 26, 2007 8:49 pm
Posts: 22
Has thanked: 0 time
Have thanks: 5 times














You can make the ads go away by registering

So after unpacking the rpkg files with the quick bms script from here : viewtopic.php?f=10&t=14080&p=116983&hilit=hitman#p116983 I figured out the .vap texture format used from the TEXD folder. I wrote a C++ program ( scripting is just not my thing :) ) that extracts them. I currently can't tell the exact format for a specific file but 90% of them are either DXT1, BC5 or BC7 dds files.

I still need more research to finalize it but just in case anyone is interested I will release the software that extracts them soon.

_________________
http://www.facebook.com/relativegames


Top
 Profile  
 
 Post subject: Re: Hitman 2016 textures
PostPosted: Fri May 27, 2016 9:48 pm 
Offline
beginner

Joined: Wed Sep 26, 2007 8:49 pm
Posts: 22
Has thanked: 0 time
Have thanks: 5 times
Link to tool : https://drive.google.com/file/d/0BwDjq7 ... sp=sharing

Usage
Hitman_2016.exe input_folder output_folder

Works only under x64 windows and it may only work on Windows 10. Use at your own risk & stuff.

PS: Software that can read BC4-7 : Visual Studio 2015 ;)

_________________
http://www.facebook.com/relativegames


Top
 Profile  
 
 Post subject: Re: Hitman 2016 textures
PostPosted: Sun Jun 26, 2016 11:53 am 
Offline
beginner

Joined: Wed Sep 26, 2007 8:49 pm
Posts: 22
Has thanked: 0 time
Have thanks: 5 times
I have paused development and have no idea if I'll come back to it anytime soon, so I thought it would be nice to share the code that I have so far.

The code also contains info on how to extract some 3D models, however only the biggest files from the PRIM folder work correctly. The RE* dependencies are related to my engine and only contains minor importance code; you won't be able to find that code anywhere but you should be able to reimplement it using std.


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
http://www.facebook.com/relativegames


Top
 Profile  
 
 Post subject: Re: Hitman 2016 textures
PostPosted: Fri Sep 30, 2016 10:58 pm 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Sun Jul 06, 2014 6:30 am
Posts: 310
Has thanked: 51 times
Have thanks: 195 times
cippyboy wrote:
I have paused development and have no idea if I'll come back to it anytime soon, so I thought it would be nice to share the code that I have so far.

The code also contains info on how to extract some 3D models, however only the biggest files from the PRIM folder work correctly. The RE* dependencies are related to my engine and only contains minor importance code; you won't be able to find that code anywhere but you should be able to reimplement it using std.


Hi, I appreciate you releasing the source. I'm trying to fill in the gaps of what is missing, and there is one aspect I'm finding a bit mysterious.

The Virtual file class, has both a Load() and a SaveLoad() function. Load I think is self-explanatory, but what does SaveLoad() do?

Also with the DYNAMIC_ARRAY class, the constructor that takes two parameters, what is the purpose of both parameters?

Example:
Code:

        DYNAMIC_ARRAY<WORD2> Texcoords16(Block3.NumVertices, 4);

        ...

   DYNAMIC_ARRAY<uint16_t> Indices;
   DYNAMIC_ARRAY<Vector3d> Vertices;

   HMObject() :
      Indices(0, 1000),
      Vertices(0, 1000)
   {

   }


I'm guessing the first parameter is the initialization count, but what is the second, default value? or something else?


Top
 Profile  
 
 Post subject: Re: Hitman 2016 textures
PostPosted: Sun Oct 02, 2016 2:38 am 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Sun Jul 06, 2014 6:30 am
Posts: 310
Has thanked: 51 times
Have thanks: 195 times
Never mind about the C++ stuff. I figured it out. 8)

There was a bug in texture conversion, only affecting a fraction of the textures, due to a mishandling of a sub-block of data just under the header. I've fixed it, all seems to convert correctly now. Version 1.01 attached.

Now to see what I can do about models...

*new version below*


Top
 Profile  
 
 Post subject: Re: Hitman 2016 textures
PostPosted: Sun Oct 02, 2016 10:46 pm 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Sun Jul 06, 2014 6:30 am
Posts: 310
Has thanked: 51 times
Have thanks: 195 times
Here's version 1.02 of the texture converter.

I fixed a bug handling textures with missing MIP levels and added support for two new formats. enjoy.


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: Hitman 2016 textures
PostPosted: Thu Dec 15, 2016 8:26 pm 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Sun Jul 06, 2014 6:30 am
Posts: 310
Has thanked: 51 times
Have thanks: 195 times
And finally I finished the model importer for Blender (2.63 or above).

Same as pretty much all my importers. if you need to know how to install, see my previous tutorial here: viewtopic.php?p=103131#p103131

Model files are generally in the "PRIM" folder, and have the extension *.dat
Image
Image


I came across many model formats, and added support for all. But I'm not 100% sure I have all, since it's impossible to test against every model file. If you find a model file that will not load, please let me know name and location. I'll try to add support. Enjoy. :)


Last edited by volfin on Sat Dec 17, 2016 2:38 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Hitman 2016 textures
PostPosted: Fri Dec 16, 2016 7:26 am 
Offline
beginner

Joined: Tue Sep 08, 2015 9:51 am
Posts: 25
Has thanked: 17 times
Have thanks: 3 times
Models are loading fine.

Few problems/issues I've come across.

- UV's are broken sometimes (that's usually a given with RE'd models)
- LOD model issues. (Nobody will probably use the LOD meshes, so i'm not sure if there is a way to ignore this upon import)
- Sub object scaling issues.
- Overlapping Vert's

Other than that, huge huge thanks for working on this! Huge step forward.


Last edited by hhchunter on Fri Dec 16, 2016 8:28 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Hitman 2016 textures
PostPosted: Fri Dec 16, 2016 8:11 am 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Sun Jul 06, 2014 6:30 am
Posts: 310
Has thanked: 51 times
Have thanks: 195 times
hhchunter wrote:
Models are loading fine.

Few problems/issues I've come across.

- UV's are broken sometimes (that's usually a given with RE'd models)
- LOD model issues. (Nobody will probably use the LOD meshes, so i'm not sure if there is a way to ignore this upon import)
- Sub object scaling issues.

Other than that, huge huge thanks for working on this!


No problem. yeah I probably would have disabled the LOD models if I had a way to identify them, but for the time being I see no way to tell what is LOD0 and what is a lower LOD.

As for the scaling issue, can you point me to an example file? I have to read the scale out of the model file and scale the resulting mesh, so if scaling is wrong, I want to see why and if I can fix it.

Same for broken UV. I can't imagine a situation where it UV should be broken.
Thanks.


Top
 Profile  
 
 Post subject: Re: Hitman 2016 textures
PostPosted: Fri Dec 16, 2016 9:25 am 
Offline
beginner

Joined: Tue Sep 08, 2015 9:51 am
Posts: 25
Has thanked: 17 times
Have thanks: 3 times
Sorry for the late reply, I don't really use blender so I had to figure out how to view UV's in it.

UV Issues.
Model:
https://i.imgur.com/7xSzx75.png

UV's:
https://i.imgur.com/AXXJdoQ.png


I was wondering, if you could port this to executable so that it converts to FBX/OBJ
Or write a version for Maxscript as well


Top
 Profile  
 
 Post subject: Re: Hitman 2016 textures
PostPosted: Fri Dec 16, 2016 6:44 pm 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Sun Jul 06, 2014 6:30 am
Posts: 310
Has thanked: 51 times
Have thanks: 195 times
hhchunter wrote:
Sorry for the late reply, I don't really use blender so I had to figure out how to view UV's in it.

UV Issues.
Model:
https://i.imgur.com/7xSzx75.png

UV's:
https://i.imgur.com/AXXJdoQ.png


I was wondering, if you could port this to executable so that it converts to FBX/OBJ
Or write a version for Maxscript as well


I'm sorry, I should have been more clear. I need the name and location of the source .dat file that created the bad mesh, so I can look at the data. But as for the first image, I don't see any scaling issue?

as for an exe, I maybe could, but i'd like to get the format nailed down first.


Top
 Profile  
 
 Post subject: Re: Hitman 2016 textures
PostPosted: Sat Dec 17, 2016 2:45 am 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Sun Jul 06, 2014 6:30 am
Posts: 310
Has thanked: 51 times
Have thanks: 195 times
I was able to find the filename from the picture, and locate the file in chunk0.

Don't know how I missed that UV format, but in any case, I added it. :keke:

Also while poking around, I realized that the Destructible models were packaged together with all their debris in one mesh. I figured out how to designate all the parts with materials:

Image
"Patio heater" with all it's blown up bits included.

Image
the 'intact' material selected and mesh moved over.

Image
After hitting 'p' to separate by selection.

Seems each color is a separate part, but in-game its' all one mesh with the various parts hidden until it's 'destroyed'. or something along those lines anyway. In any case, the importer will detect such meshes and add materials accordingly.

There's still the matter of meshes you mentioned have the wrong scale. if you can provide an example, i'll be happy to take a look.

Edit: Newer version attached below.


Last edited by volfin on Sun Dec 18, 2016 7:54 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Hitman 2016 textures
PostPosted: Sat Dec 17, 2016 3:26 am 
Offline
beginner

Joined: Tue Sep 08, 2015 9:51 am
Posts: 25
Has thanked: 17 times
Have thanks: 3 times
volfin wrote:
Don't know how I missed that UV format, but in any case, I added it. :keke:

Also while poking around, I realized that the Destructible models were packaged together with all their debris in one mesh. I figured out how to designate all the parts with materials:



Awesome!

volfin wrote:
There's still the matter of meshes you mentioned have the wrong scale. if you can provide an example, i'll be happy to take a look.


The Jet from Chunk0 had this problem afaik.

0000000000006eca.dat

I moved the sub-objects to the side. The highest poly mesh scales correctly, while others don't.
https://i.imgur.com/xDtzlIq.png

Also some weirdness with the mesh possibly? Shown when Unwrapping.
https://i.imgur.com/u6yJyFp.jpg


Top
 Profile  
 
 Post subject: Re: Hitman 2016 textures
PostPosted: Sat Dec 17, 2016 11:52 am 
Offline
ultra-n00b

Joined: Mon Mar 14, 2016 10:57 am
Posts: 6
Has thanked: 2 times
Have thanks: 0 time
Huge thanks for the tool, Volfin.

In my testing heads, bodies and clothing use correct uvs.
There are some examples where I encountered problems though (all from chunk0)

Buildings (0000000000006979.dat) - https://i.imgur.com/zLLoKkD.jpg

Hair (000000000001e6f6,dat) - https://i.imgur.com/G2Z2IAW.jpg

Foliage (0000000000005b09.dat) - https://i.imgur.com/xrAaKXb.jpg


Top
 Profile  
 
 Post subject: Re: Hitman 2016 textures
PostPosted: Sat Dec 17, 2016 6:57 pm 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Sun Jul 06, 2014 6:30 am
Posts: 310
Has thanked: 51 times
Have thanks: 195 times
YourImaginaryFriend wrote:
Huge thanks for the tool, Volfin.

In my testing heads, bodies and clothing use correct uvs.
There are some examples where I encountered problems though (all from chunk0)

Buildings (0000000000006979.dat) - https://i.imgur.com/zLLoKkD.jpg

Hair (000000000001e6f6,dat) - https://i.imgur.com/G2Z2IAW.jpg

Foliage (0000000000005b09.dat) - https://i.imgur.com/xrAaKXb.jpg


Yeah actually those 3 examples you pictured, are correct. :)

for the buildings they are just using a small section of a metal texture and it's repeated a lot, so they lay the uv sections on top of each other.

Same for the hair, they re-use the same strip of hair texture over and over, so they lay each strip on top of each other.

And for the foliage, they use a repeating texture and for each leaf they move it around in UV space, for variation, why they are all over the place.

But it's all valid UV data, and just shows some of the tricks model creators use to make a low rez texture appear higher rez.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next

All times are UTC + 1 hour


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
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group