Happy #unitytips Tuesday! Thought I'd share a 🧵 on something that should be super helpful for VFX artists!

It's about that "BlendAdd" blending mode, discussed at the famous Diablo VFX talk ✨

Let's go~



#gamedev #unity3d
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
 

Keep Current with Harry 💬

Harry 💬 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 @HarryAlisavakis

4 Mar 20
SHADER BASICS PART 5

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.



#glsl #shaderbasics #shaders
MIN/MAX

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).
Read 12 tweets
19 Feb 20
SHADER BASICS PART 3

MIX (aka LERP)

In the previous thread, we mentioned how to take into account the pixels' coordinates to not just paint the screen with a solid color.



#shaderbasics #shaders
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.
Read 9 tweets
12 Dec 19
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"
Read 17 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

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

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(