Hyperdevotion Noire: Goddess Black Heart / 超女神信仰 ノワール 激神ブラックハート [PC, PSVita] (.tex) conversion to DDS

Textures, recreate headers, conversions, algorithms and parsing of image files
TheUkrainianBard
Posts: 121
Joined: Sun May 01, 2016 10:06 pm

Hyperdevotion Noire: Goddess Black Heart / 超女神信仰 ノワール 激神ブラックハート [PC, PSVita] (.tex) conversion to DDS

Post by TheUkrainianBard »

Yet another update: Updated script to make use of ps_lz77 decompression in 0.7.5-0.7.6a. Edit line 23 to set your platform. Comment/remove lines 152 & 155-161 if using in 0.7.7+. No reimport.
Last edited by TheUkrainianBard on Sun Aug 28, 2016 7:40 am, edited 7 times in total.
TheUkrainianBard
Posts: 121
Joined: Sun May 01, 2016 10:06 pm

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by TheUkrainianBard »

A small find for 3rd group: going in-game and looking at Gallery, it looks like there are DXT-ish compression artifacts and compression ratio seems to be 4:1.
Acewell
Posts: 706
Joined: Fri Aug 08, 2014 1:06 am

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by Acewell »

this is what i see :D
sample 1 is 142x212 bgra8888 with 28 byte header, imgFmt at 0x0C (00 40), width at 0x14 and height at 0x18
sample 2 is 1920x1312 bgra8888 with 16 byte header, imgFmt at 0x00 (00 40), width at 0x08 and height at 0x0C
sample 3 is 3728x1088 dxt5 with a 28 byte header, imgFmt at 0x0C (00 20), width at 0x14 and height at 0x18
i'm not sure about sample 4 yet, will have a better look later. imgFmt at 0x0C (00 10), width at 0x14 and height at 0x18
Last edited by Acewell on Tue May 03, 2016 6:34 am, edited 1 time in total.
TheUkrainianBard
Posts: 121
Joined: Sun May 01, 2016 10:06 pm

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by TheUkrainianBard »

Acewell, thank you.
After some brainstorming myself I too understood that Group 3 is DXT5.
Here's the DDS file (I think it's correct) of that sample.

Group 4 may be 1920x1088 DXT1 files...
Acewell
Posts: 706
Joined: Fri Aug 08, 2014 1:06 am

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by Acewell »

my concern about 2s001.tex is the height in the header isn't matching the displayed image, as if the image data was truncated or something. it looks cut off in both Noesis and TextureFinder. :?
The sample 4 files could be dxt1 i guess, Bg9998.tex is all white and Bg9999.tex is all black except for two small spots.

I can make a script for Noesis that will open your samples on 2 conditions, they have a .tex extension and are already decompressed.
Noesis is capable of decompressing them on the fly but this level of scripting is beyond my experience level.
the fmt_bulletwitch_cpr.py script has an example of that and there is Noesis tutorial for Zlib here
http://forum.xentax.com/viewtopic.php?f=29&t=7813

the compressed textures header look like this to me
4 bytes - magic (ZLIB)
4 bytes - uncompressed data size
4 bytes - compressed data size
start of compressed data
TheUkrainianBard
Posts: 121
Joined: Sun May 01, 2016 10:06 pm

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by TheUkrainianBard »

Acewell wrote:my concern about 2s001.tex is the height in the header isn't matching the displayed image, as if the image data was truncated or something. it looks cut off in both Noesis and TextureFinder.

Uh, whoops, I forgot to mention that it was cut with filecutter.bms because it was too big to upload, even zipped. It's real size is 10 076 176 bytes, deflate-32K-128word compresses it to 2 717 258.
Sorry.
Acewell
Posts: 706
Joined: Fri Aug 08, 2014 1:06 am

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by Acewell »

here try my Noesis script :D
tex_HyperdevotionNoire_tex.zip


supports rgba8888, dxt1, dxt5
works only on uncompressed textures.....for now
TheUkrainianBard
Posts: 121
Joined: Sun May 01, 2016 10:06 pm

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by TheUkrainianBard »

Acewell, again, thank you. ;)
Meanwhile, I made a BMS script that recreates DDS header from .tex header with "Texture " ID. I will add .tex w/o that ID soon, ZLIB'd - Soon™ (once I understand how to do it all inside one BMS script).

