Menu

LEX File Exchange
EA Support Files
SC4 Wikipedia
Network Addon Mod
Dependencies
Chat

Author Topic: Batch Png to Fsh tool  (Read 52885 times)

0 Members and 1 Guest are viewing this topic.

Offline Tarkus

  • Administrator
  • Forums Legend
  • *
  • Posts: 11468
  • Total likes: 5048
  • Reputation: 73
  • NAM Team Tankadillo
    • NAM HQ
  • CL: Dr. PuzzlePiece
Re: Batch Png to Fsh tool
« Reply #20 on: December 10, 2009, 02:37:44 AM »
Thanks again for the quick reply and solution, null!  It works perfectly here on my end! :thumbsup:

-Alex

Offline Shadow Assassin

  • NAM Team
  • Forums Guru
  • *
  • Posts: 3232
  • Total likes: 12
  • Reputation: 25
  • Needs more cowbell.
  • CL: The Grid Reaper
Re: Batch Png to Fsh tool
« Reply #21 on: December 12, 2009, 10:06:07 PM »
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!

Offline null45

  • Lex Certified
  • Forums Mayor
  • *
  • Posts: 221
  • Total likes: 27
  • Reputation: 18
  • CL:
    All formats lead to FSH
Re: Batch Png to Fsh tool
« Reply #22 on: December 13, 2009, 09:36:35 PM »
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.

Offline Jonathan

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2609
  • Total likes: 5
  • Reputation: 25
  • CL: Einstein, Jr. &scl()
Re: Batch Png to Fsh tool
« Reply #23 on: February 07, 2010, 11:51:26 AM »
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.

Offline null45

  • Lex Certified
  • Forums Mayor
  • *
  • Posts: 221
  • Total likes: 27
  • Reputation: 18
  • CL:
    All formats lead to FSH
Re: Batch Png to Fsh tool
« Reply #24 on: February 08, 2010, 09:02:45 PM »
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.  ;)

Offline Jonathan

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2609
  • Total likes: 5
  • Reputation: 25
  • CL: Einstein, Jr. &scl()
Re: Batch Png to Fsh tool
« Reply #25 on: February 09, 2010, 01:43:33 AM »
is there a reason for that?
Also do you know what SC4tool uses?

Offline null45

  • Lex Certified
  • Forums Mayor
  • *
  • Posts: 221
  • Total likes: 27
  • Reputation: 18
  • CL:
    All formats lead to FSH
Re: Batch Png to Fsh tool
« Reply #26 on: February 09, 2010, 02:57:37 PM »
Quote from: Jonathan
is 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: Jonathan
Also do you know what SC4tool uses?

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

Offline null45

  • Lex Certified
  • Forums Mayor
  • *
  • Posts: 221
  • Total likes: 27
  • Reputation: 18
  • CL:
    All formats lead to FSH
Re: Batch Png to Fsh tool
« Reply #27 on: February 13, 2010, 11:09:39 PM »
Updated to use the higher quality Fshwrite compression when writing DXT1 or DXT3 fsh files.

File version updated to 1.4.4.4.   :thumbsup:

Offline Tarkus

  • Administrator
  • Forums Legend
  • *
  • Posts: 11468
  • Total likes: 5048
  • Reputation: 73
  • NAM Team Tankadillo
    • NAM HQ
  • CL: Dr. PuzzlePiece
Re: Batch Png to Fsh tool
« Reply #28 on: February 14, 2010, 01:06:38 PM »
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

Offline null45

  • Lex Certified
  • Forums Mayor
  • *
  • Posts: 221
  • Total likes: 27
  • Reputation: 18
  • CL:
    All formats lead to FSH
Re: Batch Png to Fsh tool
« Reply #29 on: February 14, 2010, 02:45:49 PM »
That bug has been fixed, File version updated to 1.4.4.5   ;)



 

Offline Tarkus

  • Administrator
  • Forums Legend
  • *
  • Posts: 11468
  • Total likes: 5048
  • Reputation: 73
  • NAM Team Tankadillo
    • NAM HQ
  • CL: Dr. PuzzlePiece
Re: Batch Png to Fsh tool
« Reply #30 on: February 14, 2010, 08:34:25 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

Offline Shadow Assassin

  • NAM Team
  • Forums Guru
  • *
  • Posts: 3232
  • Total likes: 12
  • Reputation: 25
  • Needs more cowbell.
  • CL: The Grid Reaper
Re: Batch Png to Fsh tool
« Reply #31 on: April 07, 2010, 09:34:20 PM »
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!

Offline null45

  • Lex Certified
  • Forums Mayor
  • *
  • Posts: 221
  • Total likes: 27
  • Reputation: 18
  • CL:
    All formats lead to FSH
Re: Batch Png to Fsh tool
« Reply #32 on: April 10, 2010, 01:30:06 AM »
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.

Offline Shadow Assassin

  • NAM Team
  • Forums Guru
  • *
  • Posts: 3232
  • Total likes: 12
  • Reputation: 25
  • Needs more cowbell.
  • CL: The Grid Reaper
Re: Batch Png to Fsh tool
« Reply #33 on: April 15, 2010, 07:49:36 PM »
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!

Offline null45

  • Lex Certified
  • Forums Mayor
  • *
  • Posts: 221
  • Total likes: 27
  • Reputation: 18
  • CL:
    All formats lead to FSH
Re: Batch Png to Fsh tool
« Reply #34 on: April 15, 2010, 09:14:34 PM »
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
 

Offline Tarkus

  • Administrator
  • Forums Legend
  • *
  • Posts: 11468
  • Total likes: 5048
  • Reputation: 73
  • NAM Team Tankadillo
    • NAM HQ
  • CL: Dr. PuzzlePiece
Re: Batch Png to Fsh tool
« Reply #35 on: June 22, 2010, 03:25:55 AM »
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

Offline null45

  • Lex Certified
  • Forums Mayor
  • *
  • Posts: 221
  • Total likes: 27
  • Reputation: 18
  • CL:
    All formats lead to FSH
Re: Batch Png to Fsh tool
« Reply #36 on: June 22, 2010, 11:00:59 PM »
Quote from: 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 definitely is not a up-scaled Zoom 2 fsh.  :D
Does the same thing happen in SC4Tool?

Quote from: Tarkus
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.

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. 


Offline Tarkus

  • Administrator
  • Forums Legend
  • *
  • Posts: 11468
  • Total likes: 5048
  • Reputation: 73
  • NAM Team Tankadillo
    • NAM HQ
  • CL: Dr. PuzzlePiece
Re: Batch Png to Fsh tool
« Reply #37 on: June 23, 2010, 02:15:58 AM »
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

Offline null45

  • Lex Certified
  • Forums Mayor
  • *
  • Posts: 221
  • Total likes: 27
  • Reputation: 18
  • CL:
    All formats lead to FSH
Re: Batch Png to Fsh tool
« Reply #38 on: June 23, 2010, 11:51:56 PM »
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.  :)

Offline Tarkus

  • Administrator
  • Forums Legend
  • *
  • Posts: 11468
  • Total likes: 5048
  • Reputation: 73
  • NAM Team Tankadillo
    • NAM HQ
  • CL: Dr. PuzzlePiece
Re: Batch Png to Fsh tool
« Reply #39 on: June 24, 2010, 07:16:59 PM »
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