filmov
tv
C# Scripting With Materials in Unity
Показать описание
This video explains how you can use C# code to edit and set properties on materials in your Unity projects. We cover the difference between editing material instance vs the material asset itself, we show you how to find the names of Texture Maps in the shader definition so that you can edit them, and we explain how alpha and transparency works in Colors. We are using the Universal Render Pipeline materials for this video.
XRTerra Links:
00:00 Intro
00:13 Creating two cubes with a material
00:53 Creating material script
01:21 Referencing the Mesh Renderer
02:01 Setting material instance color
02:34 Testing out color change
03:08 material vs sharedMaterial
03:47 sharedMaterial changes persist
04:25 Color type
05:01 Setting Color in the Inspector
05:38 Alpha channel
06:26 How do I set other material properties?
07:25 Opening up the shader code
09:39 GetTextureOffset("_BaseMap")
10:41 SetTextureOffset("_BaseMap", newOffset)
11:33 Finding the names of other texture maps
13:04 Changing the material through code
14:25 Outro
Instructor: Gregory Osborne
XRTerra Links:
00:00 Intro
00:13 Creating two cubes with a material
00:53 Creating material script
01:21 Referencing the Mesh Renderer
02:01 Setting material instance color
02:34 Testing out color change
03:08 material vs sharedMaterial
03:47 sharedMaterial changes persist
04:25 Color type
05:01 Setting Color in the Inspector
05:38 Alpha channel
06:26 How do I set other material properties?
07:25 Opening up the shader code
09:39 GetTextureOffset("_BaseMap")
10:41 SetTextureOffset("_BaseMap", newOffset)
11:33 Finding the names of other texture maps
13:04 Changing the material through code
14:25 Outro
Instructor: Gregory Osborne