Make Instanced Static Meshes Face Camera

I’m trying to use instanced static meshes like billboards to reduce my draw calls. I want to:

  • Have the instanced static meshes facing the camera at all times
  • Avoid doing the rotation on the CPU

The first thing I tried was using the AlignMeshToTheCamera node in my material. This works great on my billboards but it seems that instanced static meshes are setup using local space offsets from their origin. It’s not clear to me how I get their world space location in the shader to offset this.

If you use the Math Hall Example 2.21 and in the shader swap out Actor Position with ObjectPivotPoint, it works as desired.