How to make a realistic glass material on mobile since that the refraction does not support on mobile?

Hi -

You can fake the refraction using a cubemap and a reflection vector plugged into emissive. Here is the material setup and an example from the editor, comparing against the including M_Glass Material from Starter Content. I used the DaylightAmbientCubeMap from the Engine Content as the cubemap in the material.

This is one way of doing it and I am sure that there are more.

Good Luck -

Eric Ketchum

I’m sorry, quite the newb with materials. How do I get the first three nodes? Is there a resource for accessing those values?

As of 4.10 refraction is supported on mobile. It may not work on all devices depending on the specs, though.

You can see more in the release notes here: What's New | Unreal Engine 5.1 Documentation

As for the nodes:

  • Reflection Vector: Search for ReflectionVectorWS
  • Local to World: Search for Transform and then with the node selected you’ll want to change the settings under the details panel. Source will be “Local Space” and Destination will be “World Space”
  • Cubemap/paramcube: Search for TextureSampleParameterCube. Give your parameter a name that you’ll want.Then in the details panel assign the texture for your cube map.

Thanks for the quick reply, I figured out all the nodes last night after some trial and error and the help of the discord server. Where a few of us kept running in to issues, is we can’t seem to replicate the same pins in the above image with any blend mode/lighting modes, have those changed? I could find a blend mode with every pin needed except Specular. There aren’t a lot of resources anywhere on the net that I can find that are good examples of mobile transparency.

But thank you for the link! I’ll try plugging in what I have working at home with that setting and see if it can resurrect my material.

Yes there have been some significant changes in the last two years, that is for sure! :slight_smile:

Set the material to have a blend mode for Translucent and the Lighting Mode you’ll want is “Surface Translucency Volume” to have all the inputs you need above to recreate this.

Now that Refraction is supported you’ll save a bit in the instruction counts for the material. Not a massive amount, but some.

Awesome, can’t wait to try it out!