{"id":344694,"date":"2023-01-30T15:02:18","date_gmt":"2023-01-30T15:02:18","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=344694"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=344694","title":{"rendered":"<span>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432 \u0432\u043e Flutter. \u0427\u0430\u0441\u0442\u044c 1<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><em>\u041f\u0440\u0438\u0432\u0435\u0442! \u041d\u0430 \u0441\u0432\u044f\u0437\u0438 \u042e\u0440\u0438\u0439 \u041f\u0435\u0442\u0440\u043e\u0432, Flutter Team Lead \u0432 <\/em><a href=\"https:\/\/friflex.com\/?utm_source=habr_article&amp;utm_medium=link_main_rus_30012023&amp;utm_campaign=Ispolzovanie_shejderov_vo_Flutter_CHast_1\"><em>Friflex<\/em><\/a><em>. \u041c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 Flutter. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u044f \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u043e\u043f\u044b\u0442\u043e\u043c, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432 \u043d\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438 \u0441\u0442\u0438\u043b\u044c\u043d\u044b\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u044f\u0442\u0441\u044f \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0443 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c.<\/em>  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/9d7\/8f1\/b02\/9d78f1b022299cb4f4cf752ae4c97a92.jpg\" width=\"1958\" height=\"1103\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9d7\/8f1\/b02\/9d78f1b022299cb4f4cf752ae4c97a92.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u041e\u0431\u0449\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430\u0445  <\/h2>\n<p>Flutter \u2013 \u044d\u0442\u043e\u00a0\u043c\u043e\u0449\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b. \u041e\u0434\u043d\u0438\u043c \u0438\u0437\u00a0\u0432\u0430\u0436\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Flutter, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0448\u0435\u0439\u0434\u0435\u0440\u044b. \u0428\u0435\u0439\u0434\u0435\u0440\u044b\u00a0\u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u00a0GPU (\u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430) \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f\u00a0\u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u043d\u0430\u00a0\u044d\u043a\u0440\u0430\u043d\u0435. \u0428\u0435\u0439\u0434\u0435\u0440\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0430\u00a0\u044f\u0437\u044b\u043a\u0435 GLSL (OpenGL Shading Language) \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u00a0GPU. \u041e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a\u00a0\u0442\u0435\u043d\u0438, \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u044b \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b. <\/p>\n<p>\u0412\u043e\u00a0Flutter \u0443\u0436\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432. \u041e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u00a0\u043a\u043b\u0430\u0441\u0441\u0430\u0445 LinearGradient, RadialGradient, SweepGradient, ImageShader \u0438\u00a0\u0442.\u00a0\u0434. \u0414\u0430\u043d\u043d\u044b\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u044b \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438\u0437\u00a0\u044d\u0442\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u00a0\u0442\u0430\u043a\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445, \u043a\u0430\u043a\u00a0ShaderMask \u0438\u043b\u0438\u00a0CustomPaint. CustomPaint \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u00a0\u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0441\u00a0\u0448\u0435\u0439\u0434\u0435\u0440\u0430\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c CustomPainter, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0448\u0435\u0439\u0434\u0435\u0440 SweepGradient \u0434\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u043d\u0430\u00a0\u0444\u043e\u043d\u0435, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CustomPaint \u0434\u043b\u044f\u00a0\u043d\u0430\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u043d\u0430\u00a0\u043a\u0430\u043d\u0432\u0430\u0441. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CustomPaint \u0434\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043d\u0430\u00a0\u0442\u0435\u043a\u0441\u0442\u0435 \u0442\u0430\u043a\u0438\u0445, \u043a\u0430\u043a\u00a0\u0442\u0435\u043d\u0438 \u0438\u043b\u0438\u00a0\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0446\u0432\u0435\u0442\u0430. \u042d\u0442\u0438 \u0448\u0435\u0439\u0434\u0435\u0440\u044b \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0441\u00a0\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f\u00a0\u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u0441\u043f\u0435\u043a\u0442\u0440\u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432. \u0423\u043c\u0435\u043b\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432 \u0432\u043e\u00a0Flutter \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0434\u0430\u0442\u044c \u0432\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438 \u0441\u0442\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0437\u0443\u0430\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u0438\u0445 \u0441\u0440\u0435\u0434\u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445. \u0412\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u044b, \u0442\u0435\u043d\u0435\u0432\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b, \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p>\u0428\u0435\u0439\u0434\u0435\u0440\u044b\u00a0\u2014 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f\u00a0\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u044f\u0440\u043a\u0438\u0435 \u0438 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e Flutter.<\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432  <\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432\u00a0\u0440\u0430\u0431\u043e\u0442\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432, \u0434\u043b\u044f\u00a0\u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 CustomPaint. \u0412\u044b \u0443\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b\u00a0\u0431\u044b\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441\u00a0Flutter. \u042f \u043d\u0435\u00a0\u0431\u0443\u0434\u0443 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f\u00a0\u0440\u0430\u0431\u043e\u0442\u044b. <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u0442 \u043d\u0430\u00a0\u0432\u0435\u0441\u044c \u044d\u043a\u0440\u0430\u043d SweepGradient.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 \u0440\u0438\u0441\u0443\u044e\u0449\u0438\u0439 \u043d\u0430 \u0432\u0435\u0441\u044c \u044d\u043a\u0440\u0430\u043d SweepGradient<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">import 'package:flutter\/material.dart';  void main() {   runApp(MaterialApp(     home: Scaffold(         body: Center(       child: CustomPaint(painter: _MySweepPainter()),     )),   )); }  class _MySweepPainter extends CustomPainter {   _MySweepPainter();    @override   void paint(Canvas canvas, Size size) {     const rect = Rect.largest;     const gradient = SweepGradient(       colors: [Colors.red, Colors.orange, Colors.green],     );     final paint = Paint()..shader = gradient.createShader(rect);     canvas.drawRect(rect, paint);   }    @override   bool shouldRepaint(CustomPainter oldDelegate) => true; } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dce\/76e\/e5c\/dce76ee5c08319858210d1ce27faefe0.png\" width=\"738\" height=\"1600\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dce\/76e\/e5c\/dce76ee5c08319858210d1ce27faefe0.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 SweepGradient  <\/p>\n<\/div>\n<\/details>\n<p>\u0412\u00a0\u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0438\u0434\u0436\u0435\u0442 CustomPaint, \u0432\u00a0\u043d\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 _MySweepPainter. \u0417\u0434\u0435\u0441\u044c \u0445\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430\u00a0\u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430: <\/p>\n<pre><code class=\"dart\">final paint = Paint()..shader = gradient.createShader(rect); canvas.drawRect(rect, paint);<\/code><\/pre>\n<p>\u0412\u00a0\u0434\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0448\u0435\u0439\u0434\u0435\u0440 \u0438\u0437\u00a0\u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 createShader(). \u0418 \u0440\u0438\u0441\u0443\u0435\u043c \u0435\u0433\u043e \u043d\u0430\u00a0\u043a\u0430\u043d\u0432\u0430\u0441\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435\u00a0\u0431\u044b\u0441\u0442\u0440\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u044b. \u041d\u043e\u00a0\u0447\u0442\u043e\u00a0\u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440 \u0438\u043b\u0438\u00a0\u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439? <\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432  <\/h2>\n<p>\u0428\u0435\u0439\u0434\u0435\u0440\u044b\u00a0\u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043e\u0447\u0435\u043d\u044c\u00a0\u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e. \u0414\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u044f\u0437\u044b\u043a\u0430 GLSL \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u0448\u0435\u0439\u0434\u0438\u043d\u0433\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0432\u0435\u043a\u0442\u043e\u0440\u044b, \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b, \u0446\u0432\u0435\u0442\u0430 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041d\u0435\u00a0\u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0439\u0442\u0435, \u043d\u0430\u00a0\u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0441\u0435 \u043d\u0435\u00a0\u0442\u0430\u043a \u0441\u0442\u0440\u0430\u0448\u043d\u043e. <\/p>\n<p>\u041d\u0430\u00a0\u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 Flutter \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f 3,7\u00a0\u0438 Dart SDK 2,19. \u041d\u043e\u00a0\u0434\u043e\u00a0\u0432\u044b\u0445\u043e\u0434\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0448\u0435\u0439\u0434\u0435\u0440, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u00a0\u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439. <\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0448\u0435\u0439\u0434\u0435\u0440 \u043d\u0430\u00a0\u044f\u0437\u044b\u043a\u0435 glsl \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0448\u0435\u0439\u0434\u0435\u0440 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u0432\u00a0\u0444\u0430\u0439\u043b SPIR\u2011V.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b SPIR\u2011V \u0432\u043e\u00a0Flutter.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u00a0Flutter SPIR\u2011V \u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0448\u0435\u0439\u0434\u0435\u0440 \u0438\u0437\u00a0\u0440\u0430\u043d\u0435\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 SPIR\u2011V.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0448\u0435\u0439\u0434\u0435\u0440 \u0432\u00a0CustomPaint.<\/p>\n<\/li>\n<\/ol>\n<p>\u0418 \u044d\u0442\u043e\u00a0\u0431\u044b\u043b\u0430 \u0431\u043e\u043b\u044c \u0434\u043b\u044f\u00a0\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430! \u041d\u0435\u00a0\u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b glsl \u0438\u043b\u0438\u00a0spriv. \u042d\u0442\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0438 \u0442\u0440\u0443\u0434\u043e\u0437\u0430\u0442\u0440\u0430\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430. <\/p>\n<p>\u0421\u00a0\u0432\u044b\u0445\u043e\u0434\u043e\u043c Flutter 3,7\u00a0\u043c\u043d\u043e\u0433\u043e\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c.\u00a0\u0411\u044b\u043b \u043e\u0447\u0435\u043d\u044c \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043e API \u0434\u043b\u044f\u00a0\u0440\u0430\u0431\u043e\u0442\u044b \u0441\u00a0\u0448\u0435\u0439\u0434\u0435\u0440\u0430\u043c\u0438, \u0438 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435,\u00a0\u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u043e\u0432 glsl.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u0442\u0440\u0438 \u0448\u0430\u0433\u0430:<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0448\u0435\u0439\u0434\u0435\u0440 \u043d\u0430\u00a0\u044f\u0437\u044b\u043a\u0435 glsl \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0437\u00a0\u0444\u0430\u043b\u0430 glsl \u0448\u0435\u0439\u0434\u0435\u0440 (\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0432\u043e\u00a0Flutter \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c).<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u0442\u043e \u0448\u0435\u0439\u0434\u0435\u0440 \u0432\u00a0CustomPaint<\/p>\n<\/li>\n<\/ol>\n<h2>\u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0448\u0435\u0439\u0434\u0435\u0440 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 GLSL  <\/h2>\n<p>\u0414\u043b\u044f\u00a0\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c.glsl.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430:<\/p>\n<details class=\"spoiler\">\n<summary>shader.glsl <\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"elixir\">uniform float iTime; uniform vec2 iResolution; out vec4 fragColor;   void main() {     vec2 sp = gl_FragCoord.xy \/ iResolution;     vec3 color = cos(iTime + sp.xyx + vec3(0, 1, 5));     fragColor = vec4(color, 1); } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u043e\u0434 \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e: <\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c <strong>\u0432\u0445\u043e\u0434\u043d\u0443\u044e <\/strong>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>iTime<\/strong>. \u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <strong>uniform <\/strong>\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e\u00a0\u043e\u043d\u0430 \u043d\u0435\u00a0\u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u00a0\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430. <strong>Float<\/strong>\u2014 \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442\u00a0\u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u00a0\u0448\u0435\u0439\u0434\u0435\u0440 \u0438\u0437\u00a0\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Flutter.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c <strong>\u0432\u0445\u043e\u0434\u043d\u0443\u044e <\/strong>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>iResolution<\/strong>. \u042d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0442\u0438\u043f\u0430 <strong>vec2<\/strong>. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e\u00a0\u0432\u0435\u043a\u0442\u043e\u0440 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437\u00a0\u0434\u0432\u0443\u0445 \u0446\u0438\u0444\u0440. \u0421\u044e\u0434\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0434\u043b\u044f\u00a0\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u044f\u043a\u043e\u0440\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c <strong>\u0432\u044b\u0445\u043e\u0434\u043d\u0443\u044e <\/strong>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>fragColor<\/strong>. \u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0438\u0437\u00a0\u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0432\u00a0\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Flutter. \u0422\u0438\u043f \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>vec4\u00a0\u2014 \u0432\u0435\u043a\u0442\u043e\u0440 \u0438\u0437\u00a0\u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0446\u0438\u0444\u0440. <\/strong>\u0414\u0430\u043d\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0446\u0432\u0435\u0442 \u0432\u00a0RGB \u0444\u043e\u0440\u043c\u0430\u0442\u0435 + \u0430\u043b\u044c\u0444\u0430 \u043a\u0430\u043d\u0430\u043b. \u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u0435? \u041f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u043f\u0440\u0438\u00a0\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432. <\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u043f\u0443\u0441\u043a.<\/p>\n<\/li>\n<li>\n<p>\u0422\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0432\u00a0\u0448\u0435\u0439\u0434\u0435\u0440.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>sp <\/strong>\u0442\u0438\u043f\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438\u0437\u00a0\u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b,<strong> <\/strong>\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e, \u044f\u043a\u043e\u0440\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443. \u0417\u0434\u0435\u0441\u044c \u0434\u043b\u044f\u00a0\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 <strong>gl_FragCoord <\/strong>(\u0432\u0445\u043e\u0434\u0438\u0442 \u0432\u00a0\u043f\u0430\u043a\u0435\u0442 glsl)<strong>\u0438 iResolution <\/strong>(\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0438\u0437\u00a0Flutter)<strong> <\/strong>\u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0447\u0430\u0441\u0442\u043d\u043e\u0433\u043e.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>color <\/strong>\u0442\u0438\u043f\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438\u0437\u00a0\u0442\u0440\u0435\u0445 \u0447\u0438\u0441\u0435\u043b,<strong> <\/strong>\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 RGB \u0446\u0432\u0435\u0442. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0431\u0435\u0440\u0435\u043c \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0434\u043b\u044f\u00a0\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u0430 \u0443\u0433\u043b\u0430, \u0438 \u0441\u0430\u043c\u043e\u0435 \u0432\u0430\u0436\u043d\u043e\u0435 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432\u00a0\u0440\u0430\u0441\u0447\u0435\u0442 \u0432\u0445\u043e\u0434\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>iTime. <\/strong>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u00a0\u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>iTime<\/strong>\u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0440\u0430\u0441\u0447\u0435\u0442 \u0446\u0432\u0435\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>fragColor <\/strong>\u0442\u0438\u043f\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438\u0437\u00a0\u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0447\u0438\u0441\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 RGB \u0446\u0432\u0435\u0442+ \u0430\u043b\u044c\u0444\u0430 \u043a\u0430\u043d\u0430\u043b.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0430\u00a0\u044d\u0442\u043e\u043c \u0432\u0441\u0435, \u0448\u0435\u0439\u0434\u0435\u0440 \u0433\u043e\u0442\u043e\u0432! \u041d\u043e\u00a0\u044f\u00a0\u0431\u044b \u0432\u0430\u043c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a\u00a0\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0447\u0435\u0442 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f\u00a0\u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u043a\u0430\u043a\u00a0\u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u00a0GLSL.   <\/p>\n<h2>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0432\u043e Flutter  <\/h2>\n<p>\u0423\u0431\u0435\u0434\u0438\u043b\u0438\u0441\u044c, \u0447\u0442\u043e\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Flutter 3,7\u00a0\u0438 Dart SDK 2,19\u00a0\u0438\u043b\u0438\u00a0\u0432\u044b\u0448\u0435.<\/p>\n<pre><code class=\"yaml\">environment:   sdk: '>=2.19.0 &lt;3.0.0'<\/code><\/pre>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u043a\u00a0\u0432\u0430\u0448\u0435\u043c\u0443 \u0448\u0435\u0439\u0434\u0435\u0440\u0443.<\/p>\n<pre><code class=\"yaml\">... flutter:   shaders:     - shader.glsl ...<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 _MySweepPainter \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043c\u043e\u0433 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0448\u0435\u0439\u0434\u0435\u0440 \u0432\u00a0\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u0430\u043a\u00a0\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440. \u0418 \u0443\u0434\u0430\u043b\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0438\u0437\u00a0\u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430. <\/p>\n<details class=\"spoiler\">\n<summary>main.dart<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">class _MySweepPainter extends CustomPainter {   _MySweepPainter(this.shader);    final Shader shader;    @override   void paint(Canvas canvas, Size size) {     const Rect rect = Rect.largest;     final Paint paint = Paint()..shader = shader;     canvas.drawRect(rect, paint);   }    @override   bool shouldRepaint(CustomPainter oldDelegate) => true; } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0432\u0435\u0441\u044c \u043d\u0430\u0448 \u043a\u043e\u0434 \u043d\u0430\u00a0Flutter. <\/p>\n<details class=\"spoiler\">\n<summary>main.dart<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">void main() {   runApp(const MyApp()); }  class MyApp extends StatefulWidget {   const MyApp({Key? key}) : super(key: key);    @override   State&lt;MyApp> createState() => _MyAppState(); }   class _MyAppState extends State&lt;MyApp> with  TickerProviderStateMixin {   var updateTime = 0.0;    @override   void initState() {     super.initState();     createTicker((elapsed) {       updateTime = elapsed.inMilliseconds \/ 1000;       setState(() {});     }).start();   }    @override   Widget build(BuildContext context) {     return FutureBuilder&lt;FragmentProgram>(       future: _initShader(),       builder: (context, snapshot) {         if (snapshot.hasData) {           final shader = snapshot.data!.fragmentShader()             ..setFloat(0, updateTime)             ..setFloat(1, 300)             ..setFloat(2, 300);           return CustomPaint(painter: _MySweepPainter(shader));         } else {           return const Center(             child: CircularProgressIndicator(),           );         }       },     );   }    Future&lt;FragmentProgram> _initShader() {     return FragmentProgram.fromAsset(\"shader.glsl\");   } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430\u00a0\u0432\u0430\u0436\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u0445. <\/p>\n<p>  17. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>updateTime, <\/strong>\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0432\u043d\u0430 0. \u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0432\u00a0\u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u00a0\u0448\u0435\u0439\u0434\u0435\u0440 (\u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 iTime).<\/p>\n<p>  22. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0430\u0439\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>updateTime <\/strong>\u043d\u0430\u00a0\u043a\u0430\u0436\u0434\u044b\u0439 \u0446\u0438\u043a\u043b \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c \u0435\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u043d\u043e\u0433\u043e <strong>elapsed.inMilliseconds \/ 1000.<\/strong><\/p>\n<p>  30. \u0421\u043e\u0437\u0434\u0430\u0435\u043c FutureBuilder, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u0430\u00a0\u2014 \u044d\u0442\u043e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f.<\/p>\n<p>  49. \u0427\u0435\u0440\u0435\u0437 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 FragmentProgram \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0448\u0435\u0439\u0434\u0435\u0440 \u0438\u0437\u00a0\u0444\u0430\u0439\u043b\u0430 shader.glsl.<\/p>\n<p>  34. \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f Future&lt;FragmentProgram> \u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0448\u0435\u0439\u0434\u0435\u0440 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 fragmentShader() \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432\u00a0\u0448\u0435\u0439\u0434\u0435\u0440 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>updateTime <\/strong>\u0438 \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u00a0\u0448\u0435\u0439\u0434\u0435\u0440\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441\u00a0\u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>iResolution.<\/strong><\/p>\n<p>  38. \u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440 \u0432\u00a0\u043a\u043b\u0430\u0441\u0441 _MySweepPainter.<\/p>\n<p>\u0412\u00a0\u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. <\/p>\n<details class=\"spoiler\">\n<summary>\u0420\u0430\u0431\u043e\u0442\u0430 \u0448\u0435\u0439\u0434\u0435\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/63d3ce797a8d27e026048545\" data-style=\"\" id=\"63d3ce797a8d27e026048545\" width=\"\"><\/div>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0425\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u00a0\u0448\u0435\u0439\u0434\u0435\u0440\u0430\u043c\u0438? \u0416\u0434\u0443 \u0432\u0430\u0448\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432\u00a0\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445!<\/p>\n<p>\u0412\u00a0\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u043a\u0430\u043a\u00a0\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u044b \u0441\u00a0\u0441\u0430\u0439\u0442\u0430 <a href=\"https:\/\/glslsandbox.com\/\"><u>https:\/\/glslsandbox.com\/<\/u><\/a><u> <\/u>\u0438 \u043a\u0430\u043a\u00a0\u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0448\u0435\u0439\u0434\u0435\u0440\u0430\u043c\u0438 \u0438\u0437\u00a0Flutter.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \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\/company\/friflex\/blog\/713298\/\"> https:\/\/habr.com\/ru\/company\/friflex\/blog\/713298\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><em>\u041f\u0440\u0438\u0432\u0435\u0442! \u041d\u0430 \u0441\u0432\u044f\u0437\u0438 \u042e\u0440\u0438\u0439 \u041f\u0435\u0442\u0440\u043e\u0432, Flutter Team Lead \u0432 <\/em><a href=\"https:\/\/friflex.com\/?utm_source=habr_article&amp;utm_medium=link_main_rus_30012023&amp;utm_campaign=Ispolzovanie_shejderov_vo_Flutter_CHast_1\"><em>Friflex<\/em><\/a><em>. \u041c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 Flutter. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u044f \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u043e\u043f\u044b\u0442\u043e\u043c, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432 \u043d\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438 \u0441\u0442\u0438\u043b\u044c\u043d\u044b\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u044f\u0442\u0441\u044f \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0443 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c.<\/em>  <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>\u041e\u0431\u0449\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430\u0445  <\/h2>\n<p>Flutter \u2013 \u044d\u0442\u043e\u00a0\u043c\u043e\u0449\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b. \u041e\u0434\u043d\u0438\u043c \u0438\u0437\u00a0\u0432\u0430\u0436\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Flutter, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0448\u0435\u0439\u0434\u0435\u0440\u044b. \u0428\u0435\u0439\u0434\u0435\u0440\u044b\u00a0\u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u00a0GPU (\u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430) \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f\u00a0\u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u043d\u0430\u00a0\u044d\u043a\u0440\u0430\u043d\u0435. \u0428\u0435\u0439\u0434\u0435\u0440\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0430\u00a0\u044f\u0437\u044b\u043a\u0435 GLSL (OpenGL Shading Language) \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u00a0GPU. \u041e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a\u00a0\u0442\u0435\u043d\u0438, \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u044b \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b. <\/p>\n<p>\u0412\u043e\u00a0Flutter \u0443\u0436\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432. \u041e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u00a0\u043a\u043b\u0430\u0441\u0441\u0430\u0445 LinearGradient, RadialGradient, SweepGradient, ImageShader \u0438\u00a0\u0442.\u00a0\u0434. \u0414\u0430\u043d\u043d\u044b\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u044b \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438\u0437\u00a0\u044d\u0442\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u00a0\u0442\u0430\u043a\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445, \u043a\u0430\u043a\u00a0ShaderMask \u0438\u043b\u0438\u00a0CustomPaint. CustomPaint \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u00a0\u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0441\u00a0\u0448\u0435\u0439\u0434\u0435\u0440\u0430\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c CustomPainter, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0448\u0435\u0439\u0434\u0435\u0440 SweepGradient \u0434\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u043d\u0430\u00a0\u0444\u043e\u043d\u0435, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CustomPaint \u0434\u043b\u044f\u00a0\u043d\u0430\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u043d\u0430\u00a0\u043a\u0430\u043d\u0432\u0430\u0441. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CustomPaint \u0434\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043d\u0430\u00a0\u0442\u0435\u043a\u0441\u0442\u0435 \u0442\u0430\u043a\u0438\u0445, \u043a\u0430\u043a\u00a0\u0442\u0435\u043d\u0438 \u0438\u043b\u0438\u00a0\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0446\u0432\u0435\u0442\u0430. \u042d\u0442\u0438 \u0448\u0435\u0439\u0434\u0435\u0440\u044b \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0441\u00a0\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f\u00a0\u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u0441\u043f\u0435\u043a\u0442\u0440\u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432. \u0423\u043c\u0435\u043b\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432 \u0432\u043e\u00a0Flutter \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0434\u0430\u0442\u044c \u0432\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438 \u0441\u0442\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0437\u0443\u0430\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u0438\u0445 \u0441\u0440\u0435\u0434\u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445. \u0412\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u044b, \u0442\u0435\u043d\u0435\u0432\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b, \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p>\u0428\u0435\u0439\u0434\u0435\u0440\u044b\u00a0\u2014 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f\u00a0\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u044f\u0440\u043a\u0438\u0435 \u0438 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e Flutter.<\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432  <\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432\u00a0\u0440\u0430\u0431\u043e\u0442\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432, \u0434\u043b\u044f\u00a0\u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 CustomPaint. \u0412\u044b \u0443\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b\u00a0\u0431\u044b\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441\u00a0Flutter. \u042f \u043d\u0435\u00a0\u0431\u0443\u0434\u0443 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f\u00a0\u0440\u0430\u0431\u043e\u0442\u044b. <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u0442 \u043d\u0430\u00a0\u0432\u0435\u0441\u044c \u044d\u043a\u0440\u0430\u043d SweepGradient.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 \u0440\u0438\u0441\u0443\u044e\u0449\u0438\u0439 \u043d\u0430 \u0432\u0435\u0441\u044c \u044d\u043a\u0440\u0430\u043d SweepGradient<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">import 'package:flutter\/material.dart';  void main() {   runApp(MaterialApp(     home: Scaffold(         body: Center(       child: CustomPaint(painter: _MySweepPainter()),     )),   )); }  class _MySweepPainter extends CustomPainter {   _MySweepPainter();    @override   void paint(Canvas canvas, Size size) {     const rect = Rect.largest;     const gradient = SweepGradient(       colors: [Colors.red, Colors.orange, Colors.green],     );     final paint = Paint()..shader = gradient.createShader(rect);     canvas.drawRect(rect, paint);   }    @override   bool shouldRepaint(CustomPainter oldDelegate) => true; } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 SweepGradient  <\/p>\n<\/div>\n<\/details>\n<p>\u0412\u00a0\u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0438\u0434\u0436\u0435\u0442 CustomPaint, \u0432\u00a0\u043d\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 _MySweepPainter. \u0417\u0434\u0435\u0441\u044c \u0445\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430\u00a0\u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430: <\/p>\n<pre><code class=\"dart\">final paint = Paint()..shader = gradient.createShader(rect); canvas.drawRect(rect, paint);<\/code><\/pre>\n<p>\u0412\u00a0\u0434\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0448\u0435\u0439\u0434\u0435\u0440 \u0438\u0437\u00a0\u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 createShader(). \u0418 \u0440\u0438\u0441\u0443\u0435\u043c \u0435\u0433\u043e \u043d\u0430\u00a0\u043a\u0430\u043d\u0432\u0430\u0441\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435\u00a0\u0431\u044b\u0441\u0442\u0440\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u044b. \u041d\u043e\u00a0\u0447\u0442\u043e\u00a0\u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440 \u0438\u043b\u0438\u00a0\u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439? <\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432  <\/h2>\n<p>\u0428\u0435\u0439\u0434\u0435\u0440\u044b\u00a0\u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043e\u0447\u0435\u043d\u044c\u00a0\u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e. \u0414\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u044f\u0437\u044b\u043a\u0430 GLSL \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u0448\u0435\u0439\u0434\u0438\u043d\u0433\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0432\u0435\u043a\u0442\u043e\u0440\u044b, \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b, \u0446\u0432\u0435\u0442\u0430 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041d\u0435\u00a0\u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0439\u0442\u0435, \u043d\u0430\u00a0\u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0441\u0435 \u043d\u0435\u00a0\u0442\u0430\u043a \u0441\u0442\u0440\u0430\u0448\u043d\u043e. <\/p>\n<p>\u041d\u0430\u00a0\u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 Flutter \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f 3,7\u00a0\u0438 Dart SDK 2,19. \u041d\u043e\u00a0\u0434\u043e\u00a0\u0432\u044b\u0445\u043e\u0434\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0448\u0435\u0439\u0434\u0435\u0440, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u00a0\u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439. <\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0448\u0435\u0439\u0434\u0435\u0440 \u043d\u0430\u00a0\u044f\u0437\u044b\u043a\u0435 glsl \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0448\u0435\u0439\u0434\u0435\u0440 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u0432\u00a0\u0444\u0430\u0439\u043b SPIR\u2011V.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b SPIR\u2011V \u0432\u043e\u00a0Flutter.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u00a0Flutter SPIR\u2011V \u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0448\u0435\u0439\u0434\u0435\u0440 \u0438\u0437\u00a0\u0440\u0430\u043d\u0435\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 SPIR\u2011V.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0448\u0435\u0439\u0434\u0435\u0440 \u0432\u00a0CustomPaint.<\/p>\n<\/li>\n<\/ol>\n<p>\u0418 \u044d\u0442\u043e\u00a0\u0431\u044b\u043b\u0430 \u0431\u043e\u043b\u044c \u0434\u043b\u044f\u00a0\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430! \u041d\u0435\u00a0\u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b glsl \u0438\u043b\u0438\u00a0spriv. \u042d\u0442\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0438 \u0442\u0440\u0443\u0434\u043e\u0437\u0430\u0442\u0440\u0430\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430. <\/p>\n<p>\u0421\u00a0\u0432\u044b\u0445\u043e\u0434\u043e\u043c Flutter 3,7\u00a0\u043c\u043d\u043e\u0433\u043e\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c.\u00a0\u0411\u044b\u043b \u043e\u0447\u0435\u043d\u044c \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043e API \u0434\u043b\u044f\u00a0\u0440\u0430\u0431\u043e\u0442\u044b \u0441\u00a0\u0448\u0435\u0439\u0434\u0435\u0440\u0430\u043c\u0438, \u0438 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435,\u00a0\u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u043e\u0432 glsl.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u0442\u0440\u0438 \u0448\u0430\u0433\u0430:<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0448\u0435\u0439\u0434\u0435\u0440 \u043d\u0430\u00a0\u044f\u0437\u044b\u043a\u0435 glsl \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0437\u00a0\u0444\u0430\u043b\u0430 glsl \u0448\u0435\u0439\u0434\u0435\u0440 (\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0432\u043e\u00a0Flutter \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c).<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u0442\u043e \u0448\u0435\u0439\u0434\u0435\u0440 \u0432\u00a0CustomPaint<\/p>\n<\/li>\n<\/ol>\n<h2>\u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0448\u0435\u0439\u0434\u0435\u0440 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 GLSL  <\/h2>\n<p>\u0414\u043b\u044f\u00a0\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c.glsl.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430:<\/p>\n<details class=\"spoiler\">\n<summary>shader.glsl <\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"elixir\">uniform float iTime; uniform vec2 iResolution; out vec4 fragColor;   void main() {     vec2 sp = gl_FragCoord.xy \/ iResolution;     vec3 color = cos(iTime + sp.xyx + vec3(0, 1, 5));     fragColor = vec4(color, 1); } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u043e\u0434 \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e: <\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c <strong>\u0432\u0445\u043e\u0434\u043d\u0443\u044e <\/strong>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>iTime<\/strong>. \u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <strong>uniform <\/strong>\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e\u00a0\u043e\u043d\u0430 \u043d\u0435\u00a0\u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u00a0\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430. <strong>Float<\/strong>\u2014 \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442\u00a0\u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u00a0\u0448\u0435\u0439\u0434\u0435\u0440 \u0438\u0437\u00a0\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Flutter.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c <strong>\u0432\u0445\u043e\u0434\u043d\u0443\u044e <\/strong>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>iResolution<\/strong>. \u042d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0442\u0438\u043f\u0430 <strong>vec2<\/strong>. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e\u00a0\u0432\u0435\u043a\u0442\u043e\u0440 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437\u00a0\u0434\u0432\u0443\u0445 \u0446\u0438\u0444\u0440. \u0421\u044e\u0434\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0434\u043b\u044f\u00a0\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u044f\u043a\u043e\u0440\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c <strong>\u0432\u044b\u0445\u043e\u0434\u043d\u0443\u044e <\/strong>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>fragColor<\/strong>. \u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0438\u0437\u00a0\u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0432\u00a0\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Flutter. \u0422\u0438\u043f \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>vec4\u00a0\u2014 \u0432\u0435\u043a\u0442\u043e\u0440 \u0438\u0437\u00a0\u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0446\u0438\u0444\u0440. <\/strong>\u0414\u0430\u043d\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0446\u0432\u0435\u0442 \u0432\u00a0RGB \u0444\u043e\u0440\u043c\u0430\u0442\u0435 + \u0430\u043b\u044c\u0444\u0430 \u043a\u0430\u043d\u0430\u043b. \u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u0435? \u041f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u043f\u0440\u0438\u00a0\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432. <\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u043f\u0443\u0441\u043a.<\/p>\n<\/li>\n<li>\n<p>\u0422\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0432\u00a0\u0448\u0435\u0439\u0434\u0435\u0440.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>sp <\/strong>\u0442\u0438\u043f\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438\u0437\u00a0\u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b,<strong> <\/strong>\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e, \u044f\u043a\u043e\u0440\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443. \u0417\u0434\u0435\u0441\u044c \u0434\u043b\u044f\u00a0\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 <strong>gl_FragCoord <\/strong>(\u0432\u0445\u043e\u0434\u0438\u0442 \u0432\u00a0\u043f\u0430\u043a\u0435\u0442 glsl)<strong>\u0438 iResolution <\/strong>(\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0438\u0437\u00a0Flutter)<strong> <\/strong>\u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0447\u0430\u0441\u0442\u043d\u043e\u0433\u043e.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>color <\/strong>\u0442\u0438\u043f\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438\u0437\u00a0\u0442\u0440\u0435\u0445 \u0447\u0438\u0441\u0435\u043b,<strong> <\/strong>\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 RGB \u0446\u0432\u0435\u0442. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0431\u0435\u0440\u0435\u043c \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0434\u043b\u044f\u00a0\u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u0430 \u0443\u0433\u043b\u0430, \u0438 \u0441\u0430\u043c\u043e\u0435 \u0432\u0430\u0436\u043d\u043e\u0435 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432\u00a0\u0440\u0430\u0441\u0447\u0435\u0442 \u0432\u0445\u043e\u0434\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>iTime. <\/strong>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u00a0\u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>iTime<\/strong>\u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0440\u0430\u0441\u0447\u0435\u0442 \u0446\u0432\u0435\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>fragColor <\/strong>\u0442\u0438\u043f\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438\u0437\u00a0\u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0447\u0438\u0441\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 RGB \u0446\u0432\u0435\u0442+ \u0430\u043b\u044c\u0444\u0430 \u043a\u0430\u043d\u0430\u043b.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0430\u00a0\u044d\u0442\u043e\u043c \u0432\u0441\u0435, \u0448\u0435\u0439\u0434\u0435\u0440 \u0433\u043e\u0442\u043e\u0432! \u041d\u043e\u00a0\u044f\u00a0\u0431\u044b \u0432\u0430\u043c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a\u00a0\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0447\u0435\u0442 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f\u00a0\u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u043a\u0430\u043a\u00a0\u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u00a0GLSL.   <\/p>\n<h2>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0432\u043e Flutter  <\/h2>\n<p>\u0423\u0431\u0435\u0434\u0438\u043b\u0438\u0441\u044c, \u0447\u0442\u043e\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Flutter 3,7\u00a0\u0438 Dart SDK 2,19\u00a0\u0438\u043b\u0438\u00a0\u0432\u044b\u0448\u0435.<\/p>\n<pre><code class=\"yaml\">environment:   sdk: '>=2.19.0 &lt;3.0.0'<\/code><\/pre>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u043a\u00a0\u0432\u0430\u0448\u0435\u043c\u0443 \u0448\u0435\u0439\u0434\u0435\u0440\u0443.<\/p>\n<pre><code class=\"yaml\">... flutter:   shaders:     - shader.glsl ...<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 _MySweepPainter \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043c\u043e\u0433 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0448\u0435\u0439\u0434\u0435\u0440 \u0432\u00a0\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u0430\u043a\u00a0\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440. \u0418 \u0443\u0434\u0430\u043b\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0438\u0437\u00a0\u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430. <\/p>\n<details class=\"spoiler\">\n<summary>main.dart<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">class _MySweepPainter extends CustomPainter {   _MySweepPainter(this.shader);    final Shader shader;    @override   void paint(Canvas canvas, Size size) {     const Rect rect = Rect.largest;     final Paint paint = Paint()..shader = shader;     canvas.drawRect(rect, paint);   }    @override   bool shouldRepaint(CustomPainter oldDelegate) => true; } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0432\u0435\u0441\u044c \u043d\u0430\u0448 \u043a\u043e\u0434 \u043d\u0430\u00a0Flutter. <\/p>\n<details class=\"spoiler\">\n<summary>main.dart<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">void main() {   runApp(const MyApp()); }  class MyApp extends StatefulWidget {   const MyApp({Key? key}) : super(key: key);    @override   State&lt;MyApp> createState() => _MyAppState(); }   class _MyAppState extends State&lt;MyApp> with  TickerProviderStateMixin {   var updateTime = 0.0;    @override   void initState() {     super.initState();     createTicker((elapsed) {       updateTime = elapsed.inMilliseconds \/ 1000;       setState(() {});     }).start();   }    @override   Widget build(BuildContext context) {     return FutureBuilder&lt;FragmentProgram>(       future: _initShader(),       builder: (context, snapshot) {         if (snapshot.hasData) {           final shader = snapshot.data!.fragmentShader()             ..setFloat(0, updateTime)             ..setFloat(1, 300)             ..setFloat(2, 300);           return CustomPaint(painter: _MySweepPainter(shader));         } else {           return const Center(             child: CircularProgressIndicator(),           );         }       },     );   }    Future&lt;FragmentProgram> _initShader() {     return FragmentProgram.fromAsset(\"shader.glsl\");   } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430\u00a0\u0432\u0430\u0436\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u0445. <\/p>\n<p>  17. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>updateTime, <\/strong>\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0432\u043d\u0430 0. \u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0432\u00a0\u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u00a0\u0448\u0435\u0439\u0434\u0435\u0440 (\u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 iTime).<\/p>\n<p>  22. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0430\u0439\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>updateTime <\/strong>\u043d\u0430\u00a0\u043a\u0430\u0436\u0434\u044b\u0439 \u0446\u0438\u043a\u043b \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c \u0435\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u043d\u043e\u0433\u043e <strong>elapsed.inMilliseconds \/ 1000.<\/strong><\/p>\n<p>  30. \u0421\u043e\u0437\u0434\u0430\u0435\u043c FutureBuilder, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u0430\u00a0\u2014 \u044d\u0442\u043e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f.<\/p>\n<p>  49. \u0427\u0435\u0440\u0435\u0437 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 FragmentProgram \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0448\u0435\u0439\u0434\u0435\u0440 \u0438\u0437\u00a0\u0444\u0430\u0439\u043b\u0430 shader.glsl.<\/p>\n<p>  34. \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f Future&lt;FragmentProgram> \u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0448\u0435\u0439\u0434\u0435\u0440 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 fragmentShader() \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432\u00a0\u0448\u0435\u0439\u0434\u0435\u0440 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>updateTime <\/strong>\u0438 \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u00a0\u0448\u0435\u0439\u0434\u0435\u0440\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441\u00a0\u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>iResolution.<\/strong><\/p>\n<p>  38. \u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440 \u0432\u00a0\u043a\u043b\u0430\u0441\u0441 _MySweepPainter.<\/p>\n<p>\u0412\u00a0\u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. <\/p>\n<details class=\"spoiler\">\n<summary>\u0420\u0430\u0431\u043e\u0442\u0430 \u0448\u0435\u0439\u0434\u0435\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/63d3ce797a8d27e026048545\" data-style=\"\" id=\"63d3ce797a8d27e026048545\" width=\"\"><\/div>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0425\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u00a0\u0448\u0435\u0439\u0434\u0435\u0440\u0430\u043c\u0438? \u0416\u0434\u0443 \u0432\u0430\u0448\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432\u00a0\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445!<\/p>\n<p>\u0412\u00a0\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u043a\u0430\u043a\u00a0\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u044b \u0441\u00a0\u0441\u0430\u0439\u0442\u0430 <a href=\"https:\/\/glslsandbox.com\/\"><u>https:<\/u><\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-344694","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/344694","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=344694"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/344694\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=344694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=344694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=344694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}