project-navigation
Personal tools

Author Topic: Animated Textures for UFOs [CODING HELP NEEDED !!!]  (Read 33245 times)

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Animated Textures for UFOs [CODING HELP NEEDED !!!]
« on: March 12, 2010, 12:20:39 am »
I was looking @ the Alien-Base-mission & I really liked the animated textures there  8)

Wouldn't it be a nice eye-candy to have some animated textures in the UFO-models also ?

I thought about stuff like glowing buttons, buttons changing color, monitors changing content (see attachments)...

I did not want to make the impression to just wanting to request new features, so I attached some examples to show that I would also invest some workforce here if the developers agree that this would be  :)

P.S.: @Kildor: The UFO Gunboat you designed looks great IMO !
« Last Edit: May 31, 2011, 01:48:17 pm by MCR »

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
 ???

Offline Kildor

  • Project Artist
  • Captain
  • ***
  • Posts: 757
  • Project mapper and some other stuff`er
    • View Profile
    • http://ufoai.nx0.ru
Hello, thanks for idea and frames. Yes, this is very good idea, and your way is working nice, but there is one problem with jpeg-saving artifacts. Can you make the same images but in png, and with removed garbage around indicators? After that I gladly add animation to the game :-)

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Hi MCR, you should have a look at the wiki on the Material System and it's Blend Modes. You can blend one texture on top of another, and even animate the textures blended on top.

This means rather than creating a series of textures that are swapped out, you could create a base texture with all black panels. Then you can create a series of textures that are transparent except for the lights and swap these. That way you can have a lot of frames without loading a full 256x256 texture each time.

As an example, check out the /textures_misc/rail_route.png and its rail_route*.tga brothers. In each rail_route*.tga a different stop on the route is overlayed on the base PNG, and in the material definition I'm using, I've set it up to rotate between the TGAs, for an animated sign.

The material definition for that texture is the following:

Code: [Select]
# Rail Route Board
{
material tex_misc/rail_route
{
texture tex_misc/rail_route0
blend GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
anim 4 0.6
lightmap
}
}

The same principle could be used for your idea, and you can save a lot of space. For instance, all 5 of my 256x256 TGA files (the animation) are less than half the size of the base PNG. So you can have tons of animation sequences to prevent the obvious-ness of the repetition without loading tons of larger files.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
@Kildor:
Great, that you will use the frames, I will put hard work into it to make them look & animate as good as possible...
The attachment here is the cleaned-up version of the original jpg. I cleaned the buttons & the grey color around them from all the artifacts already there... Looks much better now ! But if I save it as uncompressed png in GIMP, it gets a lot bigger, which compression rate should I choose there ?

@H-Hour:
Thanks a lot for the links, you are answering questions that already were floating around in my mind, especially how to make the animations small in size, without having to switch the full texture to have some buttons switch color...
The rail_route example you gave explains everything perfectly, I will try to do it the same way, I hope this will not complicate things for Kildor ?!

Offline Kildor

  • Project Artist
  • Captain
  • ***
  • Posts: 757
  • Project mapper and some other stuff`er
    • View Profile
    • http://ufoai.nx0.ru
> I hope this will not complicate things for Kildor ?!
No :-)
His way is much better.

I want to make some investigations according this textures, and may be commit some changed textures.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Another Question:
Should I save the png & tga files compressed or uncompressed ? - makes a big difference...
- Here are some png examples:

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Here come the buttons in tga format with & without compression (the other way round  ;)):

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
@Kildor: I saw you commited stuff already ?  ::)

Offline Kildor

  • Project Artist
  • Captain
  • ***
  • Posts: 757
  • Project mapper and some other stuff`er
    • View Profile
    • http://ufoai.nx0.ru
Yep. :-)

Sorry, if I messed your work. And thanks for http://ufoai.ninex.info/forum/index.php?topic=4540.msg34858#msg34858, this has helped me.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Question to the developers - Animated Textures for UFOs or elsewhere ?
« Reply #10 on: March 12, 2010, 03:10:06 pm »
@Kildor: Maybe we should coordinate our workforce a little bit, I think there is lots of stuff which could need some polishing & animation work & IMHO it is a little bit inefficent if 2 people do the same stuff @ the same time...
I am looking forward to seeing the buttons switch  ;)
Maybe you could answer the questions regarding the compression ?



Offline Mattn

  • CaveExpress
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4830
  • www.caveproductions.org
    • View Profile
    • CaveExpress
Re: Question to the developers - Animated Textures for UFOs or elsewhere ?
« Reply #11 on: March 12, 2010, 05:00:26 pm »
if you commit them to our svn - don't forget to add svn:copyright and svn:license (the license must be the same as the original texture of course)

Offline Kildor

  • Project Artist
  • Captain
  • ***
  • Posts: 757
  • Project mapper and some other stuff`er
    • View Profile
    • http://ufoai.nx0.ru
Re: Question to the developers - Animated Textures for UFOs or elsewhere ?
« Reply #12 on: March 12, 2010, 05:52:23 pm »
I will not be near computer till sunday, so fill free to do all what you want. :-)
Also, you can use jabber.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Question to the developers - Animated Textures for UFOs or elsewhere ?
« Reply #13 on: March 12, 2010, 06:52:26 pm »
@Mattn: Thanks 4 the permission to change stuff, but I do not want to mess around with the svn-version yet, because I want to get more familiar with everything, before I start adding things, which will then maybe make a mess of the currently relatively smooth running 2.3dev  ;)
For example I still do not know about the best compression for the tgas & pngs, do not know where to put the code 4 the animation among many other things, but I am happy to help you where I can & if I can help with making some animated textures, I will do it !
I will upload my next results here soon, so maybe you or Kildor could integrate them... (& check the files first  ;))

@Kildor: Thanks 4 your trust, I will start with cleaning the ufo-textures & making some animations with them. I would be happy if you could test the stuff on sunday & integrate it, if it is smooth...

Offline Mattn

  • CaveExpress
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4830
  • www.caveproductions.org
    • View Profile
    • CaveExpress
Re: Question to the developers - Animated Textures for UFOs or elsewhere ?
« Reply #14 on: March 12, 2010, 07:19:29 pm »
https://sourceforge.net/apps/trac/ufoai/changeset/28917

this commit by kildor might explain how to do the material definitions. and here : http://ufoai.ninex.info/wiki/index.php/Mapping/Materialsystem you can find more information about the material system.