Metaballs Proof of Concept

Hi Guys,

Decided to take a short break from my Hair simulation stuff. ambershee suggested in IRC working on metaballs, so decided to take the work done by NVidia and implement it into UE4. First obstacle was that the Vertex Factories aren’t set up to use a Geometry Shader, so I modified this and allowed Vertex Factories to opt in for a Geometry Shader. Once I figure out the best design, I will submit a PR so that others can use Geometry Shaders with Vertex Factories in the future.


50 or so Metaballs with standard Reflection (Prior to adding Tangents and UVs).


Metaballs with UVs no Tangents.


Metaballs using a custom UVW blend to blend depending on Normal direction.

[video]https://drive.google.com/file/d/0BzqpBc4MrAMXMkpfUnJNakp2cUU/edit?usp=sharing[/video]
Metaballs in motion.

Still deciding on where this will go. I am thinking of replicating Crysis cave building system using metaballs and then there is also Portals goo.

Awesome! I assume this is based on the demo in the DirectX samples?

It is, with new normals and texture coordinates calculation

Portal style metaballs, lots of configurable settings such as gravity, initial force and location, max number of *****, spawn rate, etc.

Video:
https://drive.google.com/file/d/0BzqpBc4MrAMXY21odzBvaG9RVEk/edit?usp=sharing

Screenshots:


Wow awesome stuff !

Thanks for sharing the videos!

:slight_smile:

This is great stuff!

This is very cool. Great work!

That is amazing ! So cool ! :slight_smile:

Great stuff! I wanna try this.

That is very cool.

You are clearly a master with the C++ side of things.

Any chance of getting a basic custom shader tutorial?

The official docs on the subject aren’t all that great as a starting point.

I will be writing some documentation over the weekend on Vertex Factories, Global Shaders, Drawing Policies and such. It will contain a few examples of different shaders.

Thanks!! That would be fantastic.

Feel free to comment in https://forums.unrealengine.com/showthread.php?10928-How-to-create-custom-shader&goto=newpost if there is anything specific you would like me to cover, or any certain effects you want to see.

Awesome you beat me to it, this is exactly what I was working on before (but didn’t get this far) I’m interested on any docs you might produce for this!

This looks very cool! Any progress on it?

Hi all,

I have had a number of requests for the source to the Metaballs, so I am releasing it to everyone today. I was always hesitant due to the engine modifications that are required and how difficult it may be to keep it up to date. So I provide this with no assurance that it will be updated (I have updated it to v4.5 but may not going forward. I will accept pull requests).

This is still very heavy WIP, nowhere near production ready. I have a branch available where I will accept pull requests from anyone making awesome changes/fixes

https://.com//UnrealEngine/tree/MetaBalls-4.5

I have also isolated the changed/added files into a release zip

https://.com//UnrealEngine/releases/tag/Metaballs-v4.5

and am also providing a git patch, for the people using git:

Enjoy,

Wow great work :D. So now we can create great flow of liquids. Any updates on your other projects?

That looks awesome. How’s the feasibility on tying it up to physics particles so we can do collision?

Updates are coming slowly, and over time I will continue to release what I have.

Can’t really say, I dont know enough about the particle side of things, I suspect in its current form, its not possibly, its bound too much to the local space of its grid.

Awesome! I did some research a few months back but never got to an actual working implementation. This is perfect! Thanks for sharing.