Follow us on Facebook: https://www.facebook.com/xentax/ :)

Hitman 2016 textures

Get your graphics formats figures out here! Got details for others? Post here!
cippyboy
beginner
Posts: 22
Joined: Wed Sep 26, 2007 8:49 pm
Been thanked: 8 times

Hitman 2016 textures

Post by cippyboy » Sun May 22, 2016 9:20 pm

So after unpacking the rpkg files with the quick bms script from here : viewtopic.php?f=10&t=14080&p=116983&hil ... an#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.

cippyboy
beginner
Posts: 22
Joined: Wed Sep 26, 2007 8:49 pm
Been thanked: 8 times

Re: Hitman 2016 textures

Post by cippyboy » Fri May 27, 2016 9:48 pm

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 ;)

cippyboy
beginner
Posts: 22
Joined: Wed Sep 26, 2007 8:49 pm
Been thanked: 8 times

Re: Hitman 2016 textures

Post by cippyboy » Sun Jun 26, 2016 11:53 am

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.
You do not have the required permissions to view the files attached to this post.

User avatar
volfin
ultra-veteran
ultra-veteran
Posts: 418
Joined: Sun Jul 06, 2014 6:30 am
Has thanked: 100 times
Been thanked: 261 times

Re: Hitman 2016 textures

Post by volfin » Fri Sep 30, 2016 10:58 pm

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: Select all


        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?

User avatar
volfin
ultra-veteran
ultra-veteran
Posts: 418
Joined: Sun Jul 06, 2014 6:30 am
Has thanked: 100 times
Been thanked: 261 times

Re: Hitman 2016 textures

Post by volfin » Sun Oct 02, 2016 2:38 am

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*

User avatar
volfin
ultra-veteran
ultra-veteran
Posts: 418
Joined: Sun Jul 06, 2014 6:30 am
Has thanked: 100 times
Been thanked: 261 times

Re: Hitman 2016 textures

Post by volfin » Sun Oct 02, 2016 10:46 pm

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.
You do not have the required permissions to view the files attached to this post.

User avatar
volfin
ultra-veteran
ultra-veteran
Posts: 418
Joined: Sun Jul 06, 2014 6:30 am
Has thanked: 100 times
Been thanked: 261 times

Re: Hitman 2016 textures

Post by volfin » Thu Dec 15, 2016 8:26 pm

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.

hhchunter
beginner
Posts: 29
Joined: Tue Sep 08, 2015 9:51 am
Has thanked: 19 times
Been thanked: 5 times

Re: Hitman 2016 textures

Post by hhchunter » Fri Dec 16, 2016 7:26 am

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.

User avatar
volfin
ultra-veteran
ultra-veteran
Posts: 418
Joined: Sun Jul 06, 2014 6:30 am
Has thanked: 100 times
Been thanked: 261 times

Re: Hitman 2016 textures

Post by volfin » Fri Dec 16, 2016 8:11 am

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.

hhchunter
beginner
Posts: 29
Joined: Tue Sep 08, 2015 9:51 am
Has thanked: 19 times
Been thanked: 5 times

Re: Hitman 2016 textures

Post by hhchunter » Fri Dec 16, 2016 9:25 am

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

User avatar
volfin
ultra-veteran
ultra-veteran
Posts: 418
Joined: Sun Jul 06, 2014 6:30 am
Has thanked: 100 times
Been thanked: 261 times

Re: Hitman 2016 textures

Post by volfin » Fri Dec 16, 2016 6:44 pm

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.

User avatar
volfin
ultra-veteran
ultra-veteran
Posts: 418
Joined: Sun Jul 06, 2014 6:30 am
Has thanked: 100 times
Been thanked: 261 times

Re: Hitman 2016 textures

Post by volfin » Sat Dec 17, 2016 2:45 am

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.

hhchunter
beginner
Posts: 29
Joined: Tue Sep 08, 2015 9:51 am
Has thanked: 19 times
Been thanked: 5 times

Re: Hitman 2016 textures

Post by hhchunter » Sat Dec 17, 2016 3:26 am

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

YourImaginaryFriend
n00b
Posts: 11
Joined: Mon Mar 14, 2016 10:57 am
Has thanked: 4 times
Been thanked: 1 time

Re: Hitman 2016 textures

Post by YourImaginaryFriend » Sat Dec 17, 2016 11:52 am

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

User avatar
volfin
ultra-veteran
ultra-veteran
Posts: 418
Joined: Sun Jul 06, 2014 6:30 am
Has thanked: 100 times
Been thanked: 261 times

Re: Hitman 2016 textures

Post by volfin » Sat Dec 17, 2016 6:57 pm

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.

Post Reply