4.7.2
Hi everyone,
I’m on Godot 4.7.2 (Forward+) and trying to make a simple glass cube.
What I did: MeshInstance3D > BoxMesh > new StandardMaterial3D with Transparency = Alpha, low alpha on albedo.
Problem: It looks like tinted plastic, not glass. No real refraction, and when I look through it the background doesn’t distort, and the inside faces disappear.
What I’m aiming for: A clear glass cube like you’d have in a product render - transparent, a bit reflective, with refraction.
Does anyone have a good setup for StandardMaterial3D or a simple ShaderMaterial for this in 4.x? Do I need to enable anything in WorldEnvironment?
Thanks!
You can get decent looking glass using the standard material. Be aware though that with realtime rendering, the results can’t be as good as with full featured pathtracing.
-
The most essential thing for glass is setting up a good looking environment to reflect/refract. So start by finding (or making) a hdr equirectangular environment map and set it up as a panorama sky in a world environment node.
-
Using a cube mesh with slightly beveled edges will look much better than a simple hard edged cube. Rounded and more complex geometry always looks better for glass. Refraction/reflections on plain cubes are kinda bland.
-
Material properties:
– transparency: alpha
– albedo: black (or some dark color) with medium alpha
– metallic: high
– specular: maximum
– roughness: low
– clearcoat (enable optionally: high value, low roughness)
– anisotropy (enable optionally)
– refraction: enable, low positive scale, add a low frequency noise texture to distort the refractions
Holy smokes this looks incredible. Thanks a lot for sharing the properties.