Make the whole mesh transparent, not just individual materials

I need to fade out my character if it gets too close to the camera. I tried doing it with the “masked material + opacity parameter + dithering” approach, but it has a significant drawback - my character has the inside of his mouth fully modeled, and it is now visible from outside. I need to have it look more like the stealth effect from World of Warcraft. Is this achievable in Unreal Engine?

stealth

The World Of Warcraft characters are typically one mesh, which means they don’t have to worry about your problem. I would simply disable the teeth on the character when you go invisible. Alternatively you will have to implement the effect somewhat differently.

There is an interesting hack that you could try to use, but I am not sure how well it would perform. You can use a post process effect with Custom Stencil to target the teeth and run a depth check to see if they are occluded by other assets. Based on that result you can decide how they will be rendered. This is however quite overkill unless you really, really need the teeth to be visible in stealth.

I would either disable the teeth or implement the effect differently. You could try a Fresnel effect which typically gives a cool outline that could be thought of as a stealthy feeling.

Best luck Sengami :slight_smile:

Thanks for ideas, but I don’t think any of them can help me:

  1. Turning some materials “off” is out of the question, because although I didn’t show it on my screenshot, I have a similar problems with eyes being visible underneath the eyelids - and I can’t just turn off my character’s eyes :grimacing:

  2. Fresnel also won’t help as I don’t really care for a “stealthy feeling”, my issue is that the camera can get completely blocked by, or get inside my characters mesh.

  3. I don’t know much about the depth stencil, but in the scenario where my camera has already clipped inside my character mesh there wouldn’t be any occluders between it and the inside of the mouth, so I guess that’s not going to help much :frowning_face:

The spring arm of my camera has to start inside of the character’s collision, otherwise it would be possible to look inside walls if player got close enough. But now I’m stuck with the issue of this topic. It’s like picking between two equally bad behaviors.

For now I’m using a workaround with two spring arms attached to my camera:

  1. Short vertical camera boom, which is never rotated (purple)
  2. Main camera boom, which is the pretty typical (orange)

This bypasses the issue when a character is standing next to a wall, as the camera is above the mesh and doesn’t clip. But there are still issues in tight spots.