Unity for Games Profile picture
Aug 31, 2021 12 tweets 5 min read Read on X
In case you didn’t know, there’s a very fun way to get more bang for your buck when using particle systems and custom shaders: custom vertex streams!

Let’s take a look at what these are, and how we can use them for more advanced particle effects! 🧵

@HarryAlisavakis #unitytips
@HarryAlisavakis As you already know, rendered models in Unity are made with triangles which consist of vertices. And vertices hold all essential information regarding these models, like their individual position, their UV coordinates or their vertex color!
The cool thing is that we can add any sort of arbitrary data to our vertices and use it in our custom shader however we like ✨ That’s what custom vertex streams in particle systems allow us to do: pass particle-related information to our vertices that we can use as we please!
The option to add custom vertex streams can be found under the Renderer module of your particle system. Enabling it will show you all the vertex streams that are already being used, like the UV coordinates and the vertex color!
Let’s now make a simple dissolve shader for us to use with our particle system, using shader graph! This is a simple unlit, double-sided #URP shader, with alpha clipping. The interesting thing here is to notice what drives the dissolve effect: the third component of our UVs. Image
🤷‍♂️ “But why?” I hear you asking. You might be used to using UV coordinates for texture sampling, where you only really use the x and y components. Well, let’s get back to the particle system and its custom vertex streams and add a new one, hopefully that will clear things out:
Next to each stream’s name, you’ll see where that data is stored. Here, the new stream is stored in “TEXCOORD0.z”, which corresponds to the third component of the first texture coordinate channel (aka UV0.z).
Here, I added the lifetime age percentage, so this value will start from 0 and go towards 1 during the particle's lifetime. With our shader, that will make our particles dissolve over their lifetime!

Applying the shader to the particle system can give us this neat result:
So that’s cool, but what if we wanted more control over lifetime?

Age percentage is good but it’s quite linear and not very helpful if we wanted to do more complex effects. The answer is this little module here, called “Custom Data”: Image
We can use “Custom1.x” instead of age percentage, which in turn allows us to use a curve that alters the value over the particle’s lifetime, similarly to built-in curves like “Size over Lifetime”.
So now we can get a lot more control over how our particles dissolve over time ✨

How cool is that?
There’s plenty of data you can pass over to custom vertex streams and there’s just so much stuff for which you can use them inside your custom shaders!

Can you think of any other creative uses for custom vertex streams? Let us know in the replies!

Happy VFXing! ✨

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Unity for Games

Unity for Games Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @unitygames

May 30, 2023
#UnityTips 5:

Game development can be difficult, but there are ways to increase your learning process 10x. Here are some things you can do to maximize your learning potential 🧵

@samyam_youtube Image
Did you know Unity has their own learning platform 🤯? And a great one at that!

You can access hundreds of lessons and explore different pathways for learning specialized content at learn.unity.com/pathways (1/7) Image
Tutorials are always great, but be careful not to get stuck on them! (2/7)
Read 9 tweets
May 30, 2023
#UnityTips 4:

Did you know these simple Unity tricks to increase productivity 100x? 🧵

@samyam_youtube Image
⌛ You can speed up in the scene view camera! That way you can adjust the speed and avoid missing the objects you are trying to zoom into. You can also Right Click and scroll the scroll wheel on the mouse to change the speed more easily! (1/7)
You can press “F” when you select an object in the Scene View to focus on it. You can press Shift+F to focus and zoom in to the object! (2/7)
Read 8 tweets
May 30, 2023
#UnityTips 3:

Unity’s Newer Input System offers a ton of benefits over the old one, here are some cool reasons why you should be using the newer one 🧵

@samyam_youtube Image
The new system is built on Scriptable Objects. This means it is designed for modularity and ease of use.

You start by creating an Input Action Asset (1/11)
From there you can add Actions (like Moving, Jumping) and their Bindings, or the controls that trigger them.

It supports multiple bindings per action. (2/11)
Read 12 tweets
May 30, 2023
#UnityTips 1:

🎨 Pixel Art can look weird in Unity if you don’t import it correctly. Here are some settings you can change to make your pixel art look better 🧵

@samyam_youtube Image
When importing pixel art, make sure to pay attention to the resolution of your art.

Ideally, the size should be base 2, for example, 16x16,32x32,64x64,128x128, however, it is not necessary. Make sure it is a PNG with a transparent background. Tiles by @KenneyNL. (1/8) Image
In the import settings, select Sprite and then set the PPU (Pixels Per Unit) to the size of your pixel resolution. For example for a 64x64 image, you will put in 64. This is important for the pixels to be scaled correctly. (2/8) Image
Read 9 tweets
Nov 23, 2022
We hope you enjoyed all of @minionsart's #UnityTips and shader magic yesterday 🤗

Thank you again for a great takeover ♥ Make sure to give Joyce's website a visit, we've also compiled all the tips below so you can find them in one place 😊
Read 5 tweets
Apr 19, 2022
I wanted to finish this Takeover with something I get asked a lot: how do I set up my characters in Unity? So here is how to create, rig and animate simple characters all in Unity! I threw together a cute robot for this occasion 🤖

#UnityTips @AlexStrook
It’s easy to create simple characters with basic primitives. Probuilder is useful too! For this character I used 4 models that I duplicated, scaled, rotated around to create this cute robot. It helps to think about animation at this step!
Once the model is done, I create empty gameobjects, and place them where the joints would rotate. These are the objects that will get animated, it’s important to name them correctly for animation! Using front/side views helps with precise placement.
Read 6 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(