Godot Documentation: Animating Thousands of Objects

in utopian-io •  6 years ago 

Repository

https://github.com/godot/godot-docs

Details

This contribution is made out of two brand new tutorials that walk the user through ways of animating and controlling thousands of objects in Godot. The inspiration came from the game ABZU, which has thousands of fish beautifully animated.

By the end of the tutorial the reader is able to animate a fish like the one below:

The unique thing about this animation is that it is done in the vertex shader rather than with bones and a skeleton. A skeleton is the go to form of animation, but it requires every bone for every object to be updated on the CPU. With vertex animation, the animation is calculated on the fly by the GPU and is thus much faster. The only limitation is that you have to make your animation in code rather than using animation software.

Using this method you are able to have thousands of fish on-screen at once all animated, even on low end hardware:

Here is an example of a scene captured on a low-end chromebook (the gif is too large to embed in the post).

The biggest difference I see this tutorial making is to expose users unfamiliar with rendering to an easy method to squeeze high-end performance out of low end-hardware. Using this tutorial you could easily animate thousands of objects on a mid-range smartphone. On a gaming computer you can easily animate tens of thousands of objects (or even hundreds of thousands, depending on the complexity of the mesh). Hopefully as users pick up on this tutorial we will see the creation of more complex scenes in Godot.

Components

Each tutorial focuses on one type of node that can be used for drawing thousands of objects efficiently. The first uses the MultiMesh and the second uses Particles.

MultiMeshes are typically used for drawing thousands of static objects, such as trees or grass. However, using vertex animation, you can animate the objects for little cost. MultiMeshes are a great way to squeeze performance out of low-end hardware. Currently, there are no tutorials in the official docs on how to use them, accordingly lots of users did not know that they exist, or even if they did, they do not know how to use it. Now, however, we should see them used more and more.

Particles are usually used for VFX like explosions or trails behind objects. However, they take advantage of static instancing (which uses the GPU to draw the same object thousands of times very efficiently) and transform feedback (which uses the GPU to compute movement of objects. More tutorials can be added on particles because they are such a useful and powerful concept in game programming. Hopefully this tutorial serves as a good, practical introduction for new users.

Links

Part 1: Animating thousands of fish with MeshInstance
Part 2: Controlling thousands of fish with Particles

GitHub Proof of Authorship

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hello @clayjohn,

It is another great documentation by you which is really great to see.

I have staff picked the contribution.

Sorry for the late review as I was busy with some personal stuff.

I really love the time you are spending on the project in order to improve the documentation of it.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you! I am very proud of this one.

Thank you for your review, @ms10398! Keep up the good work!

Hi @clayjohn!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Congratulations @clayjohn! Your post received a small up-vote from @wod-game as little gift.
We are a small group of people who want to create the next big Video game for Steem.
Want to know more about us?
Steem: @wod-game
Discord: Click here!

Have a nice Day!

Very cool, thanks for all your work on the Godot documentation. This is how you get more people using the product, with more ways to learn!

Thanks! I appreciate the comment! It's always nice for Godot to get a little more exposure.

Congratulations! Your post has been selected as a daily Steemit truffle! It is listed on rank 21 of all contributions awarded today. You can find the TOP DAILY TRUFFLE PICKS HERE.

I upvoted your contribution because to my mind your post is at least 2 SBD worth and should receive 74 votes. It's now up to the lovely Steemit community to make this come true.

I am TrufflePig, an Artificial Intelligence Bot that helps minnows and content curators using Machine Learning. If you are curious how I select content, you can find an explanation here!

Have a nice day and sincerely yours,
trufflepig
TrufflePig

Hey, @clayjohn!

Thanks for contributing on Utopian.
Congratulations! Your contribution was Staff Picked to receive a maximum vote for the documentation category on Utopian for being of significant value to the project and the open source community.

We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!