Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Water Effect/Looping Animation Over Pre-Rendered Background — Gideros Forum

Water Effect/Looping Animation Over Pre-Rendered Background

DirtyHarryDirtyHarry Member
edited May 2012 in General questions
Hello everybody!

We have been playing a bit with the great Gideros SDK in the past days, but I have a question. I know this is not a feature that is supposed to be in a 2D engine like Gideros, but I am just asking since many people here seem to know their stuff well.

We are working on an adventure game, think something like Myst or The Lost City (made on Corona SDK), which we would like to be able to deploy on iOS and later to Android, Nook, and Kindle Fire. It is going to be a beautiful looking game, and thus we are testing a bit on Gideros and other Lua based frameworks in an effort to find the best solution for us.

The game uses pre-rerendered backgrounds, and in some scenes we have water in the image which we'd like to animate; one of the scenes, in particular, takes place on a shoreline, and it is fundamental to the plot of the game, so we cannot edit it out.

Which approach would you take to animate the water in scenes like this? Am I right thinking that the best solution would be to prerender the water to some textures and then write a function to iterate through the pre-rendered textures? The big limitation of doing this is of course the low number of frames we could afford using, due to memory/performance.

Is there another approach you'd use instead?

Thanks!

Comments

  • evsevs Member
    Is this approach by ndoss any good for your needs?

    http://www.giderosmobile.com/forum/discussion/644#Item_1


    cheers

    evs
  • @DirtyHarry, back when I first started with Gideros a couple of months ago I put in a request for asynchronous texture loading so that a new texture pack could be loaded in the background between frames. This would mean that one would be able to create arbitrarily long animations (as you suggest) by splitting them up into separate slices so that only one portion would need to be in memory at any time. When one slice finishes, the next could then be loaded quickly between frames so the animation could continue without stuttering.

    I believe this feature would solve your problem because you would then be able to pre-render your water animation and play it back without using too much memory. You would only need to hold, maybe, 4-6 frames in memory at any one time. The asynch texture loading has made it onto the Gideros road map and I believe should be in the next version 2012.2.3.

    Here is the original thread, http://www.giderosmobile.com/forum/discussion/601

    Actually, given the fact that you are animating water which, by it's nature is somewhat blurry and not particularly smooth motion, you may even be able to to this with Gideros as it stands. It's just that without the asynch loading of the next sequence you'd get a short stutter in the animation between segments. This stutter was too great for my purposes but in this case might work out okay.

    Best regards
  • Guys, thank you very much for your kind replies.

    evs's thread is interesting, and I have seen it - but it is not exactly the effect I am looking for. But it is something to keep in mind for real time fluid simulation!

    Bowerandy: that is exactly what I would need, thanks for linking me to that thread. I will play a bit with the current Gideros setup then, even though I do not have the urgency to implement this water animation immediately. Development of the game will take many months, so I could wait for a release supporting this, maybe. But I will get started with what we have now.

    Thanks so much!
  • bowerandybowerandy Guru
    edited May 2012
    @DirtyHarry, another thought springs to mind too. Have you thought of using a particle engine to create realtime ripple effects. I'm not that experienced with particles but, for example, I see that this desktop particle product (TimelineFX) can create liquid effects. See:

    http://www.rigzsoft.co.uk/index.php?option=com_content&view=article&id=41&Itemid=24

    and scroll down to Liquid Effects. Now this isn't directly helpful because, as I say, it's a desktop particle simulator but it shows what can be done. The good thing is that there is a particle system for Gideros, and it's rather groovy:

    http://www.giderosmobile.com/blog/2012/03/13/tnt-particles-engine/

    Perhaps, you could use this to create the water effect you want dynamically?

    Best regards

  • Hello @bowerandy, that is a very good tip. In fact, there are also javascript effects that work like particle effects that are used to create those water ripple effects.

    I will look into this further and let you know if I come with a solution.

    P.S. Sorry for the slow reply, unfortunately I do not have as much time as I would to work on this.
Sign In or Register to comment.