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!
@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?
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.
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.
This is exactly what I was looking for, thanks! I put it to great use in 4.27 since I was having sorting issues with multiple transparent meshes, and the performance gains are important.
The technique can, of course, be combined with masked materials or even masked with temporal dithering, though I’d say only in rather specific use cases. It should work very well on splashing water streams/droplets and other such particles, for example, and it definitely works for my stylized water splashes. No transparency sorting issues, more detail can be packed, and it plays very nicely with mobile and such use cases.
I tested this in 5.5 out of curiousity.
With reflection probes and SSR disabled, it appears to work identically to 4.x.
With hardware raytracing, it works hilariously well. Of course, there’s probably no use case for this over just using regular or ray-traced transparency, but the option is there lol. It breaks at a sharp angle, and I didn’t tune the ray tracing distance properly.
I just managed to test it on Lumen (software) as well. I disabled screen traces, and had to disable “Affect Distance Field Lighting” on the mesh, otherwise its SDF will show up in the Lumen scene representation. It’s another weird edge case, but maybe someone manages to configure Lumen to perform well enough that tricks like this are beneficial.