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.

Ridge Racer 6 mdl extract from X360

Featured Replies

  • Author
  • Localization

Bl4z3_Ice, posted Sat Jan 07, 2023 1:03 pm (74907)


can anyone help me with Ridge Racer 6 MDL file to objs along with textures pls?
  • Author
  • Localization

Bl4z3_Ice, posted Sat Jan 07, 2023 1:07 pm (74908)


file sample
  • Author
  • Localization

h3x3r, posted Sat Jan 07, 2023 5:57 pm (74912)


Here is bms for tex file. Just add *.dat extension bcs qbms don't like extensionless files. It just dump what is inside. No conversion... Maybe i can write noesis script for textures.
Code:
################################
# Ridge Racer 6 - Tex Unpacker #
################################
get BaseFileName basename
get FileSize asize
endian big

getdstring Dummy 0x10
savepos BaseOffset
get texCount uint32

for i = 0 < texCount
   get texOffset uint32
   savepos TMP
   get texNextOffset uint32
   xmath texOffset_tmp "texOffset BaseOffset"
   xmath texNextOffset_tmp "texNextOffset BaseOffset"
   xmath texDataSize "texNextOffset - texOffset"
   xmath texLastDataSize "FileSize - texOffset_tmp"
   goto texOffset_tmp
   getdstring Dummy 0x8
   get texFileId uint32
   string Name p= "%s/0xX.tex" BaseFileName texFileId
      
   if texNextOffset == 1379292160
      log Name texOffset_tmp texLastDataSize
   else
      log Name texOffset_tmp texDataSize
   endif
   goto TMP
next i


And here is Noesis script supporting provided samples.
Code:
from inc_noesis import *
import noesis
import rapi
import os

def registerNoesisTypes():
   handle = noesis.register("Ridge Racer 6 - Texture", ".tex")
   noesis.setHandlerTypeCheck(handle, noepyCheckType)
   noesis.setHandlerLoadRGBA(handle, noepyLoadRGBA)
   noesis.logPopup()
   return 1
       
def noepyCheckType(data):
   bs = NoeBitStream(data,NOE_BIGENDIAN)
   if len(data) < 20:
      return 0
   if bs.readUInt() != 0x52365400:
      return 0
   return 1
   
def noepyLoadRGBA(data, texList):
    bs = NoeBitStream(data,NOE_BIGENDIAN)
    texBaseName = rapi.getExtensionlessName(rapi.getLocalFileName(rapi.getInputName()))
    texMagic = bs.readUInt()
    bs.readBytes(4)
    texFileId = bs.readUInt()
    bs.readBytes(11)
    texPixelFormat = bs.readUByte()
    texWidth = bs.readUInt()
    texHeight = bs.readUInt()
    bs.readBytes(16)
       
    if texPixelFormat == 113:
        bs.texSize = texWidth * texHeight # RGB8
        print("Pixel Format > RGB8 Normal Map")
    elif texPixelFormat == 84:
        bs.texSize = texWidth * texHeight # DXT5
        print("Pixel Format > DXT5")
    elif texPixelFormat == 134:
        bs.texSize = texWidth * texHeight *4 # RGBA8
        print("Pixel Format > RGBA8")
       
    data = bs.readBytes(bs.texSize)
    if texPixelFormat == 113:
        data = rapi.imageUntile360DXT(rapi.swapEndianArray(data, 2), texWidth, texHeight, 16)
        data = rapi.imageDecodeDXT(data, texWidth, texHeight, noesis.FOURCC_ATI2)
        texFmt = noesis.NOESISTEX_RGBA32
    elif texPixelFormat == 84:
        data = rapi.imageUntile360DXT(rapi.swapEndianArray(data, 2), texWidth, texHeight, 16)
        texFmt = noesis.NOESISTEX_DXT5
    elif texPixelFormat == 134:
        data = rapi.imageUntile360Raw(data, texWidth, texHeight, 4)
        data = rapi.imageDecodeRaw(data, texWidth, texHeight, "a8r8g8b8")
        texFmt = noesis.NOESISTEX_RGBA32
           
    texList.append(NoeTexture(rapi.getInputName(), texWidth, texHeight, data, texFmt))
    return 1


Not sure about some of textures dimension. Mostly small ones have problem with size and are displayed incorrectly. Hope it will not be a big deal for you.
  • Author
  • Localization

Bl4z3_Ice, posted Sun Jan 08, 2023 3:24 am (74915)


thx for noesis script for texture part, but have you figured out to get models out of MDL file?
  • Author
  • Localization

Bl4z3_Ice, posted Sun Jan 08, 2023 4:00 am (74917)


Also the blender plugin made by GreenTrafficLight supports RR6 along with PS3 RR7 but I had an error that says "unpack requires a buffer of 4 bytes" and mdl file without extension in my sample contains R6C header.

https://github.com/GreenTrafficLight/Ri ... nder-Addon
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.