Glow effects per scene prop

I’m trying to figure out how to do glow effects.
Is this something that can be done per prop like shown in the pictures below? I’m pretty sure the way to go is post effects when looking at stuff online but I only want it on specific props in the scene so I’m not certain.

And another quick question: Can that sort of thing Unity Asset Store - The Best Assets for Game Making (highlight selection) or fresnel effect be done on 2d sprites?

3199978--244606--explorer_2017-08-29_00-26-42.png 3199978--244607--oriDE_2017-08-29_00-42-05.png

It’s either 1) a separate camera renders a specific layer (where an additive glow billboard situates) with higher depth than the main camera so this other camera renders everything before the main camera like a UI camera, or 2) HDR bloom by adding the usual bloom, make sure the main camera has HDR checked then increase the emission value of the material requiring selective bloom. Emission property is available in the Standard Shader. If you know how to write your own shader, you just add a float(1) property to the resultant RGB like this: col.rgb += _Glow;

Option 1 is cheaper but looks fake, usually for mobile or to some extent, VR. For desktop, HDR bloom is always the answer.

2 Likes

Alright I’ll pick option 2 then! It works, thank you :slight_smile:

I guess that means if I want my object to glow it necessarily will change its original color.
Adding that float to rgb makes the alpha parts of my sprites come out more, I added an alpha cutout to try and fix that.
3200076--244619--upload_2017-8-29_4-2-18.png

3200076--244621--Unity_2017-08-29_04-04-15.png

Your Glow property can be added to the vertex color.rgb instead which is arguably faster if you’re making vertex-fragment shader. For surface shader, it probably makes no difference. @bgolus , right?

1 Like

If you’re using vertex color already, sure. It can be marginally faster. If you’re not using vertex color then it’ll be probably be slower for a single object. Using vertex colors does mean batching works. The sprite color value is passed via the vertex color, so you could have a multiplier on that. The question of surface shaders or not isn’t really relevant.

No purely post process based bloom will ever get you anything as clean as what is in that first image. Going by the first image you posted (from Ori maybe?), those are just additive sprites manually placed on top. Likely just the same blurry gaussian blob. HDR bloom works like bloom in real-life, which is to say things have to be really bright to do anything. You could lower the threshold the bloom effect treats as being “bright”, or boost the brightness of the bloom effect, but it doesn’t get around the fact it’s impossible to get those relatively dim flowers glowing with out making everything else in the scene glow too using this technique.

An old way of doing bloom was to carefully control the alpha value output by the shaders, marking what areas should be considered “bright” regardless of their actual color. But this doesn’t work when you’re already using alpha to control the blending.

The next best alternative is to render the scene using replacement shaders, using a custom shader on objects that you want to glow and rendering everything else in the scene black. I believe there are some assets on the store that do this. Certainly all of the “highlight glow” style assets work this way, but the end look they’re intended for is more of an outline than a hazy glow.

But really, just use an additive sprite on top. Make custom sprites for the cases the blob isn’t good enough.

2 Likes

The first time I looked at it I was certain it was a shader with glow because the flower and the glow moved exactly in a similar fashion as Ori passed next to the flower. But looking back at it, I think you may be right, it just might be simply an additive sprite on top. The additive sprites aren’t even placed in the same spot on the flowers which suggest they didn’t even use prefabs for this which I find weird but also supports your idea even more.
They must’ve used:

  • 1 script for to change the additive sprite’s transform position depending on Ori’s moves.
  • And another a script to affect the shader parameters for the flower that is being animated with vertex offset.

Thanks a lot for the informations!
Using a whole screen glow would’ve made it really hard to tweak the individual glows as I wanted them.
Here’s a video showing the flowers in action if you’re curious:
https://www.youtube.com/watch?v=rjFMrTVgOqk

Since you seem like a shader expert, could you give me some tips on the direction I should take take to try and replicate the vertex offset shader to move the vegetation like in Ori?
From what I can understand looking at the game’s vegetation, they’re using distortion to produce weird scaling effects on some mushrooms, normal scaling and sin motions starting from specific pivot points.
I just started doing shaders so I’m trying to start simple and build the shader up. For now it’s looking too simple :wink: the motion is like a simple rotation from the ground as pivot. There isn’t any sin like motion:
(My shader)
https://www.youtube.com/watch?v=ii0CZj7IzWM

Here’s the kind of motion I’m trying to achieve for now :
(Sin motion)
https://www.youtube.com/watch?v=U2DNJSWURgM

Here’s some Ori references:
(Mushrooms)
https://www.youtube.com/watch?v=kMp45z_TM1A

(Grass)
https://www.youtube.com/watch?v=Dtxs0CkvdrE

If you’re doing vertex distortion on the vertices of a quad you’re only ever going to get a skewed quad. The example shader you linked the video to is doing distortion in the fragment shader, not to the vertices, which gives you per-pixel distortion. Ori appears to be doing it per-vertex, but with tessellated sprite geometry. See SpriteSharp or Unity’s own sprite mesh tools.

1 Like