With Unity's "Standard Unlit" particles you have a "Rendering Mode" dropdown that gives you the options you can see below. Most of them are easy to guess what they do, but "Fade" and "Transparent" don't really communicate their differences.
It also doesn't help that the standard object shader also has these modes but act different; "Fade" completely fades the object away when alpha is 0, while "Transparent" keeps specular reflections when alpha is 0. That's not the case with unlit particles though (obvs)
Switching between the two doesn't answer a lot of questions either (if anything it makes things more confusing).
However, in a similar fashion to the standard object shader, the differences come from the particle behavior when you lower the alpha value.
"Fade" here also fades the entire particle when alpha is 0.
But "Transparent" does something else! It makes the particle blend additively! Basically, the blending "lerps" between additive and alpha blending based on the alpha value. That means that in order to fade a "transparent" particle you'd need to set all channels to 0 (not just A).
But it also means a bunch of other cool things:
- You can have additive and alpha blended particles in the same system
- You can dynamically change the blending mode
- You can get well-defined shapes and colors and not worry about the additive values getting blown out
"Ah, but that means that I can't use my custom shaders to get this effect, right?"
✨NO ✨
You can very easily get this going in your custom shader by changing your shader's blending mode to:
Blend One OneMinusSrcAlpha
IT'S 👏 THAT 👏 EASY 👏
No longer will you have to choose between dark colors and additive glows, you can now just ✨have it all ✨
Happy sparkle-making! ✨
(It's worth noting that all the demos and stuff shown here are working in the built-in render pipeline, you might encounter inconsistencies in URP/HDRP)
• • •
Missing some Tweet in this thread? You can try to
force a refresh
HELPERS
Before I get to the shaping functions, SDFs and other cool stuff, I thought it'd be useful to first mention some helpful general-purpose methods that can be proven useful later.
These are fairly intuitive and common; they take 2 parameters and return the minimum or the maximum of the two respectively. They're useful for masking things in/out and blending them.
In this example, the left half of the screen (which has a uv.y less than 0.5) is colored with the UV gradient, however the right half has a solid value of 0.5 (since it's smaller than uv.x).
There are plenty of ways to take advantage of those coordinates but some of the main tools for that purpose are the "mix", "step" and "smoothstep" methods. Here I'll just cover "mix".
You might've already heard of this method, though in other environments outside of glsl, it goes by the name of "lerp", meaning linear interpolation.
I don't like making long threads, cause I don't want to clutter my page with text instead of cool little experiments, but I need to vent about a subject I've touched in the past: my creative slump when it comes to gamedev.
I'm kinda writing this on the fly, so it may end up encouraging or discouraging for new devs (sorry if the latter ends up being true), but I wanted to share that stuff, if not to help others, to maybe rubberduck-debug these issues.
I was watching @Iannitram's "The toolbox fallacy" video for the umpteenth time, as it's the video that resonated with me more than any other piece of media. It makes me think of the time I started out, especially the part about being "fearless"