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.

need help to the correct read uv from Reckless Racing *.sggr

Featured Replies

Hello guys, I need help to the correct read UV`s and Textures, from the Reckless Racing game. 

Earlier, durik256 helped me read the mesh format and some UV data from the *.sggr format, but to this day I haven’t been able to figure out the UV scaling and materials.

Here’s the link to the discussion: https://reshax.com/topic/1067-reckless-racing-ios-vfs-files/

Below is the Noesis script for reading the mesh data.

Script have two problems: 

- Sometimes the script reads the LOD versions of the mesh models.

- It also doesn’t read the UV scale, and the mesh isn’t split by materials.

I’m asking for your help in updating this script.

from inc_noesis import *

def registerNoesisTypes():
    handle = noesis.register("Reckless Racing", ".sggr")
    noesis.setHandlerTypeCheck(handle, noepyCheckType)
    noesis.setHandlerLoadModel(handle, noepyLoadModel)
    return 1

def noepyCheckType(data):
    if data[:4] != b'\x4D\x3C\x2B\x1A': 
        return 0
    return 1

def noepyLoadModel(data, mdlList):
    bs = NoeBitStream(data)
    ctx = rapi.rpgCreateContext()

    ofs_res = data.find(b'#RES')
    if ofs_res != -1:
        bs.seek(ofs_res + 44)
        unk, vnum, zero = bs.read('3I') 
        skip = 12 if unk == 4368 else 0
        vbuf = b''
        vbuf, uvbuf = b'', b''#bs.read(vnum*24)
        for x in range(vnum):
            bs.seek(2,1)
            vbuf += bs.read(2)
            bs.seek(2,1)
            vbuf += bs.read(2)
            bs.seek(2,1)
            vbuf += bs.read(2)
            bs.seek(5,1)#4
            uvbuf += bs.read(2)
            bs.seek(2,1)
            uvbuf += bs.read(2)
            bs.seek(1,1)#2
            bs.seek(skip,1)#12+
        rapi.rpgBindPositionBuffer(vbuf, noesis.RPGEODATA_SHORT, 6)
        rapi.rpgBindUV1Buffer(uvbuf, noesis.RPGEODATA_USHORT, 4)

        u0, inum, u1 = bs.read('3I')
        ibuf = bs.read(inum * 2)
        rapi.rpgCommitTriangles(ibuf, noesis.RPGEODATA_USHORT, inum, noesis.RPGEO_TRIANGLE)

    try:
        mdlList.append(rapi.rpgConstructModel())
    except:
        mdlList.append(NoeModel())

    return 1

 

  • Supporter

Hello, you really should put more effort in your request. People who could help don't have all the time in the world, to unpack a vfs, search for the sggr in question,

which samples have the "lod problem", etc, etc.

WHY not simply upload the samples in question plus a description what EXACTLY you've done so far to get uvs.

Your post here is not very insightful, imho.

 

  • Supporter

Seems your "need of help" is not much urgent. Anyways, uvs seem to be ok to some extend (4e153346.sggr) :

sggr_uvs.png

edit: for b8de6453.sggr (type 4368) a bigger uv offset (26) is required (see bold marked uvs):

sggr-uvs-4368.png.305e99d3e1ce7137fcdc500877fe563e.png

b8de6453-sggr-uvs.png.616dd476991d7f2f328f59e509346b57.png

Change the script like so:

            bs.seek(16,1)#type 4368
            uvbuf += bs.read(2)
            bs.seek(2,1)
            uvbuf += bs.read(2)
            bs.seek(1,1)
            bs.seek(-11,1)#type 4368
            bs.seek(skip,1)#12+

(You can use the variable skip to combine both versions of the script into one.)

(I showed a reduced set of uvs, otherwise all uvs are overlapping so in a next step sub meshes need to be created.)

Edited by shak-otay

  • Author

Hi shak-otay, thanks a lot for your help. I just need to figure out how to read subMeshes. Could you also tell me when reading some meshes as LODs, could that also be related to subMeshes?

  • Supporter
4 hours ago, black_racer said:

Hi shak-otay, thanks a lot for your help. I just need to figure out how to read subMeshes. Could you also tell me when reading some meshes as LODs, could that also be related to subMeshes?

Hi black_racer,

I have no idea how the LODs and sub meshes are organized. As a start you could insert g SM_no_xx lines between the face index lines and compare the resulting sub meshes to suiting textures.

sub mesh no5 (from face index 5000 to 5999) marked:

b8de6453out-sm5_obj.jpg.62f6f126a8a0ad1108e0b4bfa931df3c.jpg

Quote

- Sometimes the script reads the LOD versions of the mesh models.

With which sggr file(s) does that happen?

Edited by shak-otay

Create an account or sign in to comment

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.