Add outline to object When you select an object in blender a yellowish ring appears around it. And no matter how much your rotate your view or the object, the outline will only appear on the visible outline of the object. It does not appear on every edge.  

How can I get this effect on any object like an object modifier(but it doesn't have to be of course)? I also want to be able to change the width and set the material. I will be rendering this with openGL as an animation. Some objects rotate in my animation and I want them to be able maintain an outline.
You would have to render a Freestyle pass with the Line Set Silhouette selected on the left and Crease selected on the right, and change to Logical AND on the right.

This would trace a border stroke around the visible perimeter of the object, like tracing the alpha edge.

You'd have to composite this over your OpenGL render, as you can't generate Freestyle render passes when doing OpenGL renders.



In order to make it easier to composite over your OpenGL renders, it would be helpful to make the background and cube the same colour (let's pick pure white), and then make the stroke a black colour. To do this uncheck Transparent in the Film panel of the Render settings section. Make the world a solid white colour and the cube an emission shader with 100% white. Then make the stroke colour in Freestyle a 100% black.