How to make glass material using refraction

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By johnygames

I am trying to create a photorealistic glass material in godot 3.1, but I can’t seem to find proper tutorials. I have read the docs and more specifically this part. So far I have created a new material for the sphere that I am testing this on, I have enabled transparency and I have tweaked the metallic and roughness settings. I also have rim and refraction settings checked. The test spheres are berely transparent in game and they look nothing like the photorealistic image in the docs. They do not seem to refract light in any way. What is the problem?

:bust_in_silhouette: Reply From: MallNinjaMax

Are you using any maps in the texture slots for the params?

I wouldn’t call this “photorealistic”, but this is something I threw together just using a generic cloud noise texture from Gimp in various texture map slots on the material.

You’ll want to use things like normal maps to offset the refraction as well as an albedo with an alpha (or detail maps) to add things like dirt. Experiment with all the maps on enabled params. You’ll also want to use things like reflection probes and anistropy, too. The 3D Materials demo is a good place to start.

Some of these features are fairly new to Godot, so there’s not a ton of specific tutorials around yet. I’d suggest trying glass material tutorials for other engines, and trying to apply some of their concepts to Godot.

I included a normal map, but I still dont get the desired effect. If anything, it should at least appear to be refracting light, which right now it doesn’t.

johnygames | 2019-07-17 10:37