Fake Glass Material
Method #
Transparent materials such as glass or liquid are quite tricky to reproduce correctly in a real time engine. It is often necessary to cheat to get as close as possible to a pure and slow ray traced rendering. Example project.
Setting up the material #
- Change the Blending Mode: In material panel set “Alpha Blended” in Alpha mode. You can choose “linear” and reduce the Alpha.
- Add an environment map and enable environment mapping in material.
- Change the backface cull mode and set to “Double sided” and also add a little bit of rim lighting.
The choice of the environment map is quite important. The map will not reflect the real environment of the scene, you should not hesitate to test a lot of them.
Transparent materials and shadows #
Transparent objects will not cast shadows, no matter how blending is done, so you will have to cheat a little.
To avoid this constraint, simply duplicate the transparent object and apply an opaque material on it. And in the options of this material activate “Render Shadows Only”.
The shadow will be cast by this object which is no longer visible.
In reality, a transparent object will not project shadows like an opaque object, but with real-time rendering, it is necessary to make some concessions.