Glow Exclusions

I have looked through the forums and have tried to understand and experiment with the Glow shader with no luck thus far. For the record, I’m an artist that’s trying to dabble in some of the technical aspects of creating/modifying scripts and shaders.

That said, what I’m trying to do is get the Glow shader to only act on certain things. What would be nice, and I’ve seen it requested in another post, is to have the Glow only act on objects that have a particular shader assigned to them (ie. only objects with ‘Self-Illumin/Diffuse’). Or have some way to apply the Glow to specific objects rather than the camera so that only those objects with the Glow attached utilize it.

I’ve looked at turning the alpha/opacity of the Main color down to zero for objects I don’t want to glow and that works, however to carry that through our project would require days of time adjusting sliders and I’m not confident that somewhere there won’t be a conflict where that’s been used on say a transparent object to adjust/tweek it’s visibilty which would put a wrench in the whole thing. I haven’t understood any of what I’ve seen/read about the ‘ColorMask RGB’ as to how that works, what it does, or how/where I’d put it to be useful. We’re not using our own or any other custom shaders, just what’s built into Unity.

Can anyone assist with what to modify where, or is this not even possible to do? Thanks.

Transparent objects don’t add into the glow map so there will be no conflict.

You really want to go through all materials and tweak the glow factor individually, it makes a big visual difference.

The easiest way is to just open a scene, look at what looks wrong select that mesh, and tweak the attached material until it looks right. Then repeat.

Right, but in our case there are only a handful of items that need the Glow, and hundreds that won’t and by default they’ll all glow until the alpha/Opacity slider of the Main color is set to 0. I’d rather be able to selectively add and tweak it to the individual objects than tweak all objects regardless of whether they should have it.

Just write a small editor menu command that sets the color alpha value of all selected materials to some value.
Search for MenuItem and Selection.GetFiltered in the scripting docs.

Right, so we’ve been trying to assemble such a script so that we can select pretty much the whole list and then exclude things that don’t have the color property or a renderer, etc. The problem is that we’ve been looking through the docs and things aren’t performing as they’re written. I can only assume that the online docs have been updated to 2.0 and that there are things that either changed or didn’t exist in 1.6.2 (which is what we’re using). So where can we find the docs for 1.6.2? Examples are “HasProperty”, “var materials : Materials[ ]”, and “gameObject.renderer.materials.Length” which when used exactly like the examples error saying they don’t exist as part of gameObject.

The other issue is that we’re trying to set the main color alpha to 0 for all items, but it’s throwing errors when I use gameObject.renderer.material.color.a = 0 because some have _Color and some have _ReflectColor, etc. Is there some catchall that will ignore the type and just set the alpha to 0, or how can I deal with the errors?

Thanks.

If you are still using 1.6.2 then you should use the documentation that is installed next to Unity.