Transparent Diffuse
Note. Unity 5 introduced the Standard Shader which replaces this shader.

Свойства Transparent шейдеров
Note. Unity 5 introduced the Standard Shader which replaces this shader.
Этот шейдер может сделать геометрию меша частично или полностью прозрачной с помощью считывания значений из альфа-канала основной текстуры. 0 в альфе (чёрный) означает полную прозрачность, в то время как 255 (белый) — полную непрозрачность. Если ваша основная текстура не имеет альфа-канала, объект будет полностью непрозрачен.
Использование прозрачных объектов в вашей игре может быть непростым делом из-за стандартных проблем графического программирование, которые могут приводить к проблемам сортировки в вашей игре. Например, если вы видите странные артефакты при обзоре сразу через два окна, вы испытываете классическую проблему при использовании прозрачности. Основное правило — быть готовым к случаям, когда один прозрачный объект может быть необычным способом отрисован перед другим, особенно если объекты пересекаются, прилегают друг к другу или слишком различны в размерах. Поэтому вам следует использовать прозрачные объекты только тогда, когда они вам нужны и не позволять чрезмерного их использования. Вам также следует предупредить вашего дизайнера(ов) о том, что могут возникнуть такие проблемы сортировки и подготовить их к тому, что возможно придётся изменять дизайн в таких случаях.
Свойства рассеивания (diffuse)
Рассеивание вычисляет простую (по Ламберту) модель освещения. Освещённость поверхности уменьшается пропорционально уменьшению угла между ней и источником света. Освещение зависит только от значения данного угла, и не меняется при перемещении или вращении камеры.
Производительность
Обычно этот шейдер низкозатратен для рендеринга. Для получения дополнительной информации, пожалуйста ознакомьтесь со страницей производительность шейдеров.
Цвет Albedo и прозрачность
Материал стандартного шейдера с параметрами по умолчанию и без назначенных значений или текстур. Параметр цвета альбедо выделен
Параметр Albedo управляет основным цветом поверхности.
Диапазон значений альбедо от черного до белого
Указание одного цвета для значения альбедо иногда полезно, но гораздо чаще для параметра альбедо назначается карта текстуры. Это должно представлять цвета поверхности объекта. Важно отметить, что текстура Albedo не должна содержать никакого освещения, поскольку освещение будет добавлено к ней в зависимости от контекста, в котором виден объект.
Два примера типичных текстурных карт Альбедо. Слева карта текстур для модели персонажа, а справа деревянный ящик. Обратите внимание, что нет теней или световых бликов.
Прозрачность
Альфа-значение цвета альбедо определяет уровень прозрачности материала. Это действует только в том случае, если Визуализация Процесс рисования графики на экране (или текстуры рендеринга). По умолчанию основная камера в Unity отображает изображение на экране. Подробнее
См. в Словарь Для материала установлен один из режимов прозрачности, и не Непрозрачный. Как упоминалось выше, выбор правильного режима прозрачности важен, потому что он определяет, будете ли вы по-прежнему видеть отражения и зеркальные блики в полном объеме или они также будут исчезать в соответствии со значениями прозрачности.
Диапазон значений прозрачности от 0 до 1 с использованием прозрачного режима, подходящего для реалистичных прозрачных объектов.
При использовании текстуры, назначенной для параметра альбедо, вы можете управлять прозрачностью материала, обеспечив наличие у изображения текстуры альбедо альфа-канал. Значения альфа-канала сопоставляются с уровнями прозрачности, при этом белый цвет полностью непрозрачен, а черный — полностью прозрачен. Это приведет к тому, что ваш материал может иметь области различной прозрачности.
Импортированная текстура с каналами RGB и альфа-каналом. Вы можете нажать кнопку RGB/A, как показано, для переключения каналов просматриваемого изображения.
Конечный результат, заглядывание через разбитое окно в здание. Щели в стекле полностью прозрачны, осколки частично прозрачны, а рама полностью непрозрачна.
How To Create Transparent Glass Materials In Unity
To start, let’s create a material. You can do this by right-clicking within the project menu and selecting Create>Material. I’m gonna name the material for this example “Glass_mat”.
Once you have a material created, you can customize a number of things within it.
To create transparent objects such as glass, change the “Rendering Mode” option to “Transparent”.
Clicking on the “Albedo” option’s color box allows you to change the RGB color value, as well as the material’s “Alpha” which affects its transparency.
The higher the Alpha, the less transparent the material is. A zero alpha would leave something completely transparent.
Here is an example of a cube with a standard shader. The rendering mode is set to “Opaque” and a texture of marble stone is applied to the “Albedo”.
Here is an example of a cube with a standard shader once again, but this time the rendering mode is set to “Transparent”, the “Smoothness” to 1, and the “Alpha Channel” within the “Albedo Color Picker” is set to 0.
Unity Transparent Material

