Full character translucency / Stealth effect

Hey,

I’m working on a stealth mechanic in a top-down multiplayer game and I’m wondering how I should to tackle full character translucency. Basically when I hit the stealth button I need the instigators character to appear ~30% opaque to all players who are friendly and gradually fade out and become completely invisible to enemies. Similar to how stealth works in World of Warcraft/Blizzard style games.


As far as I’m aware here are my options and issues I’ve encountered with each of them:

  1. Character shaders are Translucent - The obvious choice at first glance, but I’m experiencing render order issues when the character is fully opaque. (No, my normals are not flipped)
    Translucent, 30% opacity


    This is also the most expensive way to do it If I’m not mistaken.

  2. Character shaders are Masked and achieve transparancy through dithering - A cheap way of doing it, but since my character is so far away from the camera the screendoor effect becomes very noticable (not so much on still pictures). Which can be cool in some cases, but not really what I’m going for this time. (Unless there is some way to increase the density?)


  3. Custom depth and post processing materials
    This way is relatively cheap and somewhat achieves the look I’m going for, but its not actually transparent and there is sometimes an outline to the character. And to achieve this effect for each character in the game seperately, they would need to have their own post processing layer specifically for them? Seems a bit cumbersome


What are peoples experiences with this? Am I missing something? How would you achieve the effect in the example pictures? Appreciate any input!

I ended up going for Translucent materials using custom depth to sort the render order as shown in this helpful guide Custom Depth in Unreal Engine - Tom Looman

Because translucent materials are so heavy I ended up making 2 sets of materials, one that has blend mode set to Masked for general use and one that is Translucent. I switch them in realtime when its time to fade out the character. This way I get the best of both worlds. Crisp translucent materials for my characters when they are needed and low performance cost masked materials the rest the time.

Hope this helps someone, it was surprisingly difficult to find good info on a simple thing like fading an object out. (Without dithering)

3 Likes