Create advanced visual effects in VFX Graph: A portal effect | Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
let's explore how to build this portal effect inspired by some of our favorite movie Wizardry using unity's VFX graph the VFX graph is an amazing tool for creating real-time visual effects within Unity we can use its intuitive workflow to manage large complex simulations leveraging the power of the GPU we now have millions of particles at our disposal to generate this portal effect we'll use the VFX graph to transform a simple ring of particles into something more organic and dynamic one by one will incorporate noise physics and Randomness in order to show the general workflow of creating a simulation this demo uses the portal assets from the free visual effect graph samples follow the link in the description to download the project for yourself We Begin the graph with a basic shape in this case a Taurus forms the ring that emits our sparks then we connect that into a simple particle system anticipating our portal placement we pre-configure a timeline director and some animators to match our intended blocking the spinning circle of Point lights provides interactive lighting to help integrate our effect into the scene our goal is to shoot Sparks from the tangents along the Taurus ring we can calculate those using some Vector math in this specific example we'll take the difference of the Taurus position and the position of a given particle that difference is a vector that looks like this we'll take the cross product of the local positive Z Direction with that vector and the result is our desired tangent we normalize this multiply it by a good starting speed value and then use that to set the velocity though it's not part of the rendered effect in output particle line can generate a rough preview of each particle's initial Direction we can use temporary nodes like this whenever setting up or troubleshooting a graph this can approximate our intended color and brightness or we can use a distinctive magenta color to remind ourselves not to leave the debug notes connected once we're done debugging we need more particles lots and lots of particles in the output we swap to a better texture to make the particles more closely resemble Sparks each one needs to be long and thin so we Orient the particles along their velocities and scale them to a small value across the x-axis we also want to stretch the particles based on how fast they're traveling so they look like streaks a color over life block can start each particle with a bright High dynamic range color and then we can have it fade and burn out over time a multiply Alpha block controls the overall opacity and an anti-aliasing block Smooths the result and that forms the foundation of our simulation turning up the capacity and the spawn rate fills out our particles and then creates the effect of a glowing spinning Halo what we have however is a little too perfect and mechanical some Physics can fix that in the update particle context a turbulence block can create the appearance of air movement we can adjust the parameters to make it more intense or reduce them to make it more subtle and then we want to feed in a value that's always increasing like the total time this prevents the turbulence from looking too static and keeps the airflow constantly in motion other physics blocks can add gravity Mass or drag to simulate error resistance if their influence is too difficult to visualize we can temporarily dial up the lifetime and increase the number of particles and now it resembles glowing gas much more active and natural but the particles don't interact with the environment in fact they go straight through the surrounding geometry we can add a collide with plain block to represent the ground and then adjust the roughness to make the Sparks bounce off like beads of water a collide with sphere can also prevent too many Sparks from entering the portal area of the Ring however we do need to shift it and size it to keep it centered or else it can make for some unwanted interactions we can sync some values from the Taurus and then the Collision sphere will stay locked even when moving the game object reducing the lifetime returns us to this Halo of Sparks however even with the addition of forces each spark suffers from repetition and that's often a visual cue that tells us that something is too artificial or computer generated Randomness can add just the right amount of entropy to make it feel a little bit more natural and this can be as simple as setting a range of values within a block or generating random numbers as input we can add subtle variations like this throughout the graph here we add randomized Alpha values with a curve that makes some particles more opaque than others or we could add random Z rotations to the tangent angle so everything isn't spread out so uniformly or we can vary the lifetime and here we separate particles into two distinct categories shorter lived Sparks that form the bright core of the ring and a few longer living Embers combined our particles appear more chaotic and organic with all of these little incremental variations to make the Sparks pulse on intervals we can use a little bit of math to create a circular gradient these nodes create the gradient and then we can apply that to the particles brightness and velocity then if we rotate the gradient the effect almost looks like it's sputtering more subtle than that we can add some variation based on the world y value we use a simple two node setup that works as a height mask this approximates the Sparks slowing down as they burnout and turn into gas for example the height mask can affect particle lifetimes or it can modify the turbulence intensity we can also apply height variations to disable gravity as particles get closer to the ground and that extra bit of slowdown helps sell the effect to the viewer and one final bonus to accentuate the portal we can inject a little juice in the form of a Shader graph this one distorts the screen space UVs and creates a noisy refractive Ripple just inside the portal ring with VFX graphs improved integration with Shader graph we can now tweak related parameters all in one place in the inspector and there you have it a portal perfect for a Sci-Fi physics Puzzler or a magic trick straight from the sorcerer's Spellbook remember that this multi-layered approach is key to crafting details in your own particle simulations and effects we invite you to explore the project samples yourself and be sure to follow the link in the description for the complete ebook guide to getting started with the VFX graph these resources are full of tips and techniques to take your technical artwork to the next level thanks for watching
Info
Channel: Unity
Views: 47,726
Rating: undefined out of 5
Keywords:
Id: QpLvBIFyhuE
Channel Id: undefined
Length: 8min 46sec (526 seconds)
Published: Thu Dec 08 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.