L6 - Materials Flashcards
materials used for?
color, shade, texture
material represents
shader and its settings
textures are…
images that get stretched around meshes
textures affect
color, transparency, depth, shininess,….
assign texture to material how?
drag into albedo slot of material object
create shader how?
assets->rt-click->create->shader…
shader code language?
hlsl
relationships between shader, material, object
shader onto material, material onto object
_Time.z is what?
built in shader value counting time since you pressed play
Unity Standard shader
Unity’s Standard Shader attempts to light objects in a physically accurate way. This technique is called Physically-Based Rendering or PBR for short. Instead of defining how an object looks in one lighting environment, you specify the properties of the object, for example, how metal or plastic it is.
Then, the shader computes its shading based on those factors. In practice, this works incredibly well to produce realistic 3D objects across a variety of lighting conditions. The big problem is that it is often computationally expensive.
assign shader to material
select shader in inspector
3 shader types we used, core tradeoff and spectrum positions.
quality performance
default (PBR) . mobile/diffuse mobile/unlit
model comprised of
texture, material, meshes
In this lesson we learned…
What are materials?
Materials are what we use to color and shade our objects. They consist of a shader and its settings. Without them, we wouldn’t be able to see objects in our scene at all!
How can I create and assign materials to an object?
To create a material, go to the Project window and click Create > Material. There are a couple different ways you can assign a material to an object. Find the material in the Project window and click and drag the material onto an object in the Scene. Click on an object in the Hierarchy, so you can see the details in the inspector. Click and drag the material and drop it in the inspector.
What are textures and how can we assign them to an object.
Textures are images that get stretched around meshes. They can adjust color, transparency, depth, shininess, metalness, light emission, etc. To assign a texture to an object, find the object’s material in the Project window and click on it, so you can see its properties in the Inspector window. Search for your image in the Project window. Click and drag the image into the small box to the left of the “Albedo” setting in the object’s material.
What are shaders?
Shaders are written in High Level Shader Language (HLSL). Shaders are essentially the code behind how an object is rendered.
For mobile VR, we’ll want to use simple shaders because the Standard Unity shaders will be too computationally expensive. To change the shader type of a material, click on the material in the Project window. In the Inspector, toward the top, you’ll see a dropdown for Shader.
What are some simple shaders?
Mobile > Unlit (Supports Lightmap) - This super fast shader supports lightmaps, but doesn’t get any realtime lighting.
Mobile > Diffuse - This is a fast shader, that does get some lighting information. The main difference between this shader and the standard shader, is that this one is much faster.
What makes up a model?
Models are made up of materials, textures and meshes.