0:00:03.150,0:00:06.451 Standard Shader jest bardzo realistycznym i wszechstronnym shaderem. 0:00:07.520,0:00:09.520 Ten prosty, oparty na fizyce shader 0:00:09.520,0:00:11.520 może zostać wykorzystany do stworzenia olbrzymiej ilości 0:00:11.520,0:00:13.520 materiałów. Często się zdaża 0:00:13.520,0:00:15.520 że jedynie ten shader wystarczy 0:00:15.520,0:00:18.121 do stworzenia wszystkich materiałów w danym projekcie. 0:00:19.812,0:00:24.026 Ten shader jest używany do dmyślnych materiałów. 0:00:24.026,0:00:26.026 więc każdy kształt renderowany z 0:00:26.026,0:00:29.768 domyślnym materiałem będzie wykorzystywał standard shader. 0:00:33.412,0:00:36.190 Wszystkie nowo utworzone materiały 0:00:36.930,0:00:38.930 także będą używały standard shader 0:00:40.121,0:00:42.611 Aby zmienić shader używany przez materiał 0:00:42.611,0:00:45.236 wybierz menu shaderów w materiale 0:00:46.046,0:00:49.291 Zaznacz standard, aby używać standard shader 0:00:49.971,0:00:51.971 Warto zauważyć, że unity 0:00:51.971,0:00:53.971 posiada shadery dla obu 0:00:53.971,0:00:56.779 popularnych podejśc do opartego na fizyce renderowania 0:00:57.736,0:00:59.443 domyślnie metaliczny(metalic) 0:00:59.930,0:01:01.613 i lustrzany(specular) 0:01:01.613,0:01:03.251 Aby wybrać standard shader 0:01:03.251,0:01:05.167 korzystający z podejścia lustrzanego(specular) 0:01:05.167,0:01:07.601 wybierz Standard (Specular Setup). 0:01:08.475,0:01:10.475 W przeciwnym razie zaznacz Standard 0:01:10.475,0:01:12.475 dla podejścia metalicznego(metalic) 0:01:14.750,0:01:16.750 Ważne, aby zrozumieć, że 0:01:16.750,0:01:19.337 podejście metaliczne do opartego na fizyce renderowania 0:01:19.337,0:01:21.337 nie jest jedynie dla materiałów 0:01:21.337,0:01:23.100 mających wyglądać metalicznie. 0:01:23.696,0:01:25.696 To podejście jest zwane metalicznym 0:01:25.696,0:01:27.696 ponieważ polega na 0:01:27.696,0:01:30.761 ustalaniu jak bardzo metaliczna, bądź niemetaliczna 0:01:30.761,0:01:32.761 jest dana powierzchnia. 0:01:33.427,0:01:35.703 Jest to przeciwstawne do podejścia "specular" 0:01:35.703,0:01:37.451 w którym wybieramy jak bardzo lustrzana, 0:01:37.451,0:01:39.451 lub nielustrzana jest dana powierzchnia. 0:01:40.505,0:01:42.505 Oba podejścia są poprawne[br]37[br]00:01:42,505 --> 00:01:44,505[br]dla materiałów opartych na fizyce. 0:01:47.459,0:01:49.459 Ten oparty na fizyce materiał 0:01:49.459,0:01:51.362 wciąż jest standardowym materiałem Unity 0:01:51.695,0:01:53.695 i jest skojarzony 0:01:53.695,0:01:56.302 ze standardowym systemem renderowania. 0:02:00.014,0:02:02.990 Standard shader składa się z trzech części: 0:02:03.601,0:02:05.601 Rendering Mode(sposób renderowania) 0:02:05.601,0:02:07.601 Main Maps(Mapy podstawowe) 0:02:07.601,0:02:09.601 and Secondary Maps(mapy drugorzędne) 0:02:11.865,0:02:14.685 W standard shader możemy wybrać spośród trzech sposobów renderowania: 0:02:14.685,0:02:17.996 Opaque, Cutout, Fade and Transparent. 0:02:19.038,0:02:22.598 Większość materiałów jest nieprzeźroczystych, czyli "opaque" 0:02:23.167,0:02:25.558 "Opaque" jest domyślnym sposobem renderowania. 0:02:26.350,0:02:29.225 Dla materiałów przezroczystych, takich jak szkło 0:02:29.225,0:02:31.225 wybierz tryb "Transparent" 0:02:31.656,0:02:33.656 W przezroczystym trybie renderowania 0:02:34.142,0:02:36.819 kanał alpha głównej tekstury 0:02:36.819,0:02:39.930 jest używany do kontroli przezroczystości danego materiału 0:02:41.569,0:02:43.918 W trybie renderowania "cutout" 0:02:43.918,0:02:45.918 kanał alpha głównej tekstury 0:02:45.918,0:02:49.022 jest używany do wycięcia niektórych części tejże tekstury 0:02:49.689,0:02:53.240 Jeśli kanał alpha głównej tekstury zawiera zróżnicowane wartości 0:02:53.240,0:02:55.240 suwak o nazwie "alpha cutoff" może zostać użyty 0:02:55.240,0:02:57.240 do dostosowania wielkości wyciętego obszaru 0:02:57.240,0:03:00.837 do dostosowania wielkości wyciętego obszaru 0:03:02.546,0:03:04.546 Tryb renderowania o nazwie "Fade" jest bardzo podobny 0:03:04.546,0:03:06.546 do trybu "Transparent" 0:03:07.509,0:03:09.509 "Fade" służy do całkowitego wymazywania 0:03:09.509,0:03:11.509 obiektów na ekranie. 0:03:12.192,0:03:14.192 W trybie renderowania "transparent" 0:03:14.192,0:03:16.750 przezroczysty materiał zachowa swoją zdolność 0:03:16.750,0:03:20.681 odbijania części światła, niezależnie wartości kanału alpha. 0:03:20.681,0:03:22.681 "Fade" natomiast wymaże wszystkie 0:03:22.681,0:03:24.681 odpowiednie aspekty materiału, 0:03:24.681,0:03:28.018 więc w tym przypadku przy ustawieniu alpha na 0, obiekt będzie całkowicie niewidzialny. 0:03:30.347,0:03:33.736 Część z mapami głównymi "main maps" określa wygląd materiału. 0:03:34.361,0:03:37.301 Zanim przyjrzymy się z bliska każdej zmiennej, 0:03:37.301,0:03:40.578 jest kilka tematów, które warto poruszyć wcześniej 0:03:41.314,0:03:43.131 Optymalizacja 0:03:43.131,0:03:46.071 shader "Standard" jest świetnie zoptymalizowany. 0:03:46.613,0:03:48.613 Kiedy shader się kompiluje 0:03:48.613,0:03:50.613 wykonują się dwie ważne rzeczy: 0:03:51.113,0:03:54.698 Wszystkie nieużywane zmienne są pomijane, oraz 0:03:55.240,0:03:57.240 sprawdzana jest docelowa platforma 0:03:57.240,0:03:59.907 i shader zostaje zoptymalizowany dla danego urządzenia 0:04:00.559,0:04:03.653 Z tego powodu nie ma potrzeby wypełniać każdej 0:04:03.653,0:04:06.073 zmiennej wartością lub teksturą 0:04:07.681,0:04:09.681 i nie ma obawy, że niepotrzebnie zostaną zużyte 0:04:09.681,0:04:12.357 zasoby sprzętowe do nieużywanych właściwości. 0:04:15.750,0:04:17.750 Cieniowanie oparte na fizyce. 0:04:18.451,0:04:20.451 Cieniowanie oparte na fizyce stara się zastosować 0:04:20.451,0:04:23.952 pewne fizyczne aspekty powierzchni materiału 0:04:23.952,0:04:25.952 włączając jego kolor światła rozproszonego, 0:04:25.952,0:04:27.952 odbicie lustrzane i inne właściwości, 0:04:27.952,0:04:30.355 więc materiał zachowuje się poprawnie 0:04:30.355,0:04:33.279 i wiarygodnie we wszystkich warunkach oświetleniowych. 0:04:33.938,0:04:36.325 The response of the scene lighting to the material 0:04:36.325,0:04:38.325 created with a physically based shader 0:04:38.325,0:04:41.192 mimics light in the real physical world. 0:04:41.839,0:04:43.839 This means that even though there is 0:04:43.839,0:04:45.839 full control over the values on 0:04:45.839,0:04:48.613 all of the properties in the standard shader 0:04:48.613,0:04:50.613 there are certain ranges of values that 0:04:50.613,0:04:53.359 work best for certain types of materials. 0:04:54.057,0:04:57.736 This is particularly true of the metallic and specular values 0:04:57.736,0:05:00.543 depending up which approach is being used 0:05:01.273,0:05:03.723 Taking specular colour for example, 0:05:03.723,0:05:06.199 when analysing real-world materials 0:05:06.199,0:05:08.199 most materials have a specular range 0:05:08.199,0:05:10.199 that is a very dark grey. 0:05:10.768,0:05:15.416 Metals created with a specular workflow are one of the few exceptions, 0:05:15.416,0:05:18.095 they have very bright specular values. 0:05:19.043,0:05:22.066 As well, no material, even the most dull, 0:05:22.066,0:05:24.066 has no specularity at all. 0:05:24.997,0:05:26.997 This means to have a physically based 0:05:26.997,0:05:28.997 material behave correctly 0:05:28.997,0:05:30.997 some attention needs to be paid in using 0:05:30.997,0:05:34.316 the correct physical values for some key properties, 0:05:34.316,0:05:37.149 especially the specular or metallic properties 0:05:37.149,0:05:39.149 depending upon the approach being used. 0:05:40.224,0:05:42.863 For more information on physical-based shading, 0:05:42.863,0:05:45.553 material charts and sample materials 0:05:45.553,0:05:47.553 please see the information linked below. 0:05:48.512,0:05:50.512 There is no need to panic however. 0:05:50.512,0:05:53.002 Items with materials from previous versions of Unity 0:05:53.002,0:05:55.284 will work well out of the box. 0:05:55.894,0:05:58.214 Upgrading from a legacy diffuse shader 0:05:58.214,0:06:01.265 to the standard shader should display little or no difference. 0:06:03.307,0:06:05.738 In the main map section each of these properties 0:06:05.738,0:06:08.318 control one aspect of the final material. 0:06:09.127,0:06:11.942 Each property can be defined by a texture map. 0:06:13.328,0:06:15.096 With the metallic approach, 0:06:15.096,0:06:18.163 for the albido, metallic and emission properties 0:06:18.163,0:06:20.163 the texture is optional. 0:06:20.661,0:06:22.904 The albido and emission properties 0:06:22.904,0:06:25.531 can simply use a colour value instead of a texture. 0:06:26.508,0:06:28.416 The colour value is not available on 0:06:28.416,0:06:30.416 the emission property until the emissive 0:06:30.416,0:06:32.416 scale is larger than 0. 0:06:34.775,0:06:36.775 The metallic property can use a slider 0:06:36.775,0:06:38.775 instead of a texture. 0:06:42.516,0:06:44.516 The albido property uses a 0:06:44.516,0:06:46.516 combination of an optional texture. 0:06:48.543,0:06:51.598 And a colour value to define the base look of the material. 0:06:52.685,0:06:55.682 The colour value will tint the texture. 0:06:57.470,0:07:00.535 Where pure white leaves the main texture unaffected, 0:07:01.552,0:07:03.552 if there is no texture being used 0:07:03.552,0:07:06.792 the tint colour will be the base colour for the material 0:07:09.884,0:07:11.884 The metallic property can be defined 0:07:11.884,0:07:13.884 by either a texture 0:07:15.248,0:07:18.303 or a value from 0 to 1 0:07:18.303,0:07:20.303 set by the slider. 0:07:20.303,0:07:23.506 This defines the metalness of the material surface. 0:07:24.538,0:07:27.332 Metalness works very closely with smoothness. 0:07:28.548,0:07:30.548 The smoothness property is used to 0:07:30.548,0:07:32.061 control the smoothness, 0:07:32.061,0:07:35.453 or micro-surface detail, of the material. 0:07:35.453,0:07:38.453 It is also a value between 0 and 1. 0:07:41.028,0:07:43.028 The less smooth the surface is, 0:07:43.028,0:07:44.824 the more diffuse the reflections will be. 0:07:45.360,0:07:48.204 The more smooth, the sharper the reflections. 0:07:52.650,0:07:54.650 The metallic property can use a texture 0:07:54.650,0:07:57.426 to define the material's metalness. 0:07:58.071,0:08:00.071 This texture can be a simple shade of grey 0:08:00.071,0:08:03.163 used to define the metalness from black, 0:08:03.163,0:08:04.517 or non-metallic, 0:08:04.517,0:08:06.517 to white, completely metallic. 0:08:07.217,0:08:10.339 However, the advantage of using a texture 0:08:10.339,0:08:12.686 to define the metalness of a material 0:08:12.686,0:08:14.686 is to vary the metalness value 0:08:14.686,0:08:16.686 across the surface of the material. 0:08:17.589,0:08:20.654 An additional advantage is this texture's alpha channel. 0:08:21.524,0:08:23.524 This alpha channel can be used to define 0:08:23.524,0:08:25.524 a smoothness map. 0:08:27.791,0:08:29.791 Many materials are far more complex 0:08:29.791,0:08:31.791 than a single uniform surface. 0:08:32.657,0:08:34.657 Take this leather case for example. 0:08:35.486,0:08:37.486 With a single value for metalness and a 0:08:37.486,0:08:39.131 single value for smoothness 0:08:39.615,0:08:41.615 the case looks good. 0:08:41.615,0:08:43.138 But it could look better. 0:08:43.890,0:08:45.891 Use a metalness and smoothness map 0:08:45.891,0:08:47.891 to describe the properties. 0:08:49.660,0:08:51.660 And it looks much better. 0:08:51.660,0:08:53.660 Note how the straps are far more glossy 0:08:53.660,0:08:55.660 than the main body of the case. 0:08:55.660,0:08:57.660 Giving them a feel of polished leather. 0:08:58.969,0:09:00.969 It is worth noting that when using a texture 0:09:00.969,0:09:02.969 to define the metalness 0:09:02.969,0:09:04.969 the smoothness value must also be 0:09:04.969,0:09:06.969 defined by that texture's alpha channel. 0:09:07.983,0:09:09.983 It is also worth noting that the metalness 0:09:09.983,0:09:11.983 value is stored only in the red 0:09:11.983,0:09:15.013 channel of the metalness map's RGB values. 0:09:15.990,0:09:17.990 The green and blue channels are ignored. 0:09:19.059,0:09:21.923 It is often easier however to visualise 0:09:21.923,0:09:23.923 the metalness values of a texture 0:09:23.923,0:09:26.709 if all three colour channels share the same map, 0:09:26.709,0:09:29.573 so the texture appears as a greyscale image. 0:09:30.716,0:09:33.440 When using the standard shader with the specular setup 0:09:35.615,0:09:37.615 the metallic property is replaced with 0:09:37.615,0:09:39.173 the specular property. 0:09:39.891,0:09:41.891 The specular approach also uses 0:09:41.891,0:09:44.775 a smoothness property, which behaves essentially 0:09:44.775,0:09:47.546 in the same way as with the metalness approach. 0:09:50.956,0:09:53.585 The specualar property can either be a texture 0:09:55.278,0:09:56.728 or a colour value 0:09:57.499,0:09:59.499 and defines the specular reflectivity 0:09:59.499,0:10:01.628 of the material's surface. 0:10:01.628,0:10:04.527 The specular value can have some colour in it 0:10:04.527,0:10:06.527 but looking at real world values 0:10:06.527,0:10:08.527 with the exception of some metals 0:10:08.527,0:10:11.449 this is usually a grey and often very dark. 0:10:12.610,0:10:15.518 Specular maps are usually a dark grey as well. 0:10:17.545,0:10:20.332 When a specular texture map is not being used 0:10:20.332,0:10:22.332 the overall surface smoothness can be 0:10:22.332,0:10:24.332 set with the slider. 0:10:26.765,0:10:28.765 This is easier to see when the albido 0:10:28.765,0:10:30.765 texture is removed. 0:10:31.502,0:10:33.502 The ball looks like polished porcelain. 0:10:34.737,0:10:38.692 For a more true mirror, the specular from dark grey, 0:10:38.692,0:10:40.692 which makes the ball look like porcelain 0:10:40.692,0:10:43.547 in to the range of metals and it will now 0:10:43.547,0:10:45.547 reflect the sky and surroundings. 0:10:46.487,0:10:49.357 The smoother the surface, the more it is mirror-like. 0:10:50.330,0:10:53.077 The rougher the surface the more diffuse, 0:10:53.077,0:10:55.077 or scattered the reflections are. 0:10:56.588,0:10:58.938 The normal map property is an optional property 0:10:58.938,0:11:01.787 used to define the apparent bumpiness of the surface. 0:11:02.893,0:11:04.893 When a normal map is applied 0:11:05.649,0:11:07.649 the strength of the normal map can be controlled 0:11:07.649,0:11:09.927 by adjusting the normal map value. 0:11:11.033,0:11:13.033 As well as positive numbers, this value 0:11:13.033,0:11:14.758 can be a negative number 0:11:15.420,0:11:16.455 or 0. 0:11:18.040,0:11:20.040 The height map property is an optional 0:11:20.040,0:11:22.040 property used to define the apparent 0:11:22.040,0:11:24.040 height of the surface. 0:11:24.040,0:11:26.040 When a height map is applied 0:11:26.667,0:11:28.667 the strength of the height map can be controlled 0:11:28.667,0:11:30.667 by adjusting the height map value. 0:11:32.842,0:11:34.842 The occlusion property uses a 0:11:34.842,0:11:36.842 texture map to define the amount of 0:11:36.842,0:11:39.509 ambient occlusion that is applied to the material. 0:11:40.799,0:11:42.799 This is used to help darken 0:11:42.799,0:11:45.095 hidden or recessed areas on the texture. 0:11:46.200,0:11:48.200 The ambient occlusion map also 0:11:48.200,0:11:50.200 prevents specular and reflections in 0:11:50.200,0:11:52.676 these occluded areas, given the material 0:11:52.676,0:11:54.676 a more realistic look. 0:11:56.058,0:11:58.690 The emission property controls whether or not 0:11:58.690,0:12:00.690 the material's surface will emit light. 0:12:01.630,0:12:03.630 The material's emission value can contribute 0:12:03.630,0:12:05.630 to the scene's global illumination. 0:12:06.791,0:12:08.791 The strength of the emission can be controlled 0:12:08.791,0:12:10.791 by the emission value. 0:12:11.215,0:12:14.235 The shape of the emission can be controlled with an emission map. 0:12:15.359,0:12:17.359 The map can be a simple black and white map. 0:12:23.699,0:12:26.447 bBut this texture can also be a colour map. 0:12:32.529,0:12:34.529 When there is a value for emission 0:12:34.529,0:12:36.529 the contribution of the emissive light 0:12:36.529,0:12:39.262 can be assigned to either the baked light maps 0:12:40.607,0:12:42.607 or to the real time light maps. 0:12:45.740,0:12:48.930 The detail mask property is an optional mask element 0:12:48.930,0:12:50.930 to control the secondary maps. 0:12:52.054,0:12:54.708 Tiling and offset control the position of the map. 0:12:55.961,0:12:57.961 The secondary maps are used to define 0:12:57.961,0:12:59.961 additional surface detail. 0:12:59.961,0:13:03.608 This additional detail, sometimes referred to as micro detail, 0:13:03.608,0:13:05.608 is added on top of the surface defined 0:13:05.608,0:13:07.111 by the main maps. 0:13:07.848,0:13:09.848 This helps to add extra detail and 0:13:09.848,0:13:12.657 variation to a material, which is overlaid 0:13:12.657,0:13:15.460 on top of the main maps defining that material. 0:13:16.187,0:13:19.217 Because detail maps can be tiled across meshes 0:13:19.899,0:13:22.693 they can add incredibly high levels of surface detail.