ROM Hack Create CGFX from OBJ+PNG

MDashK

Well-Known Member
OP
Member
Joined
Jul 22, 2011
Messages
281
Trophies
1
Location
Internetus Exploratis
Website
www.mixwaves.net
XP
746
Country
Sorry if I'm posting this is the wrong section...
If so, please any MOD move it.

Anyone knows how to convert an OBJ+PNG objects to CGFX to be used in a Banner.bnr file?

Already tried to open CGFX with EveryFileExplorer, but always get an error.
BannerTool doesn't seem to support creating a CGFX file with a OBJ and PNG files to convert to banner.bnr...

Specifically, I'm trying to change the GameGear VC banner so that one can change the image/title screen shown in the banner, but keep the rest intact.
I managed to extract the CGFX content, and got 1 OBJ file (I assume it's the gamegear animation) and 2 PNG files (1 is the console textures, other is the title screen that I want to change).
The problem now is getting everything back up into a CGFX.
EveryFileExplorer doesn't let me create the CGFX from the OBJ, because it states that "Model without materials not supported!"

Best regards,
 
Last edited by MDashK,

MDashK

Well-Known Member
OP
Member
Joined
Jul 22, 2011
Messages
281
Trophies
1
Location
Internetus Exploratis
Website
www.mixwaves.net
XP
746
Country
OK, so I managed to find out that EveryFileExplorer will open the CGFX by drag-droping the file into it.
Now, other 2 problems have arrised:

1) I am able to create the bcres/cgfx animation, but... When I open the original, it shows up like this:

wdiC6Xo.png


You can clearly see the image I am trying to replace.
When I open the newly created one with EFE, it looks like this:

iOmg2OV.png


Meaning: Something is wrong...

2) Another problem: EFE doesn't seem to acknowledge that the original CGFX file has Skeleton Animations. So when I export the Model to DAE/OBJ, the skeletal animation doesn't go with it. Only the textures...
UPDATE: Found my answer to this here: http://gbatemp.net/threads/how-edit-a-gbc-banner.389807/#post-5517874

BR,
 
Last edited by MDashK,

LITTOMA

Well-Known Member
Newcomer
Joined
Nov 14, 2014
Messages
81
Trophies
0
Age
30
XP
352
Country
China
Then replace the texture data in the origin file is OK. First check out the origin color format.
 

MDashK

Well-Known Member
OP
Member
Joined
Jul 22, 2011
Messages
281
Trophies
1
Location
Internetus Exploratis
Website
www.mixwaves.net
XP
746
Country
OK. How do I do that? How do I replace the texture in the original CGFX file of the banner?
I haven't had much luck with most of the tools available and replacing by HEX modification using WinHEX seems to be complicated, since I can't pinpoint the location of the texture I want in the CGFX. Also, I would have to convert the PNG to CGFX prior of injecting in the CGFX banner file, and all the converters from PNG to CGFX that I have found have limitations to the size of the PNG image...
 

LITTOMA

Well-Known Member
Newcomer
Joined
Nov 14, 2014
Messages
81
Trophies
0
Age
30
XP
352
Country
China
First use Texturipper to extract textures in the origin file, you can get format and texture data offset in the txt file. Then use this tool to generate a raw texture data file. Use WinHEX to do replace work is OK.
 

MDashK

Well-Known Member
OP
Member
Joined
Jul 22, 2011
Messages
281
Trophies
1
Location
Internetus Exploratis
Website
www.mixwaves.net
XP
746
Country
I already had the textures extracted, but a new tool is always good to have.
Also, the output of the texture I want to replace in the TXT file is:

type:20000011 tformat:03 tofs:0000FD00 size:00008000 ofs:00001F14 format:00006754 formattype:00008363 mipmap:00000001 texobj:00000000 locflag:00000000
name:COMMON2 revision:05000000 udictcount:00000000 udictOffset:00000000 w:128 h:128

But the tool to convert to RAW texture asks me these options:

Target Format: L8 A8 LA4 LA8 RGB565 RGBA5551 RGBA4444 RGB24 RGBA32 L4 A4

Have no idea which one is to be used in this texture case....

Also, in WinHEX, how can I find out where the texture is in the CGFX banner file? This TXT didn't output any offset directions of the original CGFX file. So for what string should I search in winHEX to get to the position of the texture?
 

MDashK

Well-Known Member
OP
Member
Joined
Jul 22, 2011
Messages
281
Trophies
1
Location
Internetus Exploratis
Website
www.mixwaves.net
XP
746
Country
Replaced Sonic 2 GG title screen from banner with Sonic Chaos GG title screen.

UPDATE
Re-checked the created banner modified CGFX...
Something must not be right... Is there an updated version of this texture tool?

Take a look:

P5VUjwF.png


The image on the right is the original. The one on the left is the texture tool created one. Tried all the output options of the tool, and this is the closest one I can get to the original colors of the image. So, supposedly, according to you info, it was on RGB565 mode, but that mode turns out all greenish. The closest mode is RGBA5551, but still: that blue turns into almost black...

I asked if there is an updated version because, all the other options of the tool fail to deliver image in good condition. This is the best you can get...

Hmm... Seems to be some sort of pallete issue?

XZIVArG.png


When opening the CGFX in 3DSExplorer, one can clearly see that, although the image has similar compression, the values in the same spot/same color of the image differ from one CGFX to the other. Take a lookat the image values. Why does this happen?
 
Last edited by MDashK,

LITTOMA

Well-Known Member
Newcomer
Joined
Nov 14, 2014
Messages
81
Trophies
0
Age
30
XP
352
Country
China
Why does this happen?
Because it's difficult to avoid image distortion while converting RGBA32 to RGB565.

You can try RGBA4444 instead.
Seek to offset: ofs(0x1F14 )+0x30, and change this flag to 0x4(RGBA4444). Then replace the texture data with RGBA4444 texture data.
 
Last edited by LITTOMA,

MDashK

Well-Known Member
OP
Member
Joined
Jul 22, 2011
Messages
281
Trophies
1
Location
Internetus Exploratis
Website
www.mixwaves.net
XP
746
Country
Yeah, I can convert the PNG to RGBA32, but that will spit out a 64KB file, instead of a 32KB one...

That's it! Excelent. Now the colors are OK. =) Changed the flag, and got fixed.
Thanks a lot for all the help!

Just tested it on real 3DS hardware. Works marvelously. Thanks.
 
Last edited by MDashK,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    SylverReZ @ SylverReZ: Sup