How do you make an outline of an object stay in the same location if the object were to move?

I made a post processing effect that is basically like a world scan with an adjustable radius that outlines the objects passed through it. What I want to achieve is making those object outlines stay in the same location in which it was scanned. For example, if I pushed a cube that had an outline, you would see the cube move but the outline wouldn’t. How would I go about this?

Just and idea:

  • when you move leave copy of object/mesh in original place and make its material transparent so object is invisible
  • display outline of now invisible object
  • move visible object like you do

That’s actually a good idea. I didn’t think of that.
Would there be a way to check which objects are being affected with the post process within a certain radius around the player camera?

There is some postprocess that uses some buffer to mark meshes for outline. When you set that property in mesh, postprocess can see those objects in frame buffer and you can make outline shader.

Just google for outline in unreal, plenty tutorials, also some educational project from Epic i think. Nowadays making outline for mesh/object is really easy. Ask uncle Google.

ps.
One more idea, for when you want outline to be hidden by geometry (not postprocess, but like glowing edge that can be obscured by other things).

  • make shell (modifier in 3d max) copy on mesh in 3d app (or unreal with plugin). needs to be slightly bigger (shell does that).
  • turn that shell mesh normals ie. flip all face normals so they point inside.
  • make transparent 1 sided material (additive works great) that glows and apply to flipped shell mesh, it will make kind of outline.

Thanks! I’ll try out your advice when I can.