Hey guys, I’m looking for some input on how I can create an effect that I’ve seen commonly used in other games. I’m not sure exactly what you might call it, but the idea is that a transparent material is highlighted around a sphere’s edges, similar to a fresnel effect, but then is also highlighted along the intersection with other meshes in the game world. For example, in the Destiny screenshots above, you can see the spherical shields mold themselves to the shape of the ground and walls around them. If a player walks through the shield, it conforms to the skeletal mesh as it intersects with the sphere.
Ahh, Ryan, you’re my hero! After just a little trial and error, I’ve got something that works very well. I’m always amazed how UE4 has great built in solutions for all my problems. Thank you so much!
No problem. One minor suggestion is that you can also use a second depthfade with a different fade distance but with inverted output (ie, just use another lerp but flip the 0 and 1), and multiply that by the first one, and then you will have a controllable gradient for the outer edge softness as well.
To get texture variation like the screenshot, you could use another lerp to vary the “FadeDistance” amount. the texture could use the UVs of the sphere or possibly worldcoord.XY or something depending on the look you want.
Hi Ryan, coming back to this after a few days and I’m not quite sure how I would use the UV’s of the sphere or the worldcoord.XY. Can you elaborate on these a bit?
Worldcoords-XY is just way to tile a texture using worldcoords from top down. It would cause the noise pattern to stay constant in the world so if the sphere moves, you’d see different parts of the texture:
Could just as easily use default UVs for the noise texture (by just not connecting anything or using a texturecoordinate node with any tiling). I was just giving options.
Using second depthfade with sharper gradient for the outer edge: