Search Unity

Importing Image Sequence W/Alpha-Animated Billboard Texture?

Discussion in 'Editor & General Support' started by brucegregory, Dec 28, 2005.

  1. brucegregory

    brucegregory

    Joined:
    Nov 12, 2005
    Posts:
    185
    I've noticed that the search function for this forum always comes up with no results. Is this a known problem?

    Anyway, I couldn't find anything by searching, so can anyone say whether it is possible to import a sequence of .png images with transparency for use as an animated billboard texture which always faces the camera? If so, how is this done?

    Thanks,

    Greg Smith
     
  2. socksy

    socksy

    Joined:
    May 21, 2005
    Posts:
    244
    Perhaps a big red banner at the top of the forums should be put up saying "No search!!!". It would make more sense than saying it 73 times.
    Yes, the forum search is down, but you wouldn't have found any of the previous threads saying so, due to lack of search ;)

    I'll leave the specifics of the answer to someone else with the manual in front of them, but yes - it is possible.
     
  3. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    Unity can import QuickTime movies as animated textures. Once that is done, you need to make a small script to play the movie.

    The easiest way to get billboarded stuff in your scene is to make a particle system. Create a particle system, remove any Particle Animators that it may come with, set Particle Emitter's properties as follows:

    One Shot -> Enabled (makes the particles be static, rather than spawned every second
    Min Max Emission -> 1 (you only want one)
    Min Max Energy -> 1000000 (you want it to stick around)

    Then create a material with a Particle shader (I assume you want Particles->Alpha Blended), assign your quicktime file as the texture.

    the script you need to attach is in the Script Reference under FileTexture.
     
  4. brucegregory

    brucegregory

    Joined:
    Nov 12, 2005
    Posts:
    185
    Nicholas:

    So, animated textures are possible, just not with an alpha channel, since Quicktime doesn't support that, correct? No .png sequence support.

    Greg Smith
     
  5. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    Quicktime supports alpha. The recommended CODEC for it is Animation with depth set to Millions Of Colors+ (the + seems to be the alpha)

    I believe you can create a quicktime file from multiple PNGs using the full version of quicktime player some bitchy cut paste. Otherwise, Final Cut or After Effects are your friends.
     
  6. NCarter

    NCarter

    Joined:
    Sep 3, 2005
    Posts:
    686
    The QuickTime Player (in pro mode) has an Open Image Sequence command on its File menu. I just tried that and was able to automatically import a bunch of PNG sprites with alpha in one go, and it worked fine in Unity. Incidentally, the result of importing a PNG sequence is a QuickTime movie where all the frames are PNG compressed, so you don't lose any quality this way.

    For reference, you need to name your files YourFileName_0000.png, YourFileName_0001.png or something similar to get it to load them all correctly.

    The script Nicholas mentions worked perfectly. :)
     
  7. Bampf

    Bampf

    Joined:
    Oct 21, 2005
    Posts:
    369
  8. Reznic

    Reznic

    Joined:
    Sep 13, 2005
    Posts:
    21
    I've been wondering about animated textures as well. Can anyone show me an example script for having a QuickTime texture play?
     
  9. jeremyace

    jeremyace

    Joined:
    Oct 12, 2005
    Posts:
    1,661
  10. bigbrainz_legacy

    bigbrainz_legacy

    Joined:
    Jul 15, 2005
    Posts:
    137
    For some reason I can't get Quicktime to export a movie that has alpha. I originally thought it was a shader question, so I started a new post, but it came back closer to this subject.

    I've posted my sample files on the other link if anyone can help me figure out what I'm doing wrong:

    http://forum.unity3d.com/viewtopic.php?p=14756#14756

    Thanks!
     
  11. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    I remember quicktime pro having problems keeping the alpha of images alive too.

    Why do you want to use a quicktime animation for this anyway? If you are making fire cant you just do a particle system and make one texture which contains sub images and animate using the particle renderer animated texture feature.
    http://unity3d.com/Documentation/Components/class-ParticleRenderer.html
     
  12. bigbrainz_legacy

    bigbrainz_legacy

    Joined:
    Jul 15, 2005
    Posts:
    137
    Oh man--because I didn't know it existed!! That's the exact format it was already in before, and I spent forever changing it into a Quicktime thing. I haven't found the documentation about the format for the sub-images or how to control the playback speed and such, but that will definitely be much smoother.

    I'll give you an update as soon as I figure out how to do it.
     
  13. bigbrainz_legacy

    bigbrainz_legacy

    Joined:
    Jul 15, 2005
    Posts:
    137
    [EDIT]
    Hey, I figured it out. Just had to read a bit higher up in the documentation, then the only thing that threw me off was lifespan. I initially had my lifespan set super high so the torch would last forever, but the "Cycles" are directly tied to lifespan--as in Cycles per lifespan, so it was cycling, but it was just going so slowly that it didn't look like it was doing anything.

    I'd vote for using "-1" for infinite lifespan and cycles. I'd also vote for a "lock to lifespan" checkbox. Or better yet, just a "loop forever" option?

    Great features and documentation guys!
     
  14. bigbrainz_legacy

    bigbrainz_legacy

    Joined:
    Jul 15, 2005
    Posts:
    137
    Joachim,

    Using a particle has two limitations for what I'm trying to do.

    1. I only want the flame to rotate to face the camera on one axis. The base of the flame needs to always be rooted in the torch, and burn "up". As it is, if you got close to the torch and looked up, the flame would be nearly horizontal.

    2. I need to be able to scale the torch. The flame image is a tall image, but the particle will only remain square (since it's not moving I can't use the velocity scale options).

    It seems it would be much simpler to just use my own flame polygon and then access the texture animation paramters somehow and script it to point at the camera the way I need it to. Can you tell me how to access the texture animation features on something other than a particle?

    Thanks!
     
  15. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Either use the mesh interface, or just set texture scale/offset in Material using SetTextureScale/SetTextureOffset from script.
     
  16. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Good idea. Bigbrainz, If you post the tiled texture images, i'll even write you the script.

    Makes for a nice script of the day.
     
  17. bigbrainz_legacy

    bigbrainz_legacy

    Joined:
    Jul 15, 2005
    Posts:
    137
    Sweet! Here she is--I've also got it in .psd format if you need it.

    Hmmm. The image isn't showing up corectly in my browser. Let me know if it isn't posting correctly.

    [edit] It's not very big, but it doesn't seem to like it for some reason--I'll try emailing it to you.
     

    Attached Files:

  18. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
  19. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Can i attach your texture to the wiki as an example?
     
  20. bigbrainz_legacy

    bigbrainz_legacy

    Joined:
    Jul 15, 2005
    Posts:
    137
    Joachim,

    Already put it in the game--works great! Yes, please attach the image in the wiki with our compliments :D .

    Thanks!
     
  21. Morgan

    Morgan

    Joined:
    May 21, 2006
    Posts:
    1,223
    Very nice flame!
     
  22. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
  23. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    This thread is over four years old, from back in the Unity 1.x days, and quite outdated. ;) (No more Quicktime movies, etc.)

    --Eric