Near-Camera Fade

So seeing this thread get bumped up reminded me to ask this question: in games like the recently released “Deadpool”, if the character comes close to the camera, he does not get clipped but rather softly “fades” to transparency, starting with the points on the mesh closest to the camera.

Is there any way to achieve this desired effect in UE4 via some config setting? Or, if barring that, is there some alternative workaround via the material editor for making something like this possible? If not, I’d like to add it as a request.

It’s possible to implement the fade in the material by using a translucent material an computing the opacity depending on the pixel to camera distance. This means each material would have to have this built into, also translucent materials don’t do proper z sorting and render slower. In order to have this only used for th few objects that click with the camera the engine needs to compile each material in translucent and in opaqe/masked and switch to the one needed. That feature is not in engine and it would be quite some coding effort. Once you have that all kind of new problems can appear: no z for that object means no correct shadow receiving/fog/DOF. Shading differences can result in popping artifacts. A lot of that can be solved with game restrictions, some can be solved with double rendering. For most projects that is too much trouble.

seems rather easy in the material editor. use the PixelDepth node and if it’s < SomeValue then lower the alpha as desired

this would work in UDK, and I really doubt the PixelDepth node has been removed

That solution /might/ work IF the material is translucent. The thing about UDK is that you can’t use translucency without getting all kinds of z-depth ugliness. And this persists even through the alpha composite blend mode. Of course, that depth sorting issue seems to have been somewhat resolved in rocket now, at least as far as static meshes are concerned.

I’ll test this in rocket, and report back with a definitive answer pertaining to how characters handle translucency now. The only place where this might still be an issue is if I want to put some subsurface scattering on the skin of a character, and I have to choose between translucent and subsurface scattering blend modes.

Thanks Oscar. :slight_smile:

well you can’t really expect a character to fade its transparency if it doesn’t have a translucent material in the first place, can you? :slight_smile:

ideally, I’d say this post should be rephrased to request SSS to be usable with other blend modes

Looks like the problem of z-depth sorting for characters still persists into UE4. I’ll file this as a separate bug report.

Attached are what the character looks like when the blend mode is set to translucent. Based on this, doing the camera-dependent fade seems nigh impossible at this point.

Although it does beg the question of how they managed to pull that off in Deadpool. Especially because that game was built on UE3 technology.