• Welcome to SC4 Devotion Forum Archives.

Batch Png to Fsh tool

Started by null45, June 05, 2009, 09:29:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tarkus

Thanks again for the quick reply and solution, null!  It works perfectly here on my end! :thumbsup:

-Alex

Shadow Assassin

Just a question - is it at all possible to create a Photoshop plugin that saves .fsh files directly? Would be exceedingly handy and remove another step from the FSH creation process.

The only problem I could see, though, would be with alphas...
New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dedgren ♦ dmscopio ♦ Ennedi
emilin ♦ Heblem ♦ jplumbley ♦ moganite ♦ M4346 ♦ papab2000
Shadow Assassin ♦ Tarkus ♦ wouanagaine
See my uploads on the LEX!

null45

Writing a plugin to allow photoshop to load and save fsh files would be extremely complex, although a java script automation script could probably save a psd file and then pass the file to a program that would convert it into a fsh.

Jonathan

The tool will not let me convert using 32-bit ARGB, it will only let me use DXT1 and DXT3?
However with DXT3 the quality is awful.

null45

If the image is smaller than 256x256 it only allows DXT1 or DXT3 to be used.

The DXT3 compression quality is a known issue that was first raised by SimFox, I wrote a small tool that uses Squish to compress the image into a fsh with higher quality than the one used by FshTool it is here.

I should be able to incorporate the higher quality DXT3 fsh compression from Fshwrite into PngtoFshBatch.  ;)


null45

Quote from: Jonathanis there a reason for that?
When that was put in I thought from what was discussed in the High Definition Textures thread that only images 256x256 or larger would benefit from the different format.

Quote from: JonathanAlso do you know what SC4tool uses?

SC4Tool uses the FshTool DXT compression, without the source code this cannot be fixed. 

null45

Updated to use the higher quality Fshwrite compression when writing DXT1 or DXT3 fsh files.

File version updated to 1.4.4.4.   :thumbsup:

Tarkus

Seem to be running into some issues with the "Save dat" feature.  I'm getting this error message:

Object reference not set to an instance of an object.
at PngtoFshBatchtxt.Form1.RebuildDat(DatFile4 inputdat)
at PngtoFshBatchtxt.Form1.saveDatbtn_Click(Object sender, Event Args e)

-Alex

null45

That bug has been fixed, File version updated to 1.4.4.5   ;)




Tarkus

Quote from: null45 on February 14, 2010, 12:45:49 PM
That bug has been fixed, File version updated to 1.4.4.5   ;)

Wow, that was quick!  Thanks again for all your hard work on this tool, null! :thumbsup:

-Alex

Shadow Assassin

Hey - just wondering about something: I'm trying to import a bunch of zoom 3 images (zoom 3 only, no others), and PNG2FSH just ignores these images and won't write a new .dat... is this a bug or does it not like 32x32 PNGs?
New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dedgren ♦ dmscopio ♦ Ennedi
emilin ♦ Heblem ♦ jplumbley ♦ moganite ♦ M4346 ♦ papab2000
Shadow Assassin ♦ Tarkus ♦ wouanagaine
See my uploads on the LEX!

null45

It only handles the zoom 5 images and would automatically create the images for the other zooms if the "Automatically process Mips" option is checked.

Shadow Assassin

Ah okay -- is there any chance at all that it could be allowed to handle images for other zooms? Right now, the only option is FishMAN and that is really quite buggy.
New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dedgren ♦ dmscopio ♦ Ennedi
emilin ♦ Heblem ♦ jplumbley ♦ moganite ♦ M4346 ♦ papab2000
Shadow Assassin ♦ Tarkus ♦ wouanagaine
See my uploads on the LEX!

null45

The ability to load images from the other zooms was removed due to a crash if the images in the list were different sizes.

The "Save dat" function would only work if all the zoom levels are present, although it would save the zoom 5 images without the other zoom levels SC4 probably would not like that.  :D

Tarkus

I've been running into an issue with compression on Zoom 3 FSHs--a few other NAMites have run into a similar issue as well.  It seems that some of the details are going missing in that zoom, almost as if an upsized Zoom 2 FSH is going in its place.

It's particularly apparent on the RHW-8 textures.

Here's Zoom 4:


And here's Zoom 3:


The problem seems to persist regardless of the size of the initial source PNG.  The ones used in that particular example are from 128x128 source files run through "Automatically Process Mips".  It occurs with 256x256 PNGs as well.

-Alex

null45

Quote from: TarkusI've been running into an issue with compression on Zoom 3 FSHs--a few other NAMites have run into a similar issue as well.  It seems that some of the details are going missing in that zoom, almost as if an upsized Zoom 2 FSH is going in its place.

It definitely is not a up-scaled Zoom 2 fsh.  :D
Does the same thing happen in SC4Tool?

Quote from: TarkusThe problem seems to persist regardless of the size of the initial source PNG.  The ones used in that particular example are from 128x128 source files run through "Automatically Process Mips".  It occurs with 256x256 PNGs as well.

That would make sense because it is the same function (I use the same method as SC4Tool, GetThumbnailImage) that scales the Zoom 5 images regardless of size. 


Tarkus

I just ran a series of tests with the most recent FSHLib and SC4Tool . . . same issue appears to be happening there as well, so I'm wondering if it may be FSHLib related.  A fellow NAMite who is on Windows XP had reported to me that he hadn't been running into any issues with the new FSHLib and SC4Tool, but another colleague, who is on Windows 7 like I am, reported he was running into the same issue.

-Alex

null45

The GetThumbnailImage function apparently doesn't want to work correctly on Windows 7  ::),  I now use the DrawImage  function which seems to be higher quality.

Added a check box for Fshwrite Compression, File version updated to 1.4.4.6.  :)

Tarkus

null, you've come through yet again!  I just tried re-importing those RHW-8 textures and they look spot-on in Zoom 3 now--seems everything looks a little sharper, in fact. 

Thank you again for your very quick assistance on this--you've made a lot of NAMites very happy! :thumbsup:

-Alex