Outlines

I want to have outlines around things, like green outlines around the edges of teamates, red around enemies etc. in the game engine, I don’t however, know how to do this, does anyone else know how to go about it?

Well, an easy “fake outline” works by:

  • Duplicating the object’s mesh
  • Scaling the duplicated mesh up a little bit, so that it’s bigger than the original
  • Flip the duplicated mesh’s normals (editmode, select all, w, flip normals).
  • Set the duplicated mesh’s color to something (like red) and make it shadeless (in materials, or just make sure “light” isn’t checked in TexFace settings).
  • Done!

You get results like in the attached image (though this one also has a shadow).

-Sam

Attachments


That would produce lag though on high-poly models, any other ways?

You can make the outline low poly.

If you use glsl, you can make a node shader, and plug the mesh normals into a ramp shader, which when set to the right settings and combined with the diffuse color, makes an outline- something like the attachment. It’s a bit hacky, and only works on smoothed meshes, but it usually gets the job done.

Attachments

outlines.blend (206 KB)

How would I make those outlines thicker?

adjust the color ramp so there’s more black.

Thanks for your help

Thanks for that guys :slight_smile:

Thanks Captain, I didn’t even think of that. You may have also presented a solution to a totally different question I had. You’re awesome.