Animated sprites

  • Hello,

    Is there a way for objects to use animated sprites as a texture? My idea is that there is either a single "all-in-one" file containing all frames of animation or that each frame is a separate file following a naming convention (ad.0.bmp, ad.1.bmp, ad.3.bmp ...) . If possible, probably a script or something would be needed but I don't have any knowledge about LOTUS scripting to code it by myself.


    One of the use cases for this would be to have animated billboards and stuff like that.

  • Can we change UV maps via script, so the idea is to export object with two multiple UV maps and then switch them using a script? I asked ChatGPT about this but it suggests function "SetUVMap" which doesn't exist.

  • Pretty sure that's not possible as a concept with the way texture/UV exporting from Blender works in LOTUS, the only option I can think of is using multiple objects and swapping them via visibility variables. Maybe you could also do some funny things with detail textures and alternative texture coordinates (@2m_ objects) but that wouldn't allow more than two UV maps and would also be an extremely scuffed way of doing it.


    As for the original question (animated textures), you could certainly use seperate textures and play them as a video if you'd like to clog up your graphics memory, but I don't think you can have something like that that looks good and really works as of now. Slideshows should be fine, but full videos/animated graphics would probably not be a good idea at the moment.

  • My idea isn't to play full videos of course or "rich animations", I thought if it's possible to just manipulate what is displayed on a mesh. So ideally, the script would either load frames based on file name (so file per frame) which seems like a bad idea right now or it would just change which part of the texture is displayed.


    Here is example that I created. I just added some saturation so it's a basic effect. The first frame is top left, and the last is bottom right.




    I think it's not #1 priority for LOTUS, but also there are a lot of animated signs and stuff nowadays, so this would make cities more vibrant.

  • That is actually possible at the moment. For the material type "complex" there are two values called "Texturverschiebung X/Y" in german. Maybe texture shift in english? With these values the mapping of an image can be moved by its x and y axis. 0 displays the original mapping, 1 a shift by one texture length. So in your example you would shift the texture by 0.5.


    I wrote a little script that can be used for this matter. It increases one value based on the the fps needed and the number of frames on the texture. These frames have to be placed in one single row, so either next to each other or beneath each other. You map your object to the first frame, change the material to complex, enter the variable into the right box of either Texturverschiebung X or Y, write a 1 in the left box, and you're done. Or so I think.

  • Thanks! With some tweaking I came up with good solution.

    1. I changed the texture so frames are vertically arranged, and increased amount to 8. (texture is 1024x4096, but I will probably reduce its size)
    2. I adjusted some things in script and now it works nicely.



    Files

    • billboard.pas

      (359 Byte, downloaded 114 times, last: )
    • preview.jpg

      (196.66 kB, downloaded 137 times, last: )
  • Newly created posts will remain inaccessible for others until approved by a moderator.

    The last reply was more than 60 days ago, this thread is most likely obsolete. It is recommended to create a new thread instead.

    The maximum number of attachments: 5
    Maximum File Size: 500 kB
    Allowed extensions: bmp, cfg, ini, jpeg, jpg, lct, ldl, llg, lob, log, lpmtl, lptmt, ltx, pas, pdf, png, railtrack, rar, txt, veh, wav