I'm looking to create a halo highlight around the selected objects in my game screen. The main platform is android, but I am writing an iOS version as well, updating it whenever I successfully add the next feature.
I am trying to ensure that the game is capable of working in both OpenGLES 1 and 2, but of course I expect v2 to have more effects eventually.
The effect I want to achieve is to have a halo around the edge of the selected object (I believe Diablo II did something similar). In theory my idea is to render the scene, enabling stencil ops when the selected object is rendered then enable stencil testing, disable depth and set an orthogonal projection and draw the halo colour 5 pixels larger in each of the X and Y dimensions from the object's centre with 0.2 alpha then successively draw again reducing the size and blending.
Using this method, I also need to figure out the most efficient way of determining the centre and extents of the objects.
EDIT: Another technique I just thought of after posting is, after the stencil op render, render a coloured ortho rectangle to texture through the stencil then shrink and re-enlarge the image to blur the edges then render the resultant texture back on top of the scene, around the stencilled area
- Are either of these a good/efficient way to achieve the effect? Is there a better/faster/more efficient/more common way of doing this?
- Should I bother doing it for v1 and make it a v2 only effect?
- Should I bother with v1 at all if I want these sorts of effects?