UPD: all .tex should be approachable now.
Last edited by TheUkrainianBard on Thu Jun 09, 2016 4:07 pm, edited 2 times in total.
TheUkrainianBard
Posts: 121
Joined: Sun May 01, 2016 10:06 pm

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by TheUkrainianBard »

Turns out there's more hurdle: custom LZ77 BGRA8888 pixel data, which is, apparently, typical for Japanese PS3/PSVita games and their ports to Windows. I've found that someone already cracked into it (that C++ code seemed awfully familiar), but the decompression itself is in inline ASM and I can't read ASM.

UPD2 (2016/05/09 14:38 UTC): bit flags go first (the size of this part is 1/8th of the bulk, give or take 1B), then the bulk of compressed data, then dictionary, maybe?
Last edited by TheUkrainianBard on Sat Jun 11, 2016 3:19 pm, edited 1 time in total.
TheUkrainianBard
Posts: 121
Joined: Sun May 01, 2016 10:06 pm

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by TheUkrainianBard »

That was a specific implementation of LZSS. I hope I've commented the lines enough for people to understand.

UPD2 (2016/06/11 15:12 UTC): this seems final...
UPD3 (2016/08/07 11:21 UTC): updated the message a bit.
UPD4 (2016/08/10 18:56 UTC): moved everything to OP.
Last edited by TheUkrainianBard on Wed Aug 10, 2016 6:56 pm, edited 4 times in total.
noir
Posts: 4
Joined: Fri Aug 05, 2016 12:26 pm

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by noir »

Hey, I just ripped game tex file from PSVita.
But I dont convert tex file.
here is a tex file from vita version
Someone can analysis and make script?
TheUkrainianBard
Posts: 121
Joined: Sun May 01, 2016 10:06 pm

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by TheUkrainianBard »

Suprisingly, I didn't even change anything in my script.
Can you provide more examples, "Obj0__.tex" etc?
noir
Posts: 4
Joined: Fri Aug 05, 2016 12:26 pm

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by noir »

Yeah I can extract some Vita's tex file. but color is different.
Image
this is screent shot of Vita version,but extracted vita's file's color is different(town1.tex)
Image
Do you know what is wrong?

and I found some of Vita's file cant convert(but PC's can convert)
ex:FontGp_data.tex
(Vita)
Image
(PC)
Image


TheUkrainianBard wrote:Suprisingly, I didn't even change anything in my script.
Can you provide more examples, "Obj0__.tex" etc?
TheUkrainianBard
Posts: 121
Joined: Sun May 01, 2016 10:06 pm

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by TheUkrainianBard »

I think I got it. Maybe.
Issue #1 was different channel order (PC textures were BGRA, provided PSVita texture is RGBA);
Issue #2 - I've added a dirty 4bpp grayscale texture support.

Please test and, if possible, report.
Last edited by TheUkrainianBard on Sun Aug 07, 2016 5:42 pm, edited 1 time in total.
noir
Posts: 4
Joined: Fri Aug 05, 2016 12:26 pm

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by noir »

TheUkrainianBard wrote:I think I got it. Maybe.
Issue #1 was different channel order (PC textures were BGRA, provided PSVita texture is RGBA);
Issue #2 - I've added a dirty 4bpp grayscale texture support.

Please test and, if possible, report.

Thanks! I can convert!Image
and Is it difficult to reimport? I try reimport.bat, but both of your scripts doesn't work for reimport.

One more, do you convert this file? (PC's FontMes_data_rg.tex) I cant convert it(but Vita's same name file can convert.)

thanks!
TheUkrainianBard
Posts: 121
Joined: Sun May 01, 2016 10:06 pm

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by TheUkrainianBard »

Sorry, it's impossible to reimport. I'm a newbie - I focused on extraction.
Try this to extract that PC "FontMes_data_rg.tex" character map you've attached.
Last edited by TheUkrainianBard on Wed Aug 10, 2016 6:30 pm, edited 1 time in total.
noir
Posts: 4
Joined: Fri Aug 05, 2016 12:26 pm

Re: Hyperdevotion Noire: Goddess Black Heart [PC] (.tex)

Post by noir »

ok, thanks
MListener54
Posts: 3
Joined: Mon Mar 06, 2017 11:10 pm

Re: Hyperdevotion Noire: Goddess Black Heart / 超女神信仰 ノワール 激神ブラックハート [PC, PSVita] (.tex) conversion to DDS

Post by MListener54 »

Hi,

Can anyone please give me a script to convert the attached .tex images to dds (or png) and from dds to tex.

I can pay anyone who wants to do it as job.

Thanks