Translucent surface not refracting off-screen pixels

Hey, I’m trying to make a glass material, but I’ve run into a problem. A mesh with a two-sided translucent material acts as a lens. Depending on the shape and viewing angle, it may need information about pixels that are currently off-screen. Unfortunately, it appears that it does not get that information, so it only refracts on-screen information; parts of the object that should be refracting offscreen pixels just fall back to nonrefractive translucency.

33291-globe1.png

Is there a solution or a workaround?

Hello evnhali,

Thank you for your post,

Unfortunately it would seem that this is a limitation of the method being used. It may be possible to use a Scene Capture Cube to create a reflections that are independant of screen space. I am posting a link to a page that has some information about this feature:

Keep in mind that this is at the cost of a pretty big performance hit. We are working hard on some better solutions for dynamic reflections, but they are not ready at this time. I will also include a link to the Unreal Engine Roadmap, which shows the features which are most likely to be worked on next.

Hopefully you will be able to find a solution that works for you until we have a better dynamic reflection solution. If not just post a comment and I will be happy to try and find a better solution

Thanks,

Thanks for the reply! I understand the limitations of screen space reflection, but I guess I assumed that refraction would be calculated earlier in the pipeline. The current refraction implementation is unusable even for a simple use case like windows

and while refraction isn’t strictly necessary for a clear window, it is necessary for a frosted or textured glass effect:

How bad is the performance impact of Scene Capture 2D?

Hello evnhali,

I wish that I had a definitive answer for you on the question of “How bad is the performance impact of Scene Capture 2D?” The short answer is that it depends on what you intend on using it for. If you are going to be making a large scene with a lot of static meshes, particle effects and post process material, the cost of using scene capture 2D will probably be too high to consider an option, however in a clean, simple project it may be a feasible solution. The best way to test is to set it up in your scene, play in editor and decide if you are comfortable with the tradeoff.

Thanks,

would it be possible to render some of the important passes in a wider FOV, which can be used for Screen Space Reflection and refraction, before narrowing down the FOV and render whats remaining?

This would be possible but you would have to create you own Custom Shader Pass in order to do so, and usually through code.