Poll

How much would you be willing to contribute towards a joint HLP pledge? ($2500 is the target)

$1
6 (5.6%)
$3
5 (4.7%)
$5
12 (11.2%)
$10
21 (19.6%)
$20
27 (25.2%)
$50
20 (18.7%)
$75
1 (0.9%)
$100
9 (8.4%)
$200
4 (3.7%)
More (Please Post)
2 (1.9%)

Total Members Voted: 93

Author Topic: This makes me giddy  (Read 70758 times)

0 Members and 1 Guest are viewing this topic.

Offline niffiwan

  • 211
  • Eluder Class
Well, I'm already caching all the frames as they're created so it might not be too hard.  I'll dig into it further once I've got the other use cases sorted out.



edit: I'm kinda turning this post into a TODO list...

Done:
Headanis (streaming, tested with 3x sample apngs from Axem)
CB anis (streaming, tested with random apngs created by me)
Mainhall animations (streaming, tested with Mjn's Krios mainhall test, effs converted to apngs)
PXO logo (streaming, tested with JAD headani renamed to 2_pxologo.png)
Multi countdown timer (streaming, tested with Diaspora's 2_count.eff converted to an apng)
Techroom Weapons/Intelligence (streaming, tested both)
Loop Briefing Animations (streaming, not tested as I'm too lazy to play through the mission prior to a loop mission right now)

TODO:
LUA gr.loadTexture() or gr.loadStreamingAnimation() (i.e. streaming option rather than load all into bmpman options)
Effects
Loading screens
Shield anis
(need to review code to find all use cases)

Won't do:
Ship/Weapon selection animations (requires keyframe support; alternative is to use 3D selection options)
« Last Edit: December 08, 2015, 05:50:48 am by niffiwan »
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline niffiwan

  • 211
  • Eluder Class
So. Tax is done and I owe stuff, boo hiss.

On the other hand, I've refactored the apng code to make it simpler, and I didn't have to add anything for this to start (mostly!) working  :)

Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Le awesome! I'm assuming you've tested transparency? (ANI was never really built for transparency in Anims, and I know EFF transparency works.. just being thorough about APNG.)
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline niffiwan

  • 211
  • Eluder Class
I haven't actually tested transparency yet, although as you say it should just work since this is the PNG format and I'm processing it with an alpha channel.  Anyway, I'll see if I can test it and report back (although I warn you that last night was the first time I've ever edited video in my life, and so far I suck! :))
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
So, given that you're the one implementing this niffiwan... what exactly did our money pay for?

Were we scammed?
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline niffiwan

  • 211
  • Eluder Class
Well. As I see it (and maybe Rei had a different view) the money went towards making apngasm available. i.e. there's a tool available now that will assemble apng's which FSO can use. Now, I feel that what we paid should have got FSO an apng decoder built into FSO. That's not exactly porting an "apng assembler" (i.e. apngasm) to a new language, or creating an API for a new language as per the Kickstarter page. But I thought there was a general understanding that this is what we wanted despite it not being exactly what was on offer.

Were we scammed? I dunno. Maybe yes, maybe it was a misunderstanding. By implementing this myself I feel that from a certain point of view it can be said that the $2500 that HLP jointly paid resulted in a tool that can create apngs, and a FSO that can play them (or it will once I complete the coding). And that's what we ultimately wanted so it should be OK.

