I've been put onto MaterialPropertyBlocks as a way to avoid creating Material Instances, useful when you just need to make a small change to an existing material (thanks Daniel Snd!) - so I thought I'd put together a little demo scene using them to create a Glow on Mouse Over effect - with an included pop wobble and fade afterwards.
Now I *think* this is friendly on memory and doesn't create material instances, it certainly looks to be behaving how I expect it to, but I haven't done extensive testing and can't guarantee it's not actually doing horribad things behind the scenes, so thoroughly Caveat your Emptor if you need this for production.
There isn't that much information out there on MaterialPropertyBlocks, except for this very helpful little write-up https://thomasmountainborn.com/2016/05/25/materialpropertyblocks/
One thing that I've seen mentioned is that the properties you wish to tweak require the [PerRendererData] attribute on them to avoid Unity making material instances behind the scenes, which would be bad - but according to bgolus in this Unity thread https://forum.unity.com/threads/using-materialpropertyblocks-with-shadergraph-shaders-help-wanted.651547/ that's not the case (and never was?). Ben Golus is a *smart cookie* and if he says that's how it works I'm very much inclined to believe him.
If when you bring in the scene, the glow isn't triggering for you, check that the objects are in the correct layer that is referenced as the "Glow Objects Layer" on the Hoverglower.cs script on the camera.
Just grab the GlowOnHover_02_Unity2019.1.1f1 zip or unitypackage files below for everything included.
Let me know if you notice anything funky or stupid with it and I'll fix it right up!
P.S. This is just a test scene to try out MaterialPropertyBlocks - it is not the best or most efficient way to do this. You could absolutely do this all with just one script on the camera, and probably avoid a whole bunch of separate property blocks and even coroutines if memory was your main concern - but I like the extra flexibility of having the little GlowMePlease.cs components on the objects themselves to do things like custom glow colours per object, or having an object made up of multiple meshes or even skinned mesh renderers all glow at the same time. It's so pretty!
P.P.P.S I've also included an older version (OLD_GlowOnHover_01_Unity2019.1.1f1.unitypackage) where I just switch to a second Material on Mouse Over, which is nice and neat and works a treat, but also doesn't allow for some of the flourishes like the pop wobble and fade afterwards.
To see all the available files on my Patreon, head on over to http://pucklovesgames.com/