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.

convert .tex to dds

Featured Replies

  • Author
  • Localization

adabada, posted Thu Oct 15, 2015 10:30 pm (8479)


Howdy folks,

I'm trying to convert .tex files extracted with quick bms (unity.bms script) to dds, but I'm having some trouble finding the .tex specification in order to adjust the conversion script.

Here is the conversion script I'm using, taken from here http://forum.xentax.com/viewtopic.php?f ... 0&p=111140:

Code:
# Unity .tex file to .dds
#
# script for QuickBMS http://quickbms.aluigi.org

get NAME basename
string NAME = ".dds"

get WIDTH long
get HEIGHT long
get IMGSIZE long
get TYPE long
get FLAGS long
goto 0x38

if TYPE = 0xC

math PIXELS = IMGSIZE
/* For some reason these two lines cause an error,
* skipping pre-allocation for now
*/
#math IMGSIZE = 500
#log MEMORY_FILE 0 IMGSIZE
log MEMORY_FILE 0 1

xmath PITCH "WIDTH * HEIGHT"
set DDSFLAGS long 0x8100f
set MIPMAPS long 0

if FLAGS & 0x1
    math DDSFLAGS = 0x20000
    if WIDTH > HEIGHT
        for i = WIDTH > 0
            math MIPMAPS = 1
        next i / 2
    else
        for i = HEIGHT > 0
            math MIPMAPS = 1
        next i / 2
    endif
endif

#DDS Header
put 0x20534444 long MEMORY_FILE
put 124 long MEMORY_FILE
put 0xa1007 long MEMORY_FILE
put HEIGHT long MEMORY_FILE
put WIDTH long MEMORY_FILE
put PITCH long MEMORY_FILE
put 0 long MEMORY_FILE
put MIPMAPS long MEMORY_FILE
for i = 0 < 11
    put 0 long MEMORY_FILE
next i

#Pixel format struct
put 32 long MEMORY_FILE
put 0x4 long MEMORY_FILE
put 0x35545844 long MEMORY_FILE
put 0 long MEMORY_FILE
put 0 long MEMORY_FILE
put 0 long MEMORY_FILE
put 0 long MEMORY_FILE
put 0 long MEMORY_FILE

#DDS Header cont.
put 0x401008 long MEMORY_FILE
put 0 long MEMORY_FILE
put 0 long MEMORY_FILE
put 0 long MEMORY_FILE
put 0 long MEMORY_FILE



for i = 0 < PIXELS
    get COLOR byte
    put COLOR byte MEMORY_FILE
next i

get SIZE asize MEMORY_FILE
log NAME 0 SIZE MEMORY_FILE

endif


This script works fine (the alpha mask not so much) for DXT5 files, but not for others. Unity Asset Extractor by Haoose can successfully convert all these .tex files to dds without problem.

Some sample files in case anyone wants to run tests: https://mega.nz/#!oQBEnJrY!BvyOV9SiKuph ... _YzgvGTRjo

Could anyone point me in the right direction as to where I can find more information on the .tex spec? I'm trying to adapt this script to work with DXT1 and "R8G8B8" formats.

Thanks!
  • Author
  • Localization

adabada, posted Sat Oct 17, 2015 4:11 pm (8531)


anyone?
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.