Page 1 of 2

Resident Evil 4 .GNF File! [PS4]

Posted: Sun Feb 17, 2019 3:35 pm
by Scofield
Hi all, and @Acewell I need Noesis python script :)

Actually, it supports, but the picture goes wrong.

Sample File: https://www87.zippyshare.com/v/LxgGq3lq/file.html

Re: Resident Evil 4 .GNF File! [PS4]

Posted: Mon Feb 18, 2019 12:04 am
by Acewell
Noesis has native support for PS4 gnf textures and opens that gnf file no problem. :D
1280x720 BC3(dxt5)

Re: Resident Evil 4 .GNF File! [PS4]

Posted: Mon Feb 18, 2019 12:57 am
by Scofield
Acewell wrote: Mon Feb 18, 2019 12:04 am Noesis has native support for PS4 gnf textures and opens that gnf file no problem. :D
1280x720 BC3(dxt5)
Here problem. The part I marked repeated section :)

Image

Re: Resident Evil 4 .GNF File! [PS4]

Posted: Mon Feb 18, 2019 2:40 am
by Acewell
yeah it could be a problem with how Noesis handles non power of 2 gnf images or something.
any script i make to open this gnf will be overridden by Noesis native plugins, so no-go there. (:
you can use daemon1's RawTex tool to get the image without data repeat. :D

use these settings:
Offset = 0x100
width = 1280
height = 720
BC3 (DXT5)
PS4 swizzle

Re: Resident Evil 4 .GNF File! [PS4]

Posted: Mon Feb 18, 2019 10:10 am
by Scofield
Acewell wrote: Mon Feb 18, 2019 2:40 am yeah it could be a problem with how Noesis handles non power of 2 gnf images or something.
any script i make to open this gnf will be overridden by Noesis native plugins, so no-go there. (:
you can use daemon1's RawTex tool to get the image without data repeat. :D

use these settings:
Offset = 0x100
width = 1280
height = 720
BC3 (DXT5)
PS4 swizzle
Yes I know that.But this troublesome Noesis Batch process is very useful. :)

How do I extract hundreds of files :ninja:

Re: Resident Evil 4 .GNF File! [PS4]

Posted: Wed Mar 20, 2019 4:29 pm
by xperiagenerator
Acewell wrote: Mon Feb 18, 2019 2:40 am yeah it could be a problem with how Noesis handles non power of 2 gnf images or something.
any script i make to open this gnf will be overridden by Noesis native plugins, so no-go there. (:
you can use daemon1's RawTex tool to get the image without data repeat. :D

use these settings:
Offset = 0x100
width = 1280
height = 720
BC3 (DXT5)
PS4 swizzle
Hi

Do you think that it will be possible to make a noesis script for GNF files not power of 2 if we change GNF header and extention to something else?

ex GNFmagicid.gnf to XYZmagicid.xyz
001.rar
It will be usefull to have such noesis script to make command line automation

Re: Resident Evil 4 .GNF File! [PS4]

Posted: Thu Mar 21, 2019 6:46 am
by Acewell
okay here is 3rd and hopefully final draft of Noesis python script to open your custom gnf with changed magic and extension. :D
*script updated June 6, 2019*
tex_ResidentEvil4_PS4_xyz.zip
supports PS4 swizzled rgba32, dxt1, dxt3, dxt5, BC4, BC5, BC6 and BC7.
the results are the same as what daemon1's RawTex tool spits out.
i used TheUkrainianBard's "imageFromPeanoOrder" function so i could bypass using Noesis built in PS4 unswizzle.
i also had to refer to parts of his "Phyre Engine" python script to get that working properly, so thanks to him for this. :D


and this bms script will automate the change to the header magic and extension
of your non power of 2 gnf images and prepare them for the Noesis script above. :D

Code: Select all

# script for QuickBMS http://aluigi.altervista.org/quickbms.htm

get SIZE asize
math SIZE - 3
get NAME basename
string NAME + .xyz
set memory_file string "XYZ"
append 
log NAME 0x0 0x3 -1
log NAME 0x3 SIZE
append

Re: Resident Evil 4 .GNF File! [PS4]

Posted: Thu Mar 21, 2019 8:57 am
by xperiagenerator
Thankyou so much
here you go with new formats
samples.rar

Re: Resident Evil 4 .GNF File! [PS4]

Posted: Thu Mar 21, 2019 10:18 am
by xperiagenerator
Can you add support for GNF files with zeroes padding in header?
thankyou
here you go with samples (those are the same as the previous ones but with zeroes padding in the header)
samplesHeaderLong.rar
Offset
https://imgur.com/a/qSEHVBk

Re: Resident Evil 4 .GNF File! [PS4]

Posted: Fri Mar 22, 2019 12:21 am
by Acewell
okay i updated the Noesis script here to try and open your latest samples. :D
https://forum.xentax.com/viewtopic.php? ... 20#p149820

there seems to be issues with BC4, BC5 and BC6 unorm and snorm types,
i will look into these more later and try to come up with a better solution.

Re: Resident Evil 4 .GNF File! [PS4]

Posted: Fri Mar 22, 2019 6:57 pm
by TheUkrainianBard
Here's my take on this.
Somehow I ended up with the same behaviour for BCns as Noesis.
SNorms - seems like a (channel_value+0x80) & 0xFF fix. - UPD: turns out no.
SRGBs... I don't think Noesis has gamma correction.

UPD: deleted, see Acewell's post

Re: Resident Evil 4 .GNF File! [PS4]

Posted: Sat Mar 23, 2019 9:41 am
by xperiagenerator
Great work
Thankyou both :)

Re: Resident Evil 4 .GNF File! [PS4]

Posted: Sun Mar 24, 2019 3:11 am
by Acewell
okay i updated my script hopefully for the final time here: :D
https://forum.xentax.com/viewtopic.php? ... 20#p149820
i am happy with the results, they are the same as what daemon1's RawTex tool spits out.
as usual, it is never my intention to reproduce official specs, but to get satisfatory
results from the least amount of info while utilizing existing methods. :D

Re: Resident Evil 4 .GNF File! [PS4]

Posted: Sun Mar 24, 2019 11:05 am
by xperiagenerator
Other Samples for you if you are interested into add support for them.

http://www.mediafire.com/file/s0611p3j4 ... w02xyz.rar

Re: Resident Evil 4 .GNF File! [PS4]

Posted: Tue Jun 04, 2019 7:45 am
by JosouKitsune
Hello I'm having an issue related to the GNF being repeated, but with a different game GinTama Rumble.
See this GNF sample file contains multiple textures, but once converted to XYZ it would only read the first one, since the default script already has the splitting function, I would guess it is a matter of combining the 2, yeah I know it's easier said than done, I honestly would try to do more, but I don't know where the default script is located.

Using RE4 script
Image

Using Noesis GNF default script
Image
Image

Image