It is very common to have images that display transparency to add details and improve the look of 3D models. PNG files store the information regarding the alpha channel of an image, so that parts of the image itself can be displayed as transparent. The following recipe shows you how to configure a transparent texture in Unity.
For this recipe, we use another image we have provided, the one named secondTexture
. As this image is already saved in PNG format, we jump straight into Unity and import it from there.
Assets/Textures
folder.This time, in the Inspector window, we flagged the options to use the grayscale of the image to display its darkest parts as transparent. As a result, all black squares in the image aren't rendered when this texture goes into a material.
Many other types are available: normal maps, sprites, reflection maps, and GUI elements. In the following recipe, we'll create two distinct materials with the textures we just imported.
3.137.217.198