Coder Social home page Coder Social logo

animatedmeshes's Introduction

AnimatedMeshes

Procedural Mesh Geometry for unity (VFX)

This is a naive approach to how 3D effects are made in some games that I wrote last year (2016), I wouldn't code it this way nowadays but anyway... The observation was that some effects cannot be reproduced with particles only and that sometimes meshes are coupled with particles to give the effect a volumetric sense. Using scriptable objects my goal was to simplify the creation of procedural mesh geometry and to implement it on an animation system that would orchestrate all the effets to build up more complexe effects that would be reusable.

This package gives you the possibility of:

  • Instantiating animated meshes that will be animated by bending/rotating/translating
  • Putting material modifiers on animated meshes to modify their colors/[x/y] tiling/[x/y] offsets
  • Create animated patterns (like the ones that are used on danmaku-type games)

For the moment the only mesh that can be instantiated are cones because they filled every needs I had (plus you can make cylinders and circles out of them), but more could easily be added like spheres or cubes...

Step 1 : The art

Of course to make effects you need art and maybe some shaders. Unity provides us with some neat shaders like those that are listed on Particles>(additive/alphablended/etc...). Use what best fits to your effect. Once you have an idea of what to use you can use GameObject > Create Other > Cone to create a static mesh and test your materials on it. I used a script originaly made by Wolfram Kresse (http://wiki.unity3d.com/index.php/CreateCone), I just had to tweak it a little bit because the uv mapping wasn't finished and I cut off some code that I didn't need.

Step 2 : Making the animation

On the project window, right clic > Create > AnimationFX > AnimatedMeshes > Cone to create an animated cone. It gives you plenty of parameters.

animatedconeinspector

The booleans "Create Assets" and "Auto Destroy" decides if the animation should be cached somewhere on the project (if the animation is used a lot it could be useful) and if the animated mesh should destroy itself when the animation is over. Another worth-explaining parameter is the "interpolationCurve", it gives more or less weight to the Initial OR Final State depending on where the animation is time-wise. (It could be read as "if InterpolationCurve(time) = 0 the state is equal to initial state and if IC(time) = 1 then the state will be equal to the final state).

animatedconeMaterialModifierInspector

Then you need to link a MaterialModifier to the animatedCone. It basically defines the behaviour of the material that will be attached to the animation. You can tweak offsets/colors and tilings with a MaterialModifier.

Step 3 : Put many animations together and make it a prefab

This is the final step before having fun with patterns (I will edit the post later to explain what animated patterns are) : creating a prefab full of procedural meshes.

Example

This project contains a sample of Charizard's Down Smash in Smash Bros.

Original Animation

charizardoriginal

Reproduced in Unity with multiple animated cones

charizardunity

Disclaimer: of course to catchup with the full smash4 animation you will need some particles, you cannot escape the need of particles ^^

animatedmeshes's People

Contributors

fabykun avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.