Oftentimes when creating a game, you will need to create transparent objects. This can be anything from glass windows, walls, ice or maybe just a see-through treasure chest to entice the player to open it. Making an object see through requires using Unity’s transparent materials.
To create a transparent material in Unity you will need to set the render mode to transparent and reduce alpha value, inside the albedo color picker. You can then apply the material to make your objects transparent. In this Tips and Tricks: Unity Transparent Material we are going to walk you through, step by step, and show you how to implement your own transparent materials in Unity.
Getting Started
To begin, we have set up a basic scene in Unity to implement our transparent material. Our scene has a handful of trees that have been placed in front of the camera. These will serve to gauge how well we can see through our object.

Creating Unity’s Transparent Material
To create Unity’s transparent material in Unity we first need to create a materials folder to store our materials. This will help maintain the project’s structure and will ensure that we can locate assets as we build out our projects. This is especially helpful when we are working on large scale projects.
Inside of our materials folder, right click and select Create > Material. This will place a nameless material in our folder. Give the material a name to signify what its purpose is. For this unity tutorial, we will name our material “transparent”.

Select our material and the properties for the transparent material will appear in the inspector. The first thing we need to do is change the rendering mode. The rendering mode defaults to Opaque and this works great for solid colors, but Unity does not render the transparency despite there being an alpha value in the albedo color selector. This is because calculating transparency is a computationally expensive process, and you would not want all of your materials doing that if it was not needed. Set the render mode to Transparent to tell Unity that you want it to be treated transparent.

Next, we will need to lower the alpha value of the Albedo color. Select the white box with the eyedropper tool in the inspector. You will then be greeted with a color picker. The A value is for your alpha which controls transparency. Lower this to something around 60. The lower you go the more transparent the object will become. If you lower it to zero the object will disappear. 
Creating a Transparent Object in Unity
Time to create something we can see through. Inside of the scene’s hierarchy, right click and select 3D object > Cube. This will place a cube in our scene. Select the cube and in the inspector increase the X and Y scale to 15. This will turn our cube into a wall. Position your camera so that it is looking at the largest face of the wall.

Apply the Transparent Material to the Object in Unity
It is now time to apply the transparent material. With the Cube selected, expand the Mesh Renderer component in the inspector window. The first property will be Materials. If this is the first material you are applying to the object then you will see an Element 0 field. Click the circle next to default material and type transparent in the search bar to locate the material. You can also drag the material from the project folder into the field or onto the object in the scene view to apply it. 
At last, you can see through your cube wall. The only problem is that it does not quite look like glass, water, or any other transparent material.

Creating a Glass Material in Unity
Open up your material in the inspector once again. We can adjust the hue of our material to make it look slightly more like the material we are imitating. Select the Albedo color picker and change the hex value to #63BBCF this will give the material a bluish tint that looks like you are staring through a glass window. Feel free to adjust the color and transparency to your liking. 
And now you are ready to create Unity’s transparent materials to apply to walls, windows, and other objects within your own games made in Unity. Thank you for stopping by. Stick around and check out more of our tutorials or posts like our piece on Unity Cube Color. Also, leave a comment telling us what you liked or did not like about the tutorial. Was it easy to follow along? What do you want to learn next? As always check out some of our published apps below.