How to hide niagara particles located on occluded mesh surfaces

Hello!

I’m working up a hologram-like particle effect that attaches particles to locations on a mesh that itself is hidden –

– I’d like to improve the readability of the form by mimicking “backface culling,” and masking out any particle whose location corresponds with a triangle on the reference mesh that (were it being rendered on screen) would not be visible to the camera. I can’t seem to figure this out – is it even possible?

A few other notes/parameters –

  1. This effect is ultimately intended for a PC game project, so the technique would need to be reasonably performant.
  2. I’m currently working this up on a skeletal mesh, which is my ideal workflow, but if the only workable technique for this demands I reference a static mesh (e.g., if mesh distance fields can be leveraged in some way), I can work with that. The end result will be applied to still poses of characters, not to real-time animation.

Interested to hear your thoughts! Been racking my brain on this one for days.

Get the normal of the triangle that your particle is placed on, then compare that to the camera vector to filter out particles that are attached to triangles pointing away from the camera.

Or render the mesh to a render target with custom depth and compare your particle position to that to see if it is occluded.

Thanks, I’ll give the render target solution a shot.

I already have the camera vector/mesh normal comparison implemented, but it only hides the particles associated with triangles facing away from the camera, which are inevitably not all of the triangles occluded from the camera’s view. i.e. if the torso of a character is occluding the hand, the faces on the hand that are technically facing away from the camera will deactivate, but not the faces on the side of the hand that are technically facing the camera (even though on the mesh they would be hidden by the character’s body).

Will report back for posterity after I give it a whirl – or ask more questions, I don’t have a ton of experience with render targets! :slight_smile: