I'm writing a game that has turn based party combat (similar to XCOM/Fallout 1&2, etc) and I would like to have a nice effect for indicating which unit is currently selected. I tried a 3d arrow above the object, its not really doing it for me so I'd like to have a "halo" or glow effect surround the model when its selected.
It looks like the right way to go is to manipulate the renderer off the object and set its alpha/texture mods? Is there a simple way to get this effect or will I need to use a second texture file here?
I'd prefer to do this programmatically if possible.
I'm going to reiterate and elaborate on the main points made in this similar answer. There are many ways to "highlight" an object, depending on the effect you want. Here are a handful of suggestions:
You could make use of the Glow effect (pro only). Glow only acts on objects whose renderer outputs an alpha value larger than zero to the colour buffer. This means, if you turn down the alpha value of every other object's mmaterial tint colour]2 to zero, and only turn up the alpha value of that particular object's material tint colour, only that object will Glow.
Without using the pro Glow effect, you could Adjust just the RGB values of the selected object's material tint colour. This allows you to tint the object any colour you like. Alternatively you could have all object's tint RGB set to 0.5,0.5,0.5 and then set the highlighted object material tint to 1,1,1 making it seem much brighter in comparison with the other objects.
You could creating a larger mesh which covers your object (perhaps procedurally positioned between the object and your camera), and give that a material with an additive shader, with a dull grey circle texture which fades to black at the edges. (Essentially a single large static 'particle'). The additive blending will make the object seem to glow.
You could create a mesh which has a transparent 'ring' texture, and place this on the ground at the same position as your selected object, giving a selection indicator which appears to be under your player at its base.
You could even use an animated particle effect at the same position as the object to give it a twinkling sparkly glowing effect.
I'm working on a similar project. In fact I'm currently designing the selection manager, but finding some difficulty choosing which method to go forward with. I've read some code people have written that uses raycasting, and the more simpler technique of mousedown functions on the objects themselves.
Might I ask which you found worked best for you? Old post, I know, but I'm hoping you might still be around.