Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

VTC2 Texture Format

Featured Replies

  • Author
  • Localization

capullo-verde, posted Wed Mar 16, 2022 10:03 pm (70546)


Hello.
I am trying to extract the textures of the game "Disco Elysium Director Cut" but I am unable.
It has a pluggin called "AmplifyTextureNative.dll" (or nro on Switch version. I have tried with both versions).
I decompile it with IDA Pro and hexray and it look like that textures are compressed with the codec
lzham, also have been packed using rgbcx, (that was made by the lzham codec creator) and crunch.

Sadly it It seems like the library is not directly responsible of opening vtc2 files but only process it's content (or only a part of it).

But I am unable to go on.(I have tried look on the source code of the game but i have no found anything)
I need to figure out how thoses files are opened and parsed.

Could you please help me?
I attach two textures and the decompilation.

About lzham and rgbcx I found the author github:

https://github.com/richgel999/lzham_codec


https://pypi.org/project/pylzham/

a lot of thanks

pc.part1.rar

decompilation of the pluggin.rar

  • Author
  • Localization

Allen, posted Thu Mar 17, 2022 12:07 pm (70553)


The vtc2 file is a texture container.

You can use this quickbms script to extract crn files.
Code:
#Script for quickbms
#Extract crn file from vtc2 file
get numTex long
get numSplit long
xmath baseOffset " 8 numTex * 16 numSplit * 22"
for i = 0 < numTex
    get id long
    get offset long
    get unk long
    get size long
    math offset baseOffset
    get NAME basename
    string NAME p "%s_%d.crn" NAME id
    log NAME offset size
next i


Then compile crunch-unity you can convert the file.
  • Author
  • Localization

spiritovod, posted Thu Mar 17, 2022 12:24 pm (70554)


@capullo-verde: I don't think lzham and rgbcx are somehow related to this case, as the data in vtc2 files is not additionally compressed and rgbcx is just an optimized encoder to standard BC formats (which means decoding can be done through default ways).
Aside from that, those are compiled UDIM texture collection files, which contains crunch compressed tiles for virtual textures ("48 78 00" is the beginning of such blocks) and data tables, required for untiling - though it doesn't mean you can re-create all original textures from only the data, due to nature of virtual textures. Separate crn chunks can be converted with the attached tool though (they will be converted to dds by default) - note that the script above doesn't output separate chunks, but all chunks for a virtual texture, crunch will only decompress first chunk/tile from them.
You can read more about them at Amplify site and probably in the plugin code (if its source is even available):
https://amplify.pt/unity/amplify-texture-2/
https://wiki.amplify.pt/index.php?title ... e_2/Manual

I suppose the faster solution in this case would be using graphics debuggers and grabbing untiled textures at runtime or using some unity debugging tools, like UnityExplorer, for further investigation.

crunch_x64.zip

  • Author
  • Localization

capullo-verde, posted Thu Mar 17, 2022 6:22 pm (70557)


A lot of thanks!

Then it is as the "MegaTexture" tech which was used on Rage ,if i dont remember bad idtech 5.
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.