How to make TRANSPARENT MATERIAL in Unity

Introduction

In this article we see how to create a transparent material in Unity that allows you to see what is behind, a material that can be applied to windows and other transparent objects such as glasses or bottles. We also see how to use an image with alpha to apply transparency according to the information in that texture.

All the IMPORTANT information is summarized in the following TUTORIAL FROM MY YOUTUBE CHANNEL




Unity package with textures

Below you can download a Unity package with all the Assets I use in an old video about this topic.

Elements to be used

To show how to make transparent objects in Unity, I will use a cube and a sphere that will have a material applied to each one. In figure 1 we see the objects in the hierarchy and in figure 2 the materials that I have created for both objects.

Fig. 1: The objects we are going to use as an example
Fig. 2: The materials that are applied to the objects in the figure above.

I will place the sphere in front of the cube, this will allow to know if the material of the sphere is transparent.

Fig. 3: I place the sphere in front of the cube to show the transparency.



Steps to create a transparent material in Unity

1. We select the material we want to make transparent to visualize its parameters in the inspector. The material I am using is the Standard Shader that can be created in Unity, in figure 4 we see its parameters in the inspector.

Fig. 4: The inspector of the blue material in the figure above, a standard material.

2. We changed the rendering mode from opaque to transparent, as shown in figure 5.

Fig. 5: We change the rendering mode to transparent.

3. We modify the Albedo color of the material according to the color we want and decrease the alpha component until we achieve the desired level of transparency (figure 7).

Fig. 6: We change the color of the material.
Fig. 7: We decrease the alpha of the color to achieve transparency.



Results

In figure 8 we see the result, the material of the blue object is transparent and allows to see what is behind.

Fig. 8: The material now allows you to visualize what is behind it.

If you want to achieve a material similar to glass you can adjust the parameter “Smoothness”, this will make the material smoother and more similar to glass.

Fig. 9: We increase the “Smoothness” parameter.
Fig. 10: The material now looks more like glass.



Exit mobile version
Secured By miniOrange