# Havchr's Sketchbook \[Last Post: Pedagogical Metaballs in VFX Graph\]

**URL:** <https://realtimevfx.com/t/havchrs-sketchbook-last-post-pedagogical-metaballs-in-vfx-graph/9871>\
**Category:** Personal Work\
**Created:** [July 19, 2019, 1:38pm UTC](https://realtimevfx.com/t/havchrs-sketchbook-last-post-pedagogical-metaballs-in-vfx-graph/9871 "2019-07-19T13:38:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![havchr](https://realtimevfx.com/user_avatar/realtimevfx.com/havchr/32/4437_2.png) [@havchr](https://realtimevfx.com/u/havchr)\
**Post date:** [July 19, 2019, 1:38pm UTC](https://realtimevfx.com/t/havchrs-sketchbook-last-post-pedagogical-metaballs-in-vfx-graph/9871/1 "2019-07-19T13:38:07Z")

</div>

![](https://media.giphy.com/media/kgJ1UnTa6VK6y1nWPC/giphy-downsized-large.gif)

Hi - here is my introduction and also my sketchbook. I’m a game developer who mostly works in Unity on bugfixing, systems and other general game programming. But I used to do some OpenGL Demoscene coding when I was young, and I like experimenting with graphics and learning new things.

My last undertaking was to get started learning the VFX Graph by trying to implement a “naive” or pedagogical way of doing metaballs.

Spawn lots of particles with the positions of particles as the volume of a bounding box. For every “metaball” - divide distance based on metaball radius, and add all metaballs contribution together and smoothstep - let this drive the particle size.

 ![16](https://realtimevfx.com/uploads/default/original/2X/3/32c803994be7b71ce9ee0cb86a6430cdea00cd3d.png)

 ![27](https://realtimevfx.com/uploads/default/original/2X/5/57a4bd1adb75a78c3f68c2536575e56fb5f3bab1.png)

I am sure this effect could be done much more efficiently, and if you have some metaball ideas, you are welcome to share - and look forward to learn new techniques.

---

<div class="post-metadata">

**Author:** ![BinaryBobby](https://realtimevfx.com/user_avatar/realtimevfx.com/binarybobby/32/10638_2.png) [@BinaryBobby](https://realtimevfx.com/u/BinaryBobby)\
**Post date:** [July 19, 2019, 2:06pm UTC](https://realtimevfx.com/t/havchrs-sketchbook-last-post-pedagogical-metaballs-in-vfx-graph/9871/2 "2019-07-19T14:06:46Z")

</div>

A fellow demoscener! 🙂

This is a really cool setup, looks awesome!

I’m not too familiar with Unity’s VFX Graph but it’s giving me some ideas. I’ve always wanted to get some old-school demoscene effects going when playing around in UE4.

---

<div class="post-metadata">

**Author:** ![mahalis](https://realtimevfx.com/user_avatar/realtimevfx.com/mahalis/32/5368_2.png) [@mahalis](https://realtimevfx.com/u/mahalis)\
**Post date:** [July 19, 2019, 6:20pm UTC](https://realtimevfx.com/t/havchrs-sketchbook-last-post-pedagogical-metaballs-in-vfx-graph/9871/3 "2019-07-19T18:20:33Z")

</div>

Oh that’s clever—so you’re using the particles to sample the function in a volume? Do you have a way to give them the right normals for lighting from the function’s gradient?

---

<div class="post-metadata">

**Author:** ![havchr](https://realtimevfx.com/user_avatar/realtimevfx.com/havchr/32/4437_2.png) [@havchr](https://realtimevfx.com/u/havchr)\
**Post date:** [July 19, 2019, 11:07pm UTC](https://realtimevfx.com/t/havchrs-sketchbook-last-post-pedagogical-metaballs-in-vfx-graph/9871/4 "2019-07-19T23:07:21Z")

</div>

Thanks mahalis - allthough I feel it must be a very slow and weird way of showing a volume, yes, I’m using the particles to sample it. If a particle is outside of the volume equation, I subtract the time to live for that particle… But There is a lot of particles that live and die just as a conveniece of this method.

Great question and great idea - It should in theory be to just take the derivative of the surface function - so something like :  
normal = 2 _r deltaVector / distance_4  
\*\* Some hours passed and …  
I tried to do it - didn’t manage to use it with the VFX lit output nodes , because I found no way to set the normal , but I did a dot product against my own light. It seems the graph now takes a really long time to compile. It is still above 60 fps but I feel like for what I am achieving visually , it is way overkill to do it the way I am doing it.  
 ![](https://media.giphy.com/media/dXdcVhloyRzS8g9LLf/giphy.gif)

---

<div class="post-metadata">

**Author:** ![ssojyeti2](https://realtimevfx.com/user_avatar/realtimevfx.com/ssojyeti2/32/28350_2.png) [@ssojyeti2](https://realtimevfx.com/u/ssojyeti2)\
**Post date:** [November 14, 2023, 4:51pm UTC](https://realtimevfx.com/t/havchrs-sketchbook-last-post-pedagogical-metaballs-in-vfx-graph/9871/5 "2023-11-14T16:51:14Z")

</div>

Hey there. Any way you’d be willing to share this project code/expanded vfx graph nodes?
