This dev log covers the week from 12/11-12/15

I did a hackweek for a company I may be working for very soon. The reason I didn’t write in here during it was because I signed an NDA. However, after looking over some of the work I did this week, I’ve decided to detail several of the VFX graph techniques I worked on since they are independent of the company’s IP.

I created a resizable VFX graph that adapts its particle spawn rate based on particle size. Because the custom UV attribute assigns a custom value to each individual particle, I can assign a texture to the graph as well. This essentially serves as a starter template for any image or video-based graphs I want to make.

I also created a method to smoothly lerp between two graph states using an animation curve.

The value “Morph Percentage” gets set via script.

float morphTime = vfx.GetFloat("Morph Time");
timeSinceMorphStart += Time.deltaTime;
float t = Mathf.InverseLerp(0, morphTime, timeSinceMorphStart);
vfx.SetFloat("Morph Percentage", t);

One thing I could not find an elegant solution to is a way to get values from a bunch of data inputs and feed them into a switch. It would be nice if I could send an entire array to a switch node instead of having to expose each input variable, but I think this limitation arises due to the fact that VFX graph runs on the GPU. As you can see below, stuff gets pretty crazy when I have lots of data inputs.


Tags: gamedev unity vfx scripting particles animation gpu