Abusing UE4's Reflection system for cheap translucency

I’ve been playing with this idea to use UE4’s reflection probe system for transparency. Essentially, you should be able to sample reflections via the camera’s direction, rather than the object’s normal, to see “straight trough it”. Obviously not good enough for a big glass pane, but it could be used for some cool Visual Effects, such as a “predator” like effect.

Here’s the proof of concept I put together in Unreal Tournament, by changing the player’s normal to be the camera vector. The results are promising!

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_126537_1515339227970_542”}[/ATTACH]

Here’s a video of the effect in action:
https://twitter.com/Stabberthomas/st…13084227325952

This is the effect I’m after:

And a video:
https://twitter.com/Stabberthomas/st…35297089695744

But this is just using a static cubemap.
Over the next few days I’ll try to implement this as a proper shading model!

Let me know if you have any tips or comments in general.

1 Like

@LegendreVR Maybe! You can use a material where you bend the normal away from the camera to simulate the effect (refraction only) to test it out.

@RRe36 That’s right!

Working on a little playground scene to test stuff out in.

@stororokw Your images don’t work, can you try uploading again?

The shading model does refract and reflect at the same time, and you blend between these. (in this case via Fresnel)

This screenshot demonstrates this.
The fact that the player does not refract in it is one of the biggest flaws. Perhaps this could be enhanced using a similar approach as capsule shadows.
The “thickness” thing I do not understand, what do you mean?

You could use the normal to simulate the rays passing trough for the shadow.

Nope, thats the issue. In the shadow pass it outputs the player camera :confused:

In the first place thank you very much.

I still get the same result with ViewProperty (even that in the description says otherwise, dont know if Im doing something weong or its a bug), it doesnt seem to change in the shadow pass. The only way I can get something close is with the transform view, but that way I can only get the camera forward vector.

Hello.

If anyone is still thinking about this 5 years later and with UE5\substrate already out, I managed to - back in ue4 - obtain a reflection vector that samples the cubemap to look like transparency with this method:

Obviously right now the reflection is just flat, but with some tweaking of the normal it should be possible to fake a credible refraction. Roughness can then be used just as you would for reflections. A clear coat material could be used to also have proper reflections on top of this, I guess.