Creating Materials

From Virtual World Web Wiki
Jump to: navigation, search

Overview

Curio runs in the Unity 5 engine, and as a result uses Phyiscally Based Shading for all of it's scenes and objects. We use the Metallic shader, so it is a good idea to familiarize yourself with it from the official documentation. It is highly reccomended that you use a program like Substance Painter or Quixel Suite to build your materials to achieve the hightest quality textures.

Unity has a really great overview of Physically Based Shading here.

Below is a quick overview of each of the most commonly used texture inputs for the Standard Metallic Shader.

Albedo/Transparency

The Albedo input is the main texture for your object. This is the true colour of the object without taking shadows or bounced colours into account. Details light bounced light and ambient shadows are taken care of through other methods. The Albedo (main texture) is read from the RGB channels of your texture.

If you are using a partially transparent or cutout texture the Alpha channel will define what parts of your texture are transparent. If your texture is completely opaque you don't need to worry about this channel.

Official Unity Documentation for Albedo/Transparency

Metalness/Smoothness

The Metalness/Smoothness map can be one of the trickiest inputs to get right without using Substance or Quixel. The R channel of this input defines how metallic the surface looks, and the Alpha channel defines how specular the surface looks. While only the R channel is read, it is quite common to leave your Metalness information in all of the RGB channels. In both cases black information means less and white means more. Most non-metal surfaces will mean that your R channel will be pure black, or in a range of almost-blacks. The more white information in your R channel will make this surface look more metallic and refletive.

Official Unity Metallic shader guide

Official Unity Documentation for Metalness
Official Unity Documentation for Smoothness

Normal Map

The Normal Map input adds additional detail to your material by defining how light plays off of the surface of the mesh. It can add a lot of detail to lower poly meshes.

Official Unity Documentation for Normal Maps

Ambient Occlusion

The Ambient Occlusion input defines what part of your model has ambient shadows when lit with soft, indirect light. Direct realtime lights will shine through this channel and reveal the albedo underneath. This input adds a lot of detail to your model and helps it feel "grounded". It is read from the G channel in this input.

AO-example.jpg

Official Unity Documentation for Ambient Occlusion

Emissive

Emissive inputs add glowing features to your textures. This is handy for lights, LEDs, monitors and other sources of light. Any colour other than black becomes emissive, so make sure to selectively black out the parts of your texture you don't want to glow. When baking lighting for a scene these textures will actually contribute light to the bake. If an object wasn't present for the bake (like avatars or DOM objects) the texture will still appear to glow, but will not actually emit light.

Official Unity Documentation for Emission

How to properly create Alpha Channels

Alpha Channels can be tricky to create without being able to export your textures from Substance or Quixel (which take care of this automatically for you). While Alpha channels are often used for defining transparency, it is not always the case in a game engine. A game engine does not see the image as a picture, but as channels of information. Most commonly your RGB channels define how much Red, Blue and Green information make up an image, but as you can see from the above overviews they can be used to define very specific parts of how a material behaves.

PNGs, when saved out from Photoshop, use the opacity of the RGB channels to define what parts of the image are transparent, and not the alpha channel (however Unity derives an alpha channel from transparency). This can make building a Metalness/Smoothness map very tricky since it would be impractical to partially erase the parts of an image you want Unity to create an alpha channel from.

If you don't have access to Substance or Quixel you can use a Photoshop plugin like SuperPNG which will allow you to create a 32-bit PNG where the alpha channel is saved, and not created from transparency.

Official Unity Documentation regarding Alpha Channels