(To add complexity, I based the FSO code on code that Max Stepin published after the kickstater (i.e. in 2014). It'd certainly have been harder for me without access to that code which was quite possibly created due to the agpngasm kickstarter).
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline niffiwan

  • 211
  • Eluder Class
OK, I believe I've got all the streaming cases covered now (including dealing with variable frame delays) and I've specifically tested headanis, cbanims and mainhall animations.

Here's a binary if anyone else would like to test this.
http://www.mediafire.com/download/v5khf2l65kk2dsa/fs2_open_3_7_3_SSE2_apng.7z

Code is here: (just be warned that I sometimes rebase the branch... but that shouldn't matter if you only want to compile):
https://github.com/niffiwan/fs2open.github.com/tree/apng

And here's a video showing all three use cases; including transparency in the cbanim (oversized to emphasise transparency) and with all door animations in the Krios mainhall converted from EFF to APNG)

(next up will be non-streaming uses, which will require pre-processing the entire apng and saving all frames individually into bmpman.  And/or implementing a streaming LUA interface, whichever turns out to be easier)
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

  

Offline headdie

  • i don't use punctuation lol
  • 212
  • Lawful Neutral with a Chaotic outook
    • Minecraft
    • Skype
    • Twitter
    • Headdie on Deviant Art
Nice work
Minister of Interstellar Affairs Sol Union - Retired
quote General Battuta - "FRED is canon!"
Contact me at [email protected]
My Release Thread, Old Release Thread, Celestial Objects Thread, My rubbish attempts at art

 
 
 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Being able to turn 3900 something frames into just a bunch of (much smaller, space wise) apng has given me a lot of joy.
Thanks niffiwan-wan~
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline niffiwan

  • 211
  • Eluder Class
tl;dr Will anyone be upset if apng's don't work correctly for glowing textures?


So. I have a question for everyone.  But, first you get to wade through some background info  ;7

I've implemented the basics of non-streaming apngs, and have encountered an interesting problem.  I was trying to test apngs for modeled thruster animations (yeah, as I have found out, using png's for textures really isn't recommended, let's ignore that for a sec). Now, apngs require an alpha channel for composing frames, as each frame is stored as a delta from the previous frame and the delta needs to be blended using the alpha (according to some rules). Or in other words, the way it is currently coded you can't have an apng without an alpha channel.  Per Herra_Tohtori's excellent texturing guide, this is not recommended for glowing textures. They aren't alpha-blended correctly and the result is odd looking: (I've been calling it "dark matter thrusters" :nervous:) (edit: added the correct looking thrusters)



Does this really matter? There's a couple of reasons I think it doesn't matter and that this is as-intended behaviour:

1) You're not supposed to use PNGs for textures (DDS all the way... even for normal maps, just use dxt5nm or a lower resolution uncompressed DDS ;))
2) If you add an alpha channel to your glowing textures (e.g. convert dxt1c to dxt5) you get the same incorrect result

Now the question!

Will anyone be upset if apng's don't work correctly for glowing textures?

(where the term "glowing textures" is only loosely defined at this stage until I work through the rest of the places animations are used in FSO, probably everything listed here)

(ps. if this does matter then I'll have to do something like hack out the alpha channel data according to flags set in the required places in the code: while (src < size) { memcpy(dst, src, 3); src+=4}.  Or maybe check each frame after composition to see if all pixel's alpha == 255, and if so then clobber the alpha... but.. bpp is assumed to be constant for the entire apng... gah!)
« Last Edit: December 23, 2015, 09:59:36 pm by niffiwan »
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
My gut reaction is to not clobber the alpha channel. Don't hack the code. Don't hack the format. Let APNGs be APNGs. If they offer a different result, well.. go use the proper format for that specific use-case.

I feel like it's simpler to maintain this way, for one.(?) For another.. don't use (A)PNGs for textures!
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Agreed.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
^What they said^
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Or maybe we could get FSO to be...smarter with alpha channels and glowing texturess and actually alpha blend them correctly?
I mean, if it's doing something wrong we shouldn't be simply tolerating that behaviour...

This is not in the scope of getting APNGs to work, don't need to worry about that (since it's not APNG's fault anyway), but just in the long run.
(´・ω・`)
=============================================================

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
We can and should think about doing that in the long run, absolutely.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Indeed. Another reason not to hack the code/format for APNG specifically. That would just be something to remove later.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline niffiwan

  • 211
  • Eluder Class
Because I can't leave well enough alone I've been running some more tests; and I've managed to get the apng to display almost correctly. It's an asset problem, not a code problem (which in hindsight is super obvious). The original thruster frames were dxt1c, using black to denote transparency. If you only add an alpha channel, FSO uses that instead of the black pixels to alphablend the image, and you get lots of black in the result. With a bit of gimp script hacking I batch "black to alpha" converted the frames, built the apng and it now looks mostly like what you'd expect (viewing from directly aft there's a few faint extra rectangles which weren't originally there, i.e. a bit of outline colour on the modelled thrusters geometry)



Therefore the problem was me not understanding enough about using textures :nervous: BUT, it's still been useful because I now know not to worry about apng usage for textures which should seriously reduce the number of test cases I need to execute. (And as a side bonus I know a heck of a lot more about texturing, image formats, imagemagick & gimp :D)
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline headdie

  • i don't use punctuation lol
  • 212
  • Lawful Neutral with a Chaotic outook
    • Minecraft
    • Skype
    • Twitter
    • Headdie on Deviant Art
damn that is looking good, and nice progress with apng
Minister of Interstellar Affairs Sol Union - Retired
quote General Battuta - "FRED is canon!"
Contact me at [email protected]
My Release Thread, Old Release Thread, Celestial Objects Thread, My rubbish attempts at art