{"id":318649,"date":"2021-02-26T09:00:12","date_gmt":"2021-02-26T09:00:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=318649"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=318649","title":{"rendered":"\u0412\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u043a\u0438: \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<ul>\n<li>\u0420\u0430\u0441\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0444\u0440\u0430\u043a\u0442\u0430\u043b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0433\u043b\u0443\u0431\u0438\u043d\u044b.<\/li>\n<li>\u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u0438\u0441\u0442\u044c\u044f \u0441 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0449\u0438\u043c\u0441\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0432\u0438\u0434\u043e\u043c.<\/li>\n<li>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0430 \u043f\u043e\u0434 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u00ab\u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u0438\u00bb.<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/li>\n<\/ul>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0444\u0440\u0430\u043a\u0442\u0430\u043b \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438, \u043d\u0435\u0436\u0435\u043b\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>  \u0422\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u0441\u0434\u0435\u043b\u0430\u043d \u0432 Unity 2019.4.18f1.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/364\/36d\/8e2\/36436d8e2319555fd7f6bc06970ee30f.jpg\" width=\"512\" height=\"256\"><\/div>\n<p>  <i>\u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u043a\u0442\u0430\u043b, \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0449\u0438\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0438\u043c.<\/i><\/p>\n<h2>\u0413\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u0446\u0432\u0435\u0442\u0430<\/h2>\n<p>  \u0424\u0440\u0430\u043a\u0442\u0430\u043b, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 \u0432 <a href=\"https:\/\/catlikecoding.com\/unity\/tutorials\/basics\/jobs\/\" rel=\"nofollow noopener noreferrer\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435<\/a>, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438. \u041e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0442\u0440\u043e\u0433\u0438\u043c, \u0442\u043e\u0447\u043d\u044b\u043c, \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0438 \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u043c. \u041e\u043d \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c, \u043d\u0438 \u0436\u0438\u0432\u044b\u043c. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u043d\u0435\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u043d\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0432\u043d\u0435\u0441\u0451\u043c \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0441\u0442\u044c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0438\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u043a\u0438.<\/p>\n<p>  \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0430 \u2014 \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0430 \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u043c \u0446\u0432\u0435\u0442\u043e\u0432, \u0438 \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0435\u0433\u043e \u043a \u0443\u0440\u043e\u0432\u043d\u044e \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0446\u0432\u0435\u0442<\/h3>\n<p>  \u041d\u0430\u0448 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u044b\u0439 DRP-\u0448\u0435\u0439\u0434\u0435\u0440 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <em>_Color<\/em>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043f\u043e\u043a\u0430 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430, \u043d\u043e \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0432 \u043a\u043e\u0434\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u043e <code>Fractal<\/code>.<\/p>\n<pre><code class=\"cpp\">\tstatic readonly int \t\tcolorId = Shader.PropertyToID(&quot;_Color&quot;), \t\tmatricesId = Shader.PropertyToID(&quot;_Matrices&quot;);<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0432\u044b\u0437\u043e\u0432\u0435\u043c <code>SetColor<\/code> \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u0446\u0438\u043a\u043b\u0435 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 <code>Update<\/code>. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0431\u0435\u043b\u044b\u0439 \u0446\u0432\u0435\u0442, \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0446\u0438\u043a\u043b\u0430 \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043d\u0430 \u0434\u043b\u0438\u043d\u0443 \u0431\u0443\u0444\u0435\u0440\u0430 \u043c\u0438\u043d\u0443\u0441 \u043e\u0434\u0438\u043d. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0441\u0442\u0430\u043d\u0435\u0442 \u0447\u0451\u0440\u043d\u044b\u043c, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u2014 \u0431\u0435\u043b\u044b\u043c.<\/p>\n<pre><code class=\"cpp\">\t\tfor (int i = 0; i &lt; matricesBuffers.Length; i++) { \t\t\tComputeBuffer buffer = matricesBuffers[i]; \t\t\tpropertyBlock.SetColor( \t\t\t\tcolorId, Color.white * (i \/ (matricesBuffers.Length - 1)) \t\t\t); \t\t\tpropertyBlock.SetBuffer(matricesId, buffer); \t\t\tGraphics.DrawMeshInstancedProcedural( \t\t\t\tmesh, 0, material, bounds, buffer.count, propertyBlock \t\t\t); \t\t}<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0434\u0430\u0442\u044c \u0432\u0441\u0435\u043c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u043c \u0443\u0440\u043e\u0432\u043d\u044f\u043c \u043e\u0442\u0442\u0435\u043d\u043a\u0438 \u0441\u0435\u0440\u043e\u0433\u043e \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439, \u0430 \u043d\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435, \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0435\u0435 \u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0435\u0433\u043e, \u0441\u0434\u0435\u043b\u0430\u0432 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0432 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435\u043c \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0442\u043e\u0436\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.<\/p>\n<pre><code class=\"cpp\">\t\t\tpropertyBlock.SetColor( \t\t\t\tcolorId, Color.white * (i \/ (matricesBuffers.Length - 1f)) \t\t\t);<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0432 \u0433\u0440\u0430\u0444\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 URP, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0434\u043b\u044f albedo \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <em>_Color<\/em>. \u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0438\u043c\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0433\u0440\u0430\u0444\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043a\u0430\u043a \u0438\u043c\u044f <em>Reference<\/em> \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0430 blackboard.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/583\/4a2\/de9\/5834a2de9e895cb15b3cce138e3ab24a.png\" width=\"260\" height=\"188\"><\/div>\n<p>  <i>\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 Albedo \u2014 <em>_Color<\/em>.<\/i><\/p>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0444\u0440\u0430\u043a\u0442\u0430\u043b \u0432 \u0433\u0440\u0430\u0434\u0430\u0446\u0438\u044f\u0445 \u0441\u0435\u0440\u043e\u0433\u043e, \u0438\u0434\u0443\u0449\u0438\u0439 \u043e\u0442 \u0447\u0451\u0440\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0435 \u0434\u043e \u0431\u0435\u043b\u043e\u0433\u043e \u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u0445-\u043b\u0438\u0441\u0442\u044c\u044f\u0445, \u043a\u0430\u043a \u0432 DRP, \u0442\u0430\u043a \u0438 \u0432 URP.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/919\/625\/0fa\/9196250faad3d39c70002905bd8ccf67.png\" width=\"370\" height=\"320\"><\/div>\n<p>  <i>\u0424\u0440\u0430\u043a\u0442\u0430\u043b \u0432 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0445 \u043e\u0442\u0442\u0435\u043d\u043a\u0430\u0445 \u0441\u0435\u0440\u043e\u0433\u043e.<\/i><\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0432 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0431\u0435\u043b\u043e\u0433\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435. \u041d\u043e \u0435\u0441\u043b\u0438 \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0430 \u0440\u0430\u0432\u043d\u0430 1, \u0442\u043e \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043d\u0430 \u043d\u043e\u043b\u044c \u0438 \u043a \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u043c\u0443 \u0446\u0432\u0435\u0442\u0443. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0433\u043e, \u043c\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0433\u043b\u0443\u0431\u0438\u043d\u0443 \u0434\u043e 2.<\/p>\n<pre><code class=\"cpp\">\t[SerializeField, Range(2, 8)] \tint depth = 4;<\/code><\/pre>\n<p>  <\/p>\n<h3>\u0418\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0446\u0432\u0435\u0442\u0430\u043c\u0438<\/h3>\n<p>  \u041c\u044b \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0440\u044b\u043c\u0438 \u0438\u043b\u0438 \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u043d\u044b\u043c\u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430\u043c\u0438. \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044e \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043b\u044e\u0431\u044b\u043c\u0438 \u0446\u0432\u0435\u0442\u0430\u043c\u0438, \u0432\u044b\u0437\u044b\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 <code>Color.Lerp<\/code> \u0441 \u0434\u0432\u0443\u043c\u044f \u0446\u0432\u0435\u0442\u0430\u043c\u0438 \u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0440\u0430\u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0442\u043e\u0440\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 <code>Update<\/code> \u0434\u0432\u0443\u0445\u0446\u0432\u0435\u0442\u043d\u044b\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442 \u0436\u0451\u043b\u0442\u043e\u0433\u043e \u043a \u043a\u0440\u0430\u0441\u043d\u043e\u043c\u0443.<\/p>\n<pre><code class=\"cpp\">\t\t\tpropertyBlock.SetColor( \t\t\t\tcolorId, Color.Lerp( \t\t\t\t\tColor.yellow, Color.red, i \/ (matricesBuffers.Length - 1f) \t\t\t\t) \t\t\t);<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/cb7\/2da\/278\/cb72da2789a25690d502defa29cfdcb3.png\" width=\"370\" height=\"320\"><\/div>\n<p>  <i>\u0424\u0440\u0430\u043a\u0442\u0430\u043b \u0432 \u0436\u0451\u043b\u0442\u043e-\u043a\u0440\u0430\u0441\u043d\u043e\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0435.<\/i><\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442<\/h3>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0448\u0430\u0433 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u0432, \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0446\u0432\u0435\u0442\u043e\u0432 \u0438 \u043d\u0435\u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0442\u0438\u043f\u0430 <code>Gradient<\/code> \u0434\u0432\u0438\u0436\u043a\u0430 Unity. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e <br \/>  <code>Fractal<\/code> \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442.<\/p>\n<pre><code class=\"cpp\">\t[SerializeField] \tMaterial material = default;  \t[SerializeField] \tGradient gradient = default;<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/858\/180\/1ba\/8581801badbcb84a36a59e266b2dd13b.png\" width=\"320\" height=\"42\"><\/div>\n<p>  <i>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e Gradient, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0437\u0430\u0434\u0430\u043d\u044b \u0431\u0435\u043b\u044b\u0439, \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0438 \u0447\u0451\u0440\u043d\u044b\u0439 \u0446\u0432\u0435\u0442\u0430.<\/i><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442, \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0432\u044b\u0437\u043e\u0432 <code>Color.Lerp<\/code> \u0432 <code>Update<\/code> \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 <code>Evaluate<\/code> \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430, \u0441\u043d\u043e\u0432\u0430 \u0441 \u0442\u0435\u043c \u0436\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0442\u043e\u0440\u0430.<\/p>\n<pre><code class=\"cpp\">\t\t\tpropertyBlock.SetColor( \t\t\t\tcolorId, gradient.Evaluate(i \/ (matricesBuffers.Length - 1f)) \t\t\t);<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fa6\/df3\/414\/fa6df3414321e337681af880b609626a.png\" width=\"370\" height=\"320\"><\/div>\n<p>  <i>\u0424\u0440\u0430\u043a\u0442\u0430\u043b \u0441 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u043c \u0431\u0435\u043b\u043e-\u043a\u0440\u0430\u0441\u043d\u043e-\u0447\u0451\u0440\u043d\u044b\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u043c.<\/i><\/p>\n<h2>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430<\/h2>\n<p>  \u0420\u0430\u0441\u043a\u0440\u0430\u0448\u0435\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u043c \u0444\u0440\u0430\u043a\u0442\u0430\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435, \u0447\u0435\u043c \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u0439, \u043d\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e, \u0447\u0442\u043e \u0440\u0430\u0441\u043a\u0440\u0430\u0441\u043a\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435. \u0412 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u043a\u0430\u044f \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0446\u0432\u0435\u0442\u0430, \u043a\u0430\u0436\u0443\u0449\u0430\u044f\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u044d\u043a\u0437\u0435\u043c\u043b\u044f\u0440\u044b \u043c\u0435\u0448\u0435\u0439 \u0434\u043e\u043b\u0436\u043d\u044b \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0446\u0432\u0435\u0442\u043e\u0432.<\/p>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0446\u0432\u0435\u0442\u0430 \u0432 \u0448\u0435\u0439\u0434\u0435\u0440\u0435<\/h3>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0438 \u0434\u043b\u044f \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430, \u0438 \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0430 \u0448\u0435\u0439\u0434\u0435\u0440\u0430, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0446\u0432\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 HLSL-\u0444\u0430\u0439\u043b <em>FractalGPU<\/em>. \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043d\u0451\u043c \u043f\u043e\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <em>_Color<\/em>, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>GetFractalColor<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u0442\u043e \u043f\u043e\u043b\u0435. \u0420\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u0435\u0451 \u043d\u0430\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0433\u0440\u0430\u0444\u0430 \u0448\u0435\u0439\u0434\u0435\u0440\u0430.<\/p>\n<pre><code class=\"cpp\">float4 _Color;  float4 GetFractalColor () { \treturn _Color; }  void ShaderGraphFunction_float (float3 In, out float3 Out) { \tOut = In; }<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0443\u0434\u0430\u043b\u0438\u043c \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0437 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u043c <code>GetFractalColor<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 <code>ConfigureSurface<\/code> \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u043e\u043b\u044e.<\/p>\n<pre><code class=\"cpp\">\t\t\/\/float4 _Color; \t\tfloat _Smoothness;  \t\tvoid ConfigureSurface (Input input, inout SurfaceOutputStandard surface) { \t\t\tsurface.Albedo = GetFractalColor().rgb; \t\t\tsurface.Smoothness = _Smoothness; \t\t}<\/code><\/pre>\n<p>  \u041c\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 albedo, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u0435\u043c \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u0438\u0437 \u0431\u043b\u043e\u043a\u0430 <code>Properties<\/code>.<\/p>\n<pre><code class=\"cpp\">\tProperties { \t\t\/\/_Color (&quot;Albedo&quot;, Color) = (1.0, 1.0, 1.0, 1.0) \t\t_Smoothness (&quot;Smoothness&quot;, Range(0,1)) = 0.5 \t}<\/code><\/pre>\n<p>  \u0420\u0430\u0441\u043a\u0440\u043e\u0435\u043c \u0446\u0432\u0435\u0442 \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0430 \u043d\u0430\u0448\u0435\u043c\u0443 \u0433\u0440\u0430\u0444\u0443 \u0448\u0435\u0439\u0434\u0435\u0440\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0433\u0440\u0430\u0444\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0438.<\/p>\n<pre><code class=\"cpp\">void ShaderGraphFunction_float (float3 In, out float3 Out, out float4 FractalColor) { \tOut = In; \tFractalColor = GetFractalColor(); }  void ShaderGraphFunction_half (half3 In, out half3 Out, out half4 FractalColor) { \tOut = In; \tFractalColor = GetFractalColor(); }<\/code><\/pre>\n<p>  \u0412 \u0441\u0430\u043c\u043e\u043c \u0433\u0440\u0430\u0444\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043c\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <em>Albedo<\/em>. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435 \u043c\u0435\u043d\u044e, \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0435 \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043b\u0430\u0432\u0438\u0448\u0435\u0439 \u043c\u044b\u0448\u0438 \u043d\u0430 \u0435\u0451 \u043c\u0435\u0442\u043a\u0435 \u043d\u0430 blackboard.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/1a0\/7c9\/cac\/1a07c9cac7ff3adade4847e1a559e30e.png\" width=\"210\" height=\"136\"><\/div>\n<p>  <i>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e smoothness.<\/i><\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u044b\u0432\u043e\u0434 \u043a \u043d\u0430\u0448\u0435\u043c \u043d\u043e\u0434\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/2ff\/d07\/603\/2ffd07603223bfce870ccbc0bdc98d56.png\" width=\"320\" height=\"92\"><\/div>\n<p>  <i>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 <em>FractalColor<\/em> \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/i><\/p>\n<p>  \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c albedo.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/4fb\/77f\/ebb\/4fb77febbd5053112bfff22165b3b4c5.png\" width=\"410\" height=\"160\"><\/div>\n<p>  <i>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <em>FractalColor<\/em> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 albedo.<\/i><\/p>\n<h3>\u041f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u0446\u0432\u0435\u0442 \u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430<\/h3>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0443\u044e \u043e\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c <code>GetFractalColor<\/code> \u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430. \u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u043e\u0442\u0441\u0447\u0451\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u0435\u0434\u0451\u0442\u0441\u044f \u0441 \u043d\u0443\u043b\u044f, \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430, \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0442\u0440\u0438 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0432\u0435\u043b\u0438\u0447\u0438\u043d, \u0447\u0442\u043e \u0434\u0430\u0441\u0442 \u043d\u0430\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u0432 \u043e\u0442\u0442\u0435\u043d\u043a\u0430\u0445 \u0441\u0435\u0440\u043e\u0433\u043e.<\/p>\n<pre><code class=\"cpp\">float4 GetFractalColor () { \treturn unity_InstanceID * 0.001; }<\/code><\/pre>\n<p>  \u041d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0448\u0435\u0439\u0434\u0435\u0440\u0430, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432, \u043a\u0430\u043a \u043c\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u044d\u0442\u043e \u0432 <code>ConfigureProcedural<\/code>.<\/p>\n<pre><code class=\"cpp\">float4 GetFractalColor () { \t#if defined(UNITY_PROCEDURAL_INSTANCING_ENABLED) \t\treturn unity_InstanceID * 0.001; \t#endif }<\/code><\/pre>\n<p>  \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c, \u0434\u0430\u0436\u0435 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0431\u0435\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0446\u0432\u0435\u0442. \u042d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b <code>#else<\/code> \u043f\u0435\u0440\u0435\u0434 <code>#endif<\/code> \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043e\u043c \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0446\u0432\u0435\u0442\u0430.<\/p>\n<pre><code class=\"cpp\">\t#if defined(UNITY_PROCEDURAL_INSTANCING_ENABLED) \t\treturn unity_InstanceID * 0.001; \t#else \t\treturn _Color; \t#endif<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/0ba\/160\/dfc\/0ba160dfc5e395762362f65f41a6084e.png\" width=\"370\" height=\"320\"><\/div>\n<p>  <i>\u0420\u0430\u0441\u043a\u0440\u0430\u0441\u043a\u0430 \u043f\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430.<\/i><\/p>\n<p>  \u042d\u0442\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043d\u0430\u0448\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0445\u043e\u0442\u044c \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0443\u0436\u0430\u0441\u043d\u043e. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044f \u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u0436\u0434\u044b\u0435 \u043f\u044f\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043d\u0430 \u043f\u044f\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>%<\/code>. \u042d\u0442\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u044f\u0434 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0443\u044e\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c 0, 1, 2, 3, 4, 0, 1, 2, 3, 4,\u2026 \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043c \u0438\u0445 \u0432 \u0447\u0435\u0442\u044b\u0440\u0435 \u0440\u0430\u0437\u0430, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0441\u043d\u0438\u0437\u0438\u043b\u0441\u044f \u0441 0&ndash;4 \u0434\u043e 0&ndash;1.<\/p>\n<pre><code class=\"cpp\">\t\treturn (unity_InstanceID % 5.0) \/ 4.0;<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/dc8\/cab\/c34\/dc8cabc34e845945a1b9884b2dba7056.png\" width=\"370\" height=\"320\"><\/div>\n<p>  <i>\u0420\u0430\u0441\u043a\u0440\u0430\u0441\u043a\u0430 \u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0441 \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c \u043d\u0430 5.<\/i><\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0430\u044f\u0441\u044f \u0440\u0430\u0441\u043a\u0440\u0430\u0441\u043a\u0430 \u0443\u0436\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439, \u0434\u0430\u0436\u0435 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u0443\u044e \u0437\u0430\u0446\u0438\u043a\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0430. \u0417\u0430\u043c\u0435\u0442\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0432\u0441\u0435\u0433\u0434\u0430 \u0447\u0451\u0440\u043d\u044b\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. \u042d\u0442\u043e \u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0431\u044f \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0445 \u0443\u0440\u043e\u0432\u043d\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0435\u0439.<\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0430\u0442\u0442\u0435\u0440\u043d, \u043c\u0435\u043d\u044f\u044f \u0434\u043b\u0438\u043d\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432 \u0435\u0451 \u0434\u043e \u0434\u0435\u0441\u044f\u0442\u0438. \u042d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0438 \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c \u0447\u0451\u0440\u043d\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u0445\u043e\u0442\u044c \u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u0438\u0445 \u0441\u0438\u043b\u044c\u043d\u0435\u0435.<\/p>\n<pre><code class=\"cpp\">\t\treturn (unity_InstanceID % 10.0) \/ 9.0;<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/62e\/b46\/d01\/62eb46d01c1019a5cfed908d5b26340b.png\" width=\"370\" height=\"320\"><\/div>\n<p>  <i>\u0420\u0430\u0441\u043a\u0440\u0430\u0441\u043a\u0430 \u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0441 \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c \u043d\u0430 10.<\/i><\/p>\n<h3>\u0420\u044f\u0434\u044b \u0412\u0435\u0439\u043b\u044f<\/h3>\n<p>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u2014 \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u044f\u0434\u0430 \u0412\u0435\u0439\u043b\u044f. \u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e \u044d\u0442\u043e \u0440\u044f\u0434\u044b \u0432\u0438\u0434\u0430 0X \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 1 \u0441 \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c, 1X \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 1 \u0441 \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c, 2X \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 1 \u0441 \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c, 3X \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 1 \u0441 \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 0&ndash;1, \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u044f 1. \u0415\u0441\u043b\u0438 X \u2014 \u0438\u0440\u0440\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0442\u043e \u044d\u0442\u043e\u0442 \u0440\u044f\u0434 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435.<\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0430\u044f \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 X \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 0&ndash;1. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c 0.381:<\/p>\n<p>  0.000, 0.381, 0.762, 0.143, 0.524, 0.905, 0.286, 0.667, 0.048, 0.429, 0.810, 0.191, 0.572, 0.953, 0.334, 0.715, 0.096, 0.477, 0.858, 0.239, 0.620, 0.001, 0.382, 0.763, 0.144, 0.525.<\/p>\n<p>  \u0418 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u0447\u0442\u0438 \u0442\u0440\u0451\u0445\u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u044b\u0445, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u0432\u0443\u0445\u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u044b\u0445 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0438\u0445 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f. \u041f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0441\u043f\u0443\u0441\u0442\u044f 21 \u0441\u0442\u0443\u043f\u0435\u043d\u044c, \u043d\u043e \u0441\u043e \u0441\u0434\u0432\u0438\u0433\u043e\u043c \u043d\u0430 0.001. \u041f\u0440\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043b\u0438\u043d\u043d\u0435\u0435, \u043a\u043e\u0440\u043e\u0447\u0435 \u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u043c\u0438.<\/p>\n<p>  \u0412 \u0448\u0435\u0439\u0434\u0435\u0440\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0440\u044f\u0434 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>frac<\/code>.<\/p>\n<pre><code class=\"cpp\">\t\treturn frac(unity_InstanceID * 0.381);<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/e28\/175\/044\/e28175044b48f0cd584b1ab86f0f53f0.png\" width=\"370\" height=\"320\"><\/div>\n<p>  <i>\u0420\u0430\u0441\u043a\u0440\u0430\u0448\u0435\u043d\u043d\u044b\u0439 \u0440\u044f\u0434, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 0.381.<\/i><\/p>\n<h3>\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0438 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0440\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u044f\u0434\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e, \u043d\u043e \u043c\u044b \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u044d\u0442\u0438 \u0447\u0451\u0440\u043d\u044b\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b. \u041c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0438\u0445, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043a \u0440\u044f\u0434\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u0438 \u0434\u0430\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u0432\u043e\u0439 \u0440\u044f\u0434. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u0435\u043a\u0442\u043e\u0440 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0440\u044f\u0434\u0430, \u043f\u0435\u0440\u0432\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0435\u043c, \u0430 \u0432\u0442\u043e\u0440\u043e\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0438\u0445 \u0432 <code>GetFractalColor<\/code>. \u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0434\u043e \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u043e \u043a \u0440\u044f\u0434\u0443 \u0437\u0430\u0446\u0438\u043a\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0434\u0432\u0438\u0433.<\/p>\n<pre><code class=\"cpp\">float2 _SequenceNumbers;  float4 GetFractalColor () { \t#if defined(UNITY_PROCEDURAL_INSTANCING_ENABLED) \t\treturn frac(unity_InstanceID * _SequenceNumbers.x + _SequenceNumbers.y); \t#else \t\treturn _Color; \t#endif }<\/code><\/pre>\n<p>  \u0411\u0443\u0434\u0435\u043c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0432 <code>Fractal<\/code>.<\/p>\n<pre><code class=\"cpp\">\tstatic readonly int \t\tcolorId = Shader.PropertyToID(&quot;_Color&quot;), \t\tmatricesId = Shader.PropertyToID(&quot;_Matrices&quot;), \t\tsequenceNumbersId = Shader.PropertyToID(&quot;_SequenceNumbers&quot;);<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0447\u0438\u0441\u0435\u043b \u0440\u044f\u0434\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u0440\u0430\u0432\u043d\u0435\u043d\u043d\u044b\u0439 \u043a \u043d\u0430\u0448\u0435\u0439 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u043a 0.381 \u0438 0. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0438\u043f <code>Vector4<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e GPU \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0442\u044b\u0440\u0451\u0445\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.<\/p>\n<pre><code class=\"cpp\">\tVector4[] sequenceNumbers;  \tvoid OnEnable () { \t\t&hellip; \t\tsequenceNumbers = new Vector4[depth]; \t\tint stride = 12 * 4; \t\tfor (int i = 0, length = 1; i &lt; parts.Length; i++, length *= 5) { \t\t\t&hellip; \t\t\tsequenceNumbers[i] = new Vector4(0.381f, 0f); \t\t}  \t\t&hellip; \t}  \tvoid OnDisable () { \t\t&hellip; \t\tsequenceNumbers = null; \t}<\/code><\/pre>\n<p>  \u0417\u0430\u0434\u0430\u0434\u0438\u043c \u0447\u0438\u0441\u043b\u043e \u0440\u044f\u0434\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0432 \u0446\u0438\u043a\u043b\u0435 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0432 <code>Update<\/code>, \u0432\u044b\u0437\u044b\u0432\u0430\u044f <code>SetVector<\/code> \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432.<\/p>\n<pre><code class=\"cpp\">\t\t\tpropertyBlock.SetBuffer(matricesId, buffer); \t\t\tpropertyBlock.SetVector(sequenceNumbersId, sequenceNumbers[i]);<\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u044f\u0434\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u043c\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0440\u044f\u0434\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e <code>UnityEngine.Random<\/code>, \u043d\u043e \u044d\u0442\u043e\u0442 \u0442\u0438\u043f \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u0435\u0442 \u0441 <code>Unity.Mathematics.Random<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0442\u0438\u043f \u044f\u0432\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<pre><code class=\"cpp\">using quaternion = Unity.Mathematics.quaternion; using Random = UnityEngine.Random;<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0434\u0432\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043d\u0430 <code>Random.value<\/code>, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 0&ndash;1.<\/p>\n<pre><code class=\"cpp\">\t\t\tsequenceNumbers[i] = new Vector4(Random.value, Random.value);<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/908\/e64\/638\/908e64638bf947b4a46bfe4f4485a0d3.png\" width=\"370\" height=\"320\"><\/div>\n<p>  <i>\u0420\u0430\u0441\u043a\u0440\u0430\u0448\u0435\u043d\u043d\u044b\u0435 \u0440\u044f\u0434\u044b \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f\u043c\u0438.<\/i><\/p>\n<h3>\u0414\u0432\u0430 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430<\/h3>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0440\u044f\u0434 \u0441 \u0438\u043c\u0435\u044e\u0449\u0438\u043c\u0441\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u043c, \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u0438 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u0430 \u0446\u0432\u0435\u0442\u0430 GPU. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043e\u0434\u043d\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0446\u0432\u0435\u0442\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0434\u043b\u044f \u0446\u0432\u0435\u0442\u043e\u0432 A \u0438 B.<\/p>\n<pre><code class=\"cpp\">\tstatic readonly int \t\tcolorAId = Shader.PropertyToID(&quot;_ColorA&quot;), \t\tcolorBId = Shader.PropertyToID(&quot;_ColorB&quot;), \t\tmatricesId = Shader.PropertyToID(&quot;_Matrices&quot;), \t\tsequenceNumbersId = Shader.PropertyToID(&quot;_SequenceNumbers&quot;);<\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043e\u0434\u0438\u043d \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430\u043c\u0438 A \u0438 B.<\/p>\n<pre><code class=\"cpp\">\t[SerializeField] \tGradient gradientA = default, gradientB = default;<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c \u043e\u0431\u0430 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u0432 \u0446\u0438\u043a\u043b\u0435 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 <code>Update<\/code> \u0438 \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0438\u0445 \u0446\u0432\u0435\u0442\u0430.<\/p>\n<pre><code class=\"cpp\">\t\t\tfloat gradientInterpolator = i \/ (matricesBuffers.Length - 1f); \t\t\tpropertyBlock.SetColor(colorAId, gradientA.Evaluate(gradientInterpolator)); \t\t\tpropertyBlock.SetColor(colorBId, gradientB.Evaluate(gradientInterpolator));<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/99e\/df6\/dfc\/99edf6dfc9ebdd41053d491c93eac85c.png\" width=\"320\" height=\"62\"><\/div>\n<p>  <i>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u0432\u0443\u0445 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u0432.<\/i><\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0432 <em>FractalGPU<\/em> \u043d\u0430 \u0434\u0432\u0430.<\/p>\n<pre><code class=\"cpp\">\/\/float4 _Color; float4 _ColorA, _ColorB;<\/code><\/pre>\n<p>  \u0418 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044e \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0432 <code>GetFractalColor<\/code> \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>lerp<\/code>, \u0432\u0437\u044f\u0432 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0442\u043e\u0440\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u044f\u0434\u0430.<\/p>\n<pre><code class=\"cpp\">\t\treturn lerp( \t\t\t_ColorA, _ColorB, \t\t\tfrac(unity_InstanceID * _SequenceNumbers.x + _SequenceNumbers.y) \t\t);<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u044f <code>#else<\/code> \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0446\u0432\u0435\u0442 A.<\/p>\n<pre><code class=\"cpp\">\t#else \t\treturn _ColorA; \t#endif<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/bd0\/699\/2a8\/bd06992a8fa098603b77ca120792625d.png\" width=\"370\" height=\"320\"><\/div>\n<p>  <i>\u0420\u0430\u0441\u043a\u0440\u0430\u0441\u043a\u0430 \u0434\u0432\u0443\u043c\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430\u043c\u0438.<\/i><\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0438\u0437 \u0434\u0432\u0443\u0445 \u0446\u0432\u0435\u0442\u043e\u0432 \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440, \u0430 \u0441\u043c\u0435\u0448\u0435\u043d\u0438\u0435\u043c.<\/p>\n<h2>\u041b\u0438\u0441\u0442\u044c\u044f<\/h2>\n<p>  \u0420\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0442\u0435\u043d\u0438\u0439 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0445 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u041f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u044d\u0442\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043b\u0438\u0441\u0442\u044c\u044f, \u0446\u0432\u0435\u0442\u044b \u0438 \u0444\u0440\u0443\u043a\u0442\u044b. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043d\u0430\u0448 \u0444\u0440\u0430\u043a\u0442\u0430\u043b, \u0441\u0434\u0435\u043b\u0430\u0432 \u0441\u0430\u043c\u044b\u0439 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0449\u0438\u043c\u0441\u044f \u043e\u0442 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u043b\u0438\u0441\u0442\u044c\u0435\u0432, \u0445\u043e\u0442\u044c \u043e\u043d \u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u043b\u0438\u0441\u0442\u044c\u044f.<\/p>\n<h3>\u0426\u0432\u0435\u0442\u0430 \u043b\u0438\u0441\u0442\u044c\u0435\u0432<\/h3>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b-\u043b\u0438\u0441\u0442\u044c\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0449\u0438\u043c\u0438\u0441\u044f, \u043c\u044b \u043f\u0440\u0438\u0434\u0430\u0434\u0438\u043c \u0438\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0446\u0432\u0435\u0442. \u0425\u043e\u0442\u044c \u043c\u044b \u0438 \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0435\u0440\u0435\u0437 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442, \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0446\u0432\u0435\u0442 \u043b\u0438\u0441\u0442\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0441\u0442\u0432\u043e\u043b\u0430, \u0432\u0435\u0442\u0432\u0435\u0439 \u0438 \u043f\u043e\u0431\u0435\u0433\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u043e <code>Fractal<\/code> \u043e\u043f\u0446\u0438\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u0446\u0432\u0435\u0442\u043e\u0432 \u043b\u0438\u0441\u0442\u044c\u0435\u0432.<\/p>\n<pre><code class=\"cpp\">\t[SerializeField] \tGradient gradientA = default, gradientB = default;  \t[SerializeField] \tColor leafColorA = default, leafColorB = default;<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/cae\/527\/031\/cae527031940924b647d105b16006b0c.png\" width=\"320\" height=\"82\"><\/div>\n<p>  <i>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0446\u0432\u0435\u0442\u043e\u0432 \u043b\u0438\u0441\u0442\u044c\u0435\u0432.<\/i><\/p>\n<p>  \u0412 <code>Update<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043f\u0435\u0440\u0435\u0434 \u0446\u0438\u043a\u043b\u043e\u043c \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0438\u043d\u0434\u0435\u043a\u0441 \u043b\u0438\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0432\u0435\u043d \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443.<\/p>\n<pre><code class=\"cpp\">\t\tint leafIndex = matricesBuffers.Length - 1; \t\tfor (int i = 0; i &lt; matricesBuffers.Length; i++) { &hellip; }<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0443\u0440\u043e\u0432\u043d\u044f \u043b\u0438\u0441\u0442\u044c\u0435\u0432 \u0446\u0432\u0435\u0442\u0430, \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0440\u043e\u0432\u043d\u0435\u0439. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u043d\u0430 \u043e\u0434\u0438\u043d \u0448\u0430\u0433 \u0440\u0430\u043d\u044c\u0448\u0435, \u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0442\u043e\u0440\u0430 \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0437 \u0434\u043b\u0438\u043d\u044b \u0431\u0443\u0444\u0435\u0440\u0430 \u043d\u0435 1, \u0430 2.<\/p>\n<pre><code class=\"cpp\">\t\t\tColor colorA, colorB; \t\t\tif (i == leafIndex) { \t\t\t\tcolorA = leafColorA; \t\t\t\tcolorB = leafColorB; \t\t\t} \t\t\telse { \t\t\t\tfloat gradientInterpolator = i \/ (matricesBuffers.Length - 2f); \t\t\t\tcolorA = gradientA.Evaluate(gradientInterpolator); \t\t\t\tcolorB = gradientB.Evaluate(gradientInterpolator); \t\t\t} \t\t\tpropertyBlock.SetColor(colorAId, colorA); \t\t\tpropertyBlock.SetColor(colorBId, colorB);<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/ff5\/b67\/bcd\/ff5b67bcdbcf97b3392e27b75cf979f0.png\" width=\"370\" height=\"320\"><\/div>\n<p>  <i>\u0424\u0440\u0430\u043a\u0442\u0430\u043b \u0441 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0449\u0438\u043c\u0438\u0441\u044f \u0446\u0432\u0435\u0442\u0430\u043c\u0438 \u043b\u0438\u0441\u0442\u044c\u0435\u0432.<\/i><\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u044d\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0441 \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0433\u043b\u0443\u0431\u0438\u043d\u0443 \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0430.<\/p>\n<pre><code class=\"cpp\">\t[SerializeField, Range(3, 8)] \tint depth = 4;<\/code><\/pre>\n<p>  <\/p>\n<h3>\u041c\u0435\u0448 \u043b\u0438\u0441\u0442\u0430<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u0430\u043c\u044b\u0439 \u043d\u0438\u0436\u043d\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0435\u0433\u043e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0435\u0448. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043b\u0438\u0441\u0442\u044c\u0435\u0432 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0443\u0431, \u0432\u0435\u0434\u044c \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0444\u0435\u0440\u044b.<\/p>\n<pre><code class=\"cpp\">\t[SerializeField] \tMesh mesh = default, leafMesh = default;<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/bc3\/084\/946\/bc308494603d868f965542d17957f5c9.png\" width=\"320\" height=\"40\"><\/div>\n<p>  <i>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0443 \u043c\u0435\u0448\u0430 \u043b\u0438\u0441\u0442\u0430 \u0437\u0430\u0434\u0430\u043d \u043a\u0443\u0431.<\/i><\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043c\u0435\u0448 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>Graphics.DrawMeshInstancedProcedural<\/code> \u0432 <code>Update<\/code>.<\/p>\n<pre><code class=\"cpp\">\t\t\tMesh instanceMesh; \t\t\tif (i == leafIndex) { \t\t\t\tcolorA = leafColorA; \t\t\t\tcolorB = leafColorB; \t\t\t\tinstanceMesh = leafMesh; \t\t\t} \t\t\telse { \t\t\t\tfloat gradientInterpolator = i \/ (matricesBuffers.Length - 2f); \t\t\t\tcolorA = gradientA.Evaluate(gradientInterpolator); \t\t\t\tcolorB = gradientB.Evaluate(gradientInterpolator); \t\t\t\tinstanceMesh = mesh; \t\t\t} \t\t\t&hellip; \t\t\tGraphics.DrawMeshInstancedProcedural( \t\t\t\tinstanceMesh, 0, material, bounds, buffer.count, propertyBlock \t\t\t);<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/4bb\/6f8\/313\/4bb6f831349bc66eaea9ef02f23e2658.png\" width=\"370\" height=\"320\"><\/div>\n<p>  <i>\u041a\u0443\u0431\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043b\u0438\u0441\u0442\u044c\u0435\u0432.<\/i><\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0443\u0431\u043e\u0432 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043b\u0438\u0441\u0442\u044c\u0435\u0432 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u0442\u0435\u043f\u0435\u0440\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0443\u0431\u0430\u043c\u0438.<\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>\u0413\u043b\u0443\u0431\u0438\u043d\u0430<\/th>\n<th>URP<\/th>\n<th>DRP<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>6<\/td>\n<td>430<\/td>\n<td>142<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>140<\/td>\n<td>91<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>49<\/td>\n<td>31<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  <\/p>\n<h3>Smoothness<\/h3>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0446\u0432\u0435\u0442\u0430 \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u0434\u0430\u0442\u044c \u043b\u0438\u0441\u0442\u044c\u044f\u043c \u0434\u0440\u0443\u0433\u0443\u044e \u0448\u0435\u0440\u043e\u0445\u043e\u0432\u0430\u0442\u043e\u0441\u0442\u044c (smoothness). \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0430\u0440\u044c\u0438\u0440\u043e\u0432\u0430\u0442\u044c smoothness \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0432\u0430\u0440\u044c\u0438\u0440\u0443\u0435\u043c \u0446\u0432\u0435\u0442, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u044f\u0434\u0430. \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u044f\u0434 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432 <code>OnEnable<\/code> \u0434\u0432\u0430 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0447\u0438\u0441\u0435\u043b \u0440\u044f\u0434\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<pre><code class=\"cpp\">\t\t\tsequenceNumbers[i] = new Vector4( \t\t\t\tRandom.value, Random.value, Random.value, Random.value \t\t\t);<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u043d\u0430\u043b\u044b RGB \u0438 A \u0432 <code>GetFractalColor<\/code> \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0432\u0443\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u044f \u043a\u0430\u043d\u0430\u043b\u0430 A.<\/p>\n<pre><code class=\"cpp\">float4 _SequenceNumbers;  float4 GetFractalColor () { \t#if defined(UNITY_PROCEDURAL_INSTANCING_ENABLED) \t\t\tfloat4 color; \t\tcolor.rgb = lerp( \t\t\t_ColorA.rgb, _ColorB.rgb, \t\t\tfrac(unity_InstanceID * _SequenceNumbers.x + _SequenceNumbers.y) \t\t); \t\tcolor.a = lerp( \t\t\t_ColorA.a, _ColorB.a, \t\t\tfrac(unity_InstanceID * _SequenceNumbers.z + _SequenceNumbers.w) \t\t); \t\treturn color; \t#else \t\treturn _Color; \t#endif }<\/code><\/pre>\n<p>  \u041c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043d\u0430\u043b A \u0446\u0432\u0435\u0442\u0430 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f smoothness, \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u0438. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0433\u0440\u0430\u0444\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u043e\u0434 <em>Split<\/em> \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0430\u043b\u044c\u0444\u0430-\u043a\u0430\u043d\u0430\u043b\u0430 \u0438\u0437 <em>FractalColor<\/em> \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0435\u0433\u043e \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 smoothness. \u0417\u0430\u0442\u0435\u043c \u0443\u0434\u0430\u043b\u0438\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e smoothness \u0438\u0437 blackboard.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/164\/00f\/d41\/16400fd41402686b70f4bec7304ee5d9.png\" width=\"510\" height=\"170\"><\/div>\n<p>  <i>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f smoothness.<\/i><\/p>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e\u043c \u0448\u0435\u0439\u0434\u0435\u0440\u0435.<\/p>\n<pre><code class=\"cpp\">\t\tvoid ConfigureSurface (Input input, inout SurfaceOutputStandard surface) { \t\t\tsurface.Albedo = GetFractalColor().rgb; \t\t\tsurface.Smoothness = GetFractalColor().a; \t\t}<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043b\u0438 \u043c\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 GetFractalColor?<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u0414\u0430, \u043d\u043e \u043c\u044b \u0443\u0436\u0435 \u0438 \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0451\u0442 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432, \u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0430 C#.<\/div>\n<\/p><\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0437 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0432\u0435\u0441\u044c \u0431\u043b\u043e\u043a <code>Properties<\/code>.<\/p>\n<pre><code class=\"cpp\">\t\/\/Properties { \t\t\/\/_Smoothness (&quot;Smoothness&quot;, Range(0,1)) = 0.5 \t\/\/}<\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u044c\u0444\u0430-\u043a\u0430\u043d\u0430\u043b \u0446\u0432\u0435\u0442\u0430 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f smoothness, \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0446\u0432\u0435\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044f \u0437\u0430\u0434\u0430\u043b smoothness \u043b\u0438\u0441\u0442\u0430 \u0440\u0430\u0432\u043d\u043e\u0439 50% \u0438 90%. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e smoothness \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0446\u0432\u0435\u0442\u0430, \u0445\u043e\u0442\u044f \u043e\u043d\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0434\u043d\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e. \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043a\u0430\u043d\u0430\u043b\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/e7f\/b3c\/c55\/e7fb3cc55037850eb1b959bf1ef5926c.png\" width=\"320\" height=\"40\" alt=\"inspector\"><\/div>\n<p>  <\/p>\n<div class=\"oembed\"><iframe allowfullscreen id=\"6034aa4095bc5d2dedbee17b\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/6034aa4095bc5d2dedbee17b\"><\/iframe><\/div>\n<p>  <i>\u0427\u0451\u0440\u043d\u044b\u0435 \u043b\u0438\u0441\u0442\u044c\u044f \u0441 \u0432\u0430\u0440\u044c\u0438\u0440\u0443\u0435\u043c\u043e\u0439 smoothness.<\/i><\/p>\n<p>  \u0422\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u0441 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430\u043c\u0438, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e 100% \u0430\u043b\u044c\u0444\u044b. \u042f \u0437\u0430\u0434\u0430\u043b \u0438\u043c 80&ndash;90 \u0438 140&ndash;160 \u0438\u0437 255. \u0422\u0430\u043a\u0436\u0435 \u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0446\u0432\u0435\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0444\u0440\u0430\u043a\u0442\u0430\u043b \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0445\u043e\u0434\u0438\u043b \u043d\u0430 \u0434\u0435\u0440\u0435\u0432\u043e.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/bad\/2c4\/876\/bad2c48768533d1c0870b4998b757326.png\" width=\"320\" height=\"82\" alt=\"inspector\"><\/div>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/07c\/89c\/d0a\/07c89cd0a3f0ada1383d0b104f28ee01.png\" width=\"370\" height=\"320\" alt=\"fractal\"><\/div>\n<p>  <i>\u0424\u0440\u0430\u043a\u0442\u0430\u043b \u0440\u0430\u0441\u043a\u0440\u0430\u0448\u0435\u043d \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0440\u0430\u0441\u0442\u0435\u043d\u0438\u0435.<\/i><\/p>\n<p>  \u042d\u0444\u0444\u0435\u043a\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u0435\u043d, \u043a\u043e\u0433\u0434\u0430 \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u043d\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/095\/349\/4e5\/0953494e5dc335d89c84daab768024e3.png\" width=\"370\" height=\"320\"><\/div>\n<p>  <i>\u0422\u0430 \u0436\u0435 \u0440\u0430\u0441\u043a\u0440\u0430\u0441\u043a\u0430 \u0441 \u0433\u043b\u0443\u0431\u0438\u043d\u043e\u0439 8.<\/i><\/p>\n<h2>\u041f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u0435\u0442\u0432\u0435\u0439<\/h2>\n<p>  \u0425\u043e\u0442\u044f \u043d\u0430\u0448 \u0444\u0440\u0430\u043a\u0442\u0430\u043b \u0443\u0436\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u043d\u0435\u0435, \u044d\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0435\u0433\u043e \u0440\u0430\u0441\u043a\u0440\u0430\u0441\u043a\u0435. \u0415\u0433\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0436\u0451\u0441\u0442\u043a\u0430\u044f \u0438 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u0430\u044f. \u041f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u044d\u0442\u043e \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043a\u043e\u0433\u0434\u0430 \u043e\u043a\u043d\u043e \u0441\u0446\u0435\u043d\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043e\u0440\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u0430 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0432 <code>Update<\/code> \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043d\u0430 \u043d\u043e\u043b\u044c. <\/p>\n<pre><code class=\"cpp\">\t\tfloat spinAngleDelta = 0.125f * PI * Time.deltaTime * 0f;<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f0a\/fc3\/f0e\/f0afc3f0e816f0bbf84d133c395b6d19.png\" width=\"360\" height=\"280\"><\/div>\n<p>  <i>\u0418\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0436\u0451\u0441\u0442\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430.<\/i><\/p>\n<p>  \u041e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043d\u0435\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u043d\u0435\u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u043e\u0441\u0442\u0430, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0440\u0430\u0441\u0442\u0435\u043d\u0438\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u044b \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u0438. \u0412\u0441\u0451 \u0432 \u0440\u0430\u0441\u0442\u0435\u043d\u0438\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u0435\u0442 \u043f\u043e\u0434 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0432\u0435\u0441\u043e\u043c. \u0412 \u043d\u0430\u0448\u0435\u043c \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u0442, \u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u044f\u0432\u043b\u0435\u043d\u0438\u0435, \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u043a\u0430\u0436\u0434\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<h3>\u041e\u0441\u044c \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f<\/h3>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0438\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435, \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0432 \u0432\u0441\u0451 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0430\u043a\u043b\u043e\u043d\u0438\u043b\u0438\u0441\u044c \u0432\u043d\u0438\u0437. \u0422\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0432\u043e\u043a\u0440\u0443\u0433 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u0441\u0438, \u0447\u0442\u043e\u0431\u044b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0441\u044c \u0432\u0432\u0435\u0440\u0445 \u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043e\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 \u0432\u043d\u0438\u0437. \u0417\u043d\u0430\u0447\u0438\u0442, \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0432\u0432\u0435\u0440\u0445 \u043e\u0441\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u0438\u0440\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435. \u042d\u0442\u043e \u043e\u0441\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438, \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443. \u041c\u044b \u043d\u0430\u0439\u0434\u0451\u043c \u0435\u0451, \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0432 \u0432\u0435\u043a\u0442\u043e\u0440 \u0432\u0432\u0435\u0440\u0445 \u043d\u0430 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u0438\u0440\u0435. \u042d\u0442\u043e \u043d\u0430\u0434\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0431\u0435\u0437 \u0443\u0447\u0451\u0442\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0432\u0441\u0451 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0440\u043e\u0432\u043d\u043e \u0432\u043d\u0438\u0437. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 <code>Execute<\/code> \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0435\u0433\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u0432 \u043c\u0438\u0440\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u0438\u0440\u0435.<\/p>\n<pre><code class=\"cpp\">\t\tpublic void Execute (int i) { \t\t\tFractalPart parent = parents[i \/ 5]; \t\t\tFractalPart part = parts[i]; \t\t\tpart.spinAngle += spinAngleDelta;  \t\t\tfloat3 upAxis = \t\t\t\tmul(mul(parent.worldRotation, part.rotation), up());  \t\t\tpart.worldRotation = mul(parent.worldRotation, \t\t\t\tmul(part.rotation, quaternion.RotateY(part.spinAngle)) \t\t\t); \t\t\t&hellip; \t\t}<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u044f\u043c\u043e \u0432\u0432\u0435\u0440\u0445, \u0442\u043e \u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043e\u0441\u044c \u0432\u0432\u0435\u0440\u0445 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043e\u0441\u0438 \u0432\u0432\u0435\u0440\u0445 \u043c\u0438\u0440\u0430. \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u043e\u0442 \u043c\u0438\u0440\u043e\u0432\u043e\u0439 \u043e\u0441\u0438 \u0432\u0432\u0435\u0440\u0445 \u043a \u043e\u0441\u0438 \u0432\u0432\u0435\u0440\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0432 \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u0432\u043e\u043a\u0440\u0443\u0433 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e\u0439 \u043e\u0441\u0438. \u042d\u0442\u0443 \u043e\u0441\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u043e\u0441\u044c\u044e \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438, \u0432\u0437\u044f\u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u0431\u043e\u0438\u0445 \u043e\u0441\u0435\u0439 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <code>cross<\/code>.<\/p>\n<pre><code class=\"cpp\">\t\t\tfloat3 upAxis = \t\t\t\tmul(mul(parent.worldRotation, part.rotation), up()); \t\t\tfloat3 sagAxis = cross(up(), upAxis);<\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u043a\u0442\u043e\u0440, \u043f\u0435\u0440\u043f\u0435\u043d\u0434\u0438\u043a\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u043e\u0431\u043e\u0438\u043c \u0435\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c. \u0414\u043b\u0438\u043d\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u0434\u043b\u0438\u043d \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432. \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u043c\u0438 \u0432\u0435\u0442\u043e\u0440\u0430\u043c\u0438, \u0434\u043b\u0438\u043d\u0430 \u043e\u0441\u0438 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f \u0440\u0430\u0432\u043d\u0430 \u0441\u0438\u043d\u0443\u0441\u0443 \u0443\u0433\u043b\u0430 \u043c\u0435\u0436\u0434\u0443 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0439\u0442\u0438 \u043a \u043e\u0441\u0438 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0434\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c <code>normalize<\/code>.<\/p>\n<pre><code class=\"cpp\">\t\t\tfloat3 sagAxis = cross(up(), upAxis); \t\t\tsagAxis = normalize(sagAxis);<\/code><\/pre>\n<p>  <\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f, \u0432\u044b\u0437\u0432\u0430\u0432 <code>quaternion.AxisAngle<\/code> \u0441 \u043e\u0441\u044c\u044e \u0438 \u0443\u0433\u043b\u043e\u043c \u0432 \u0440\u0430\u0434\u0438\u0430\u043d\u0430\u0445. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u043d\u0430 45\u00b0, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0430 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044c \u03c0 \u0440\u0430\u0434\u0438\u0430\u043d.<\/p>\n<pre><code class=\"cpp\">\t\t\tsagAxis = normalize(sagAxis);  \t\t\tquaternion sagRotation = quaternion.AxisAngle(sagAxis, PI * 0.25f);<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0430\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u0438\u0440\u0435 \u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0430 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0435 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f. \u041c\u044b \u0432\u0432\u0435\u0434\u0451\u043c \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u043f\u043e \u043d\u043e\u0432\u043e\u043c\u0443 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044e, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0432 \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f \u043a \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0443 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u0438\u0440\u0435.<\/p>\n<pre><code class=\"cpp\">\t\t\tquaternion sagRotation = quaternion.AxisAngle(sagAxis, PI * 0.25f); \t\t\tquaternion baseRotation = mul(sagRotation, parent.worldRotation);  \t\t\tpart.worldRotation = mul(baseRotation, \t\t\t\tmul(part.rotation, quaternion.RotateY(part.spinAngle)) \t\t\t);<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/67a\/403\/cb8\/67a403cb84fad2d5b14718d6b68460b4.png\" width=\"360\" height=\"150\"><\/div>\n<p>  <i>\u0412\u0435\u0440\u0445\u0443\u0448\u043a\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442.<\/i><\/p>\n<p>  \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430, \u043d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0435\u0440\u0448\u0438\u043d\u0430 \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0430 \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442. \u0422\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u0440\u043e\u0432\u043d\u043e \u0432\u0432\u0435\u0440\u0445, \u0443\u0433\u043e\u043b \u043d\u0438\u043c \u0438 \u043c\u0438\u0440\u043e\u0432\u043e\u0439 \u043e\u0441\u044c\u044e \u0432\u0432\u0435\u0440\u0445 \u0440\u0430\u0432\u0435\u043d \u043d\u0443\u043b\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0440\u0430\u0432\u0435\u043d \u0432\u0435\u043a\u0442\u043e\u0440\u0443 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0434\u043b\u0438\u043d\u044b, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f. \u041c\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0442\u043e\u0433\u043e, \u0431\u043e\u043b\u044c\u0448\u0435 \u043b\u0438 \u043d\u0443\u043b\u044f \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f (\u0435\u0433\u043e \u0434\u043b\u0438\u043d\u0430). \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u0430\u043a, \u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435, \u0430 \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u042d\u0442\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0444\u0438\u0437\u0438\u043a\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u0432\u0432\u0435\u0440\u0445, \u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0441\u0438\u0438 \u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u0442\u044c.<\/p>\n<p>  \u0414\u043b\u0438\u043d\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u0430, \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u043a\u0430\u043a \u0435\u0433\u043e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>length<\/code>. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u0443\u044e \u0434\u043b\u0438\u043d\u0443, \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0432 \u0435\u0433\u043e \u043d\u0430 \u0435\u0433\u043e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443, \u0447\u0442\u043e \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 <code>normalize<\/code>.<\/p>\n<pre><code class=\"cpp\">\t\t\t\/\/sagAxis = normalize(sagAxis);  \t\t\tfloat sagMagnitude = length(sagAxis); \t\t\tquaternion baseRotation; \t\t\tif (sagMagnitude &gt; 0f) { \t\t\t\tsagAxis \/= sagMagnitude; \t\t\t\tquaternion sagRotation = quaternion.AxisAngle(sagAxis, PI * 0.25f); \t\t\t\tbaseRotation = mul(sagRotation, parent.worldRotation); \t\t\t} \t\t\telse { \t\t\t\tbaseRotation = parent.worldRotation; \t\t\t} \t\t \t\t\tpart.worldRotation = mul(baseRotation, \t\t\t\tmul(part.rotation, quaternion.RotateY(part.spinAngle)) \t\t\t);<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/bb3\/d61\/8df\/bb3d618dfde003995ef818d293a1bfd2.png\" width=\"360\" height=\"250\"><\/div>\n<p>  <i>\u0412\u0435\u0440\u0448\u0438\u043d\u0430 \u0435\u0441\u0442\u044c, \u043d\u043e \u0434\u0435\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f.<\/i><\/p>\n<p>  \u0424\u0440\u0430\u043a\u0442\u0430\u043b \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0434\u0435\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d, \u043f\u043e\u0442\u043e\u043c \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0434\u0432\u0430\u0436\u0434\u044b. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0438 \u0438 \u043f\u043e\u0437\u0436\u0435, \u043a\u043e\u0433\u0434\u0430 \u0441\u043c\u0435\u0449\u0430\u0435\u043c \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f, \u0430 \u043f\u043e\u0442\u043e\u043c \u043a\u043e\u0433\u0434\u0430 \u0441\u043c\u0435\u0449\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u043e, \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u0434\u043e\u043b\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0441\u0438 \u0432\u0432\u0435\u0440\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n<pre><code class=\"cpp\">\t\t\tpart.worldPosition = \t\t\t\tparent.worldPosition + \t\t\t\t\/\/mul(parent.worldRotation, (1.5f * scale * part.direction)); \t\t\t\tmul(part.worldRotation, float3(0f, 1.5f * scale, 0f));<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/ed5\/e68\/98b\/ed5e6898b9ae63544abe043f59683848.png\" width=\"360\" height=\"320\"><\/div>\n<p>  <i>\u0420\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0435 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0430 45\u00b0.<\/i><\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043d\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0430\u0434\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0435\u0441\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 \u043d\u0438\u043c \u043a\u043e\u0434.<\/p>\n<pre><code class=\"cpp\">\tstruct FractalPart { \t\t\/\/public float3 direction, worldPosition; \t\tpublic float3 worldPosition; \t\tpublic quaternion rotation, worldRotation; \t\tpublic float spinAngle; \t} \t \t&hellip;  \t\/\/static float3[] directions = { \t\/\/\tup(), right(), left(), forward(), back() \t\/\/};  \t&hellip;  \tFractalPart CreatePart (int childIndex) { \t\treturn new FractalPart { \t\t\t\/\/direction = directions[childIndex], \t\t\trotation = rotations[childIndex] \t\t}; \t}<\/code><\/pre>\n<p>  <\/p>\n<h3>\u041c\u043e\u0434\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435<\/h3>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0435, \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0432\u0430\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0435\u0433\u043e, \u043a\u043e\u0433\u0434\u0430 \u0444\u0440\u0430\u043a\u0442\u0430\u043b \u0432 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0441\u043d\u043e\u0432\u0430 \u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f.<\/p>\n<pre><code class=\"cpp\">\t\tfloat spinAngleDelta = 0.125f * PI * Time.deltaTime; \/\/ * 0f;<\/code><\/pre>\n<p>  <\/p>\n<div class=\"oembed\"><iframe allowfullscreen id=\"6034eb16aa2e6ed27439f9ef\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/6034eb16aa2e6ed27439f9ef\"><\/iframe><\/div>\n<p>  <i>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435.<\/i><\/p>\n<p>  \u0412 \u0446\u0435\u043b\u043e\u043c \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041a\u0430\u043a\u043e\u0439 \u0431\u044b \u043d\u0438 \u0431\u044b\u043b\u0430 \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0433\u043e \u0442\u044f\u043d\u0435\u0442 \u0432\u043d\u0438\u0437. \u041d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f. \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u0443\u0433\u043e\u043b \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u2014 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u0442\u044c \u0432 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0438\u043b\u0438 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438, \u0438\u043b\u0438 \u043d\u0435 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0432\u0441\u0435\u043c. \u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0447\u0442\u0438 \u043f\u0440\u044f\u043c\u043e \u0432\u043d\u0438\u0437, \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u044f \u0438\u0445 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0432\u0432\u0435\u0440\u0445.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0435\u043b\u0430 \u043e\u0442 \u0443\u0433\u043b\u0430 \u043c\u0435\u0436\u0434\u0443 \u043e\u0441\u044c\u044e \u0432\u0432\u0435\u0440\u0445 \u043c\u0438\u0440\u0430 \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u0415\u0441\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043f\u043e\u0447\u0442\u0438 \u0440\u043e\u0432\u043d\u043e \u0432\u0432\u0435\u0440\u0445 \u0438\u043b\u0438 \u0432\u043d\u0438\u0437, \u0442\u043e \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c, \u0430 \u0435\u0441\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043f\u043e\u0434 \u0443\u0433\u043b\u043e\u043c 90\u00b0, \u0442\u043e \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c. \u0421\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f \u0438 \u0443\u0433\u043b\u043e\u043c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0434\u0430\u0451\u0442 \u0441\u0438\u043d\u0443\u0441 \u0443\u0433\u043b\u0430. \u042d\u0442\u043e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0451 \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u044f\u0446\u0438\u0438 \u0443\u0433\u043b\u0430 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"cpp\">\t\t\t\tquaternion sagRotation = \t\t\t\t\tquaternion.AxisAngle(sagAxis, PI * 0.25f * sagMagnitude);<\/code><\/pre>\n<p>  <\/p>\n<div class=\"oembed\"><iframe allowfullscreen id=\"6034eb177c24d22e1e99f9c9\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/6034eb177c24d22e1e99f9c9\"><\/iframe><\/div>\n<p>  <i>\u041c\u043e\u0434\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435.<\/i><\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043c\u0438\u0440\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u043d\u0430 \u043d\u0435\u0433\u043e \u0432\u043b\u0438\u044f\u0435\u0442 \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0432\u0441\u0435\u0433\u043e \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0432 game object \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0430, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u0442\u044c \u0438 \u0432\u0435\u0440\u0445\u0443\u0448\u043a\u0443.<\/p>\n<div class=\"oembed\"><iframe allowfullscreen id=\"6034eb1896f977d25608ba63\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/6034eb1896f977d25608ba63\"><\/iframe><\/div>\n<p>  <i>\u0424\u0440\u0430\u043a\u0442\u0430\u043b, \u043f\u043e\u0432\u0451\u0440\u043d\u0443\u0442\u044b\u0439 \u043d\u0430 20\u00b0 \u043f\u043e \u043e\u0441\u0438 Z.<\/i><\/p>\n<h3>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0443\u0433\u043e\u043b \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0443\u0433\u043e\u043b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u043c, \u0441\u043d\u043e\u0432\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u0440\u0430\u0441\u043a\u0440\u044b\u0432 \u0434\u0432\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430. \u0414\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044d\u0442\u0438\u0445 \u0443\u0433\u043b\u043e\u0432 \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0433\u0440\u0430\u0434\u0443\u0441\u0430\u043c\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u043b\u0435\u0433\u0447\u0435, \u0447\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0434\u0438\u0430\u043d\u044b.<\/p>\n<pre><code class=\"cpp\">\t[SerializeField] \tColor leafColorA = default, leafColorB = default;  \t[SerializeField, Range(0f, 90f)] \tfloat maxSagAngleA = 15f, maxSagAngleB = 25f;<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/221\/123\/69c\/22112369c3c89e8c910ca46a79d47976.png\" width=\"320\" height=\"82\"><\/div>\n<p>  <i>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0433\u043b\u044b \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f.<\/i><\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0443\u0433\u043e\u043b \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f \u0432 <code>FractalPart<\/code> \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u0432 <code>CreatePart<\/code> \u0432\u044b\u0437\u043e\u0432\u043e\u043c <code>Random.Range<\/code> \u0441 \u0434\u0432\u0443\u043c\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0443\u0433\u043b\u0430\u043c\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0434\u0438\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>radians<\/code>.<\/p>\n<pre><code class=\"cpp\">\tstruct FractalPart { \t\tpublic float3 worldPosition; \t\tpublic quaternion rotation, worldRotation; \t\tpublic float maxSagAngle, spingAngle; \t}  \t&hellip;  \tFractalPart CreatePart (int childIndex) { \t\treturn new FractalPart { \t\t\tmaxSagAngle = radians(Random.Range\u20ac(maxSagAngleA, maxSagAngleB)), \t\t\trotation = rotations[childIndex] \t\t}; \t}<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438 \u0443\u0433\u043e\u043b A \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0443\u0433\u043b\u0430 B?<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u0425\u043e\u0442\u044c \u044d\u0442\u043e \u0438 \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043d\u043e \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u041c\u0435\u0442\u043e\u0434 <code>Random.Range<\/code> \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0435\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438.<\/div>\n<\/p><\/div>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 <code>Execute<\/code> \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0443\u0433\u043e\u043b \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 45\u00b0.<\/p>\n<pre><code class=\"cpp\">\t\t\t\tquaternion sagRotation = \t\t\t\t\tquaternion.AxisAngle(sagAxis, part.maxSagAngle * sagMagnitude)<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/295\/324\/492\/2953244927fa9409eeb5e4433479ae3e.png\" width=\"290\" height=\"320\"><\/div>\n<p>  <i>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0443\u0433\u043e\u043b \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f 15&ndash;25, \u0433\u043b\u0443\u0431\u0438\u043d\u0430 8.<\/i><\/p>\n<h2>\u0412\u0440\u0430\u0449\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u041c\u044b \u0443\u0436\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043d\u0430\u0448 \u0444\u0440\u0430\u043a\u0442\u0430\u043b \u0442\u0430\u043a, \u0447\u0442\u043e \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044e.<\/p>\n<h3>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c<\/h3>\n<p>  \u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0443\u0433\u043b\u043e\u043c \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u044f, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u043f\u0446\u0438\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0435\u0439 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f, \u0437\u0430\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0432 \u0433\u0440\u0430\u0434\u0443\u0441\u0430\u0445 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. \u042d\u0442\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u044b\u043c\u0438 \u0438\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0443\u043b\u044f.<\/p>\n<pre><code class=\"cpp\">\t[SerializeField, Range(0f, 90f)] \tfloat maxSagAngleA = 15f, maxSagAngleB = 25f;  \t[SerializeField, Range(0f, 90f)] \tfloat spinVelocityA = 20f, spinVelocityB = 25f;<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/de4\/182\/dfe\/de4182dfe792443c17976afc35cabbe3.png\" width=\"320\" height=\"82\"><\/div>\n<p>  <i>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f.<\/i><\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 <code>FractalPart<\/code> \u043f\u043e\u043b\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u0432 <code>CreatePart<\/code>.<\/p>\n<pre><code class=\"cpp\">\tstruct FractalPart { \t\tpublic float3 worldPosition; \t\tpublic quaternion rotation, worldRotation; \t\tpublic float maxSagAngle, spinAngle, spinVelocity; \t}  \t&hellip;  \tFractalPart CreatePart (int childIndex) { \t\treturn new FractalPart { \t\t\tmaxSagAngle = radians(Random.Range\u20ac(maxSagAngleA, maxSagAngleB)), \t\t\trotation = rotations[childIndex], \t\t\tspinVelocity = radians(Random.Range\u20ac(spinVelocityA, spinVelocityB)) \t\t}; \t}<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0438\u0437\u0431\u0430\u0432\u0438\u043c\u0441\u044f \u043e\u0442 \u043f\u043e\u043b\u044f \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0439 \u0434\u0435\u043b\u044c\u0442\u044b \u0443\u0433\u043b\u0430 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0432 <code>UpdateFractalLevelJob<\/code>, \u0437\u0430\u043c\u0435\u043d\u0438\u0432 \u0435\u0451 \u043f\u043e\u043b\u0435\u043c \u0434\u0435\u043b\u044c\u0442\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0417\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 <code>Execute<\/code>.<\/p>\n<pre><code class=\"cpp\">\t\t\/\/public float spinAngleDelta; \t\tpublic float scale; \t\tpublic float deltaTime;  \t\t&hellip; \t\t \t\tpublic void Execute (int i) { \t\t\tFractalPart parent = parents[i \/ 5]; \t\t\tFractalPart part = parts[i]; \t\t\tpart.spinAngle += part.spinVelocity * deltaTime;  \t\t\t&hellip; \t\t}<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043c <code>Update<\/code> \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432 \u043d\u0451\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u0430\u044f \u0434\u0435\u043b\u044c\u0442\u0430 \u0443\u0433\u043b\u0430 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0451 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0430\u0441\u044c \u0434\u0435\u043b\u044c\u0442\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<pre><code class=\"cpp\">\t\t\/\/float spinAngleDelta = 0.125f * PI * Time.deltaTime; \t\tfloat deltaTime = Time.deltaTime; \t\tFractalPart rootPart = parts[0][0]; \t\trootPart.spinAngle += rootPart.spinVelocity * deltaTime; \t\t&hellip; \t\tfor (int li = 1; li &lt; parts.Length; li++) { \t\t\tscale *= 0.5f; \t\t\tjobHandle = new UpdateFractalLevelJob { \t\t\t\t\/\/spinAngleDelta = spinAngleDelta, \t\t\t\tdeltaTime = deltaTime, \t\t\t\t&hellip; \t\t\t}.ScheduleParallel(parts[li].Length, 5, jobHandle); \t\t}<\/code><\/pre>\n<p>  <\/p>\n<div class=\"oembed\"><iframe allowfullscreen id=\"60356b89189a112e083e61ae\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60356b89189a112e083e61ae\"><\/iframe><\/div>\n<p>  <i>\u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u0430\u044f \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 \u043e\u0442 0 \u0434\u043e 90 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f.<\/i><\/p>\n<h3>\u041e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043c\u0435\u043d\u0443 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0435\u0439 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435, \u0438 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u0442\u043e \u0434\u0432\u0430 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u043d\u0430\u043a\u0438. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043d\u043e\u043b\u044c \u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u0438\u0437\u043a\u0438\u0445 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0435\u0439. \u041d\u0435\u043b\u044c\u0437\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0444\u0440\u0430\u043a\u0442\u0430\u043b \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0435\u0433\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 20&ndash;25, \u043d\u043e \u0441 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438\u043b\u0438 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0437\u043d\u0430\u043a\u043e\u043c.<\/p>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0435\u043c velocity \u0432 speed, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0417\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u043e\u043f\u0446\u0438\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u0432\u0438\u0434\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 0&ndash;1.<\/p>\n<pre><code class=\"cpp\">\t[SerializeField, Range(0f, 90f)] \tfloat spinSpeedA = 20f, spinSpeedB = 25f;  \t[SerializeField, Range(0f, 1f)] \tfloat reverseSpinChance = 0.25f; \t \t&hellip;  \tFractalPart CreatePart (int childIndex) { \t\treturn new FractalPart { \t\t\tmaxSagAngle = radians(Random.Range(maxSagAngleA, maxSagAngleB)), \t\t\trotation = rotations[childIndex], \t\t\tspinVelocity = radians(Random.Range(spinSpeedA, spinSpeedB)) \t\t}; \t}<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/8f4\/7c2\/a2a\/8f47c2a2acedfd6aa4f2d85d75702ed2.png\" width=\"320\" height=\"62\"><\/div>\n<p>  <i>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f.<\/i><\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0432 <code>CreatePart<\/code>, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f, \u043c\u0435\u043d\u044c\u0448\u0435 \u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u0430\u043a, \u0442\u043e \u043c\u044b \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043d\u0430 \u22121, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 1.<\/p>\n<pre><code class=\"cpp\">\t\t\tspinVelocity = \t\t\t\t(Random.value &lt; reverseSpinChance ? -1f : 1f) * \t\t\t\tradians(Random.Range(spinSpeedA, spinSpeedB))<\/code><\/pre>\n<p>  <\/p>\n<div class=\"oembed\"><iframe allowfullscreen id=\"60356b8a8b25a4d2350c148a\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60356b8a8b25a4d2350c148a\"><\/iframe><\/div>\n<p>  <i>\u0420\u0430\u0437\u043d\u044b\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0432\u043d\u0430 45\u00b0.<\/i><\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0430 \u043c\u043e\u0433\u0443\u0442 \u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u044b\u043c\u0438. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043e\u0431\u043d\u0443\u043b\u044f\u044e\u0442 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430.<\/p>\n<h3>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h3>\n<p>  \u0417\u0430\u0432\u0435\u0440\u0448\u0438\u043c \u043c\u044b \u0441\u043d\u043e\u0432\u0430 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0451\u043d\u043d\u044b\u0445 \u043d\u0430\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u041f\u043e\u0445\u043e\u0436\u0435, \u0432\u0440\u0435\u043c\u044f update \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u043e\u0441\u044c, \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0434\u0432\u043e\u0438\u0432\u0448\u0438\u0441\u044c \u0434\u043b\u044f \u0433\u043b\u0443\u0431\u0438\u043d 6 \u0438 7, \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0448\u0438\u0441\u044c \u043d\u0430 30% \u0434\u043b\u044f \u0433\u043b\u0443\u0431\u0438\u043d\u044b 8. \u042d\u0442\u043e \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u043b\u043e \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043a\u0430\u0434\u0440\u043e\u0432 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0442\u0435\u043c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u0437\u043c\u0435\u0440\u044f\u043b\u0438 \u0435\u0451 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437.<\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>\u0413\u043b\u0443\u0431\u0438\u043d\u0430<\/th>\n<th>MS<\/th>\n<th>URP<\/th>\n<th>DRP<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>6<\/td>\n<td>0.20<\/td>\n<td>440<\/td>\n<td>142<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>0.45<\/td>\n<td>144<\/td>\n<td>92<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>2.23<\/td>\n<td>49<\/td>\n<td>31<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/542026\/\"> https:\/\/habr.com\/ru\/post\/542026\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<ul>\n<li>\u0420\u0430\u0441\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0444\u0440\u0430\u043a\u0442\u0430\u043b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0433\u043b\u0443\u0431\u0438\u043d\u044b.<\/li>\n<li>\u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u0438\u0441\u0442\u044c\u044f \u0441 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0449\u0438\u043c\u0441\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0432\u0438\u0434\u043e\u043c.<\/li>\n<li>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u0432\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0430 \u043f\u043e\u0434 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u00ab\u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u0438\u00bb.<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/li>\n<\/ul>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0444\u0440\u0430\u043a\u0442\u0430\u043b \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438, \u043d\u0435\u0436\u0435\u043b\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>  \u0422\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u0441\u0434\u0435\u043b\u0430\u043d \u0432 Unity 2019.4.18f1.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/364\/36d\/8e2\/36436d8e2319555fd7f6bc06970ee30f.jpg\" width=\"512\" height=\"256\"><\/div>\n<p>  <i>\u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u043a\u0442\u0430\u043b, \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0449\u0438\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0438\u043c.<\/i><\/p>\n<h2>\u0413\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u0446\u0432\u0435\u0442\u0430<\/h2>\n<p>  \u0424\u0440\u0430\u043a\u0442\u0430\u043b, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 \u0432 <a href=\"https:\/\/catlikecoding.com\/unity\/tutorials\/basics\/jobs\/\" rel=\"nofollow noopener noreferrer\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435<\/a>, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438. \u041e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0442\u0440\u043e\u0433\u0438\u043c, \u0442\u043e\u0447\u043d\u044b\u043c, \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0438 \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u043c. \u041e\u043d \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c, \u043d\u0438 \u0436\u0438\u0432\u044b\u043c. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u043d\u0435\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u043d\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0432\u043d\u0435\u0441\u0451\u043c \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0441\u0442\u044c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0438\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u043a\u0438.<\/p>\n<p>  \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u0430 \u2014 \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0430 \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u043c \u0446\u0432\u0435\u0442\u043e\u0432, \u0438 \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0435\u0433\u043e \u043a \u0443\u0440\u043e\u0432\u043d\u044e \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-318649","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/318649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=318649"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/318649\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=318649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=318649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=318649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}