{"id":349589,"date":"2023-06-30T09:01:06","date_gmt":"2023-06-30T09:01:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=349589"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=349589","title":{"rendered":"<span>\u041f\u0438\u0448\u0435\u043c \u0448\u0435\u0439\u0434\u0435\u0440 \u0432\u043e\u0434\u044f\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u0430 \u043d\u0430 three.js \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b 3D \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0438 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435<\/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<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/8e4\/ae1\/c1a\/8e4ae1c1abb54353be60b3cce993551b.jpg\" alt=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u043e\u0434\u044f\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u0430 \u043f\u043e\u0432\u0435\u0440\u0445 3D \u043c\u043e\u0434\u0435\u043b\u0438\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u043e\u0434\u044f\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u0430 \u043f\u043e\u0432\u0435\u0440\u0445 3D \u043c\u043e\u0434\u0435\u043b\u0438\" width=\"1280\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8e4\/ae1\/c1a\/8e4ae1c1abb54353be60b3cce993551b.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443 \u043f\u043e\u0432\u0435\u0440\u0445 3D \u0441\u0446\u0435\u043d\u044b \u0441 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c post-processing.<\/p>\n<p>\u041f\u043e\u0434 \u043d\u0430\u0448\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 TexturePass, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 CopyShader. \u0414\u0430\u043d\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0432\u0435\u0440\u0445 \u0441\u0446\u0435\u043d\u044b \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443 \u0441 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c\u044e, \u043d\u043e \u0431\u0435\u0437 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0439. \u041a\u0430\u043a \u0440\u0430\u0437 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u044b \u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0448\u0435\u0439\u0434\u0435\u0440\u0435.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 TexturePass \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0448\u0435\u0439\u0434\u0435\u0440.<\/p>\n<pre><code class=\"javascript\">class TexturePass extends Pass { \u00a0 constructor(map, opacity, shader = undefined) \u00a0 { \u00a0\u00a0\u00a0 super(); \u00a0\u00a0\u00a0 if (shader === undefined &amp;&amp; CopyShader === undefined) \u00a0\u00a0\u00a0 { \u00a0\u00a0\u00a0\u00a0\u00a0 console.error('TexturePass relies on CopyShader'); \u00a0\u00a0\u00a0 } \u00a0\u00a0\u00a0 ... \u00a0 }   ... }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 TexturePassExtend \u0438 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0435\u0433\u043e \u043e\u0442 TexturePass.<\/p>\n<pre><code class=\"javascript\">class TexturePassExtend extends TexturePass { \u00a0 constructor(map, opacity) \u00a0 { \u00a0 \u00a0\u00a0super(map, opacity, TexturePassExtendShader); \u00a0 } \u00a0 \u00a0\u00a0setRenderSize(size) \u00a0\u00a0{ \u00a0\u00a0\u00a0 if (this.map === undefined) \u00a0\u00a0\u00a0\u00a0\u00a0 return; \u00a0\u00a0\u00a0  \u00a0\u00a0\u00a0 const mapWidth = this.map.image.width; \u00a0\u00a0\u00a0 const mapHeight = this.map.image.height; \u00a0\u00a0\u00a0 const mapRatio = mapWidth \/ mapHeight; \u00a0\u00a0\u00a0  \u00a0\u00a0\u00a0 const scaleX = mapWidth \/ size.x; \u00a0\u00a0\u00a0 const scaleY = (mapWidth \/ mapRatio) \/ size.y; \u00a0\u00a0\u00a0  \u00a0 \u00a0\u00a0this.uniforms['scaleX'].value = scaleX; \u00a0 \u00a0\u00a0this.uniforms['scaleY'].value = scaleY; \u00a0\u00a0} }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 TexturePass \u043d\u0430\u0448 \u0448\u0435\u0439\u0434\u0435\u0440 TexturePassExtendShader \u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 setRenderSize \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0445\u043e\u043b\u0441\u0442\u0430 \u0441\u0446\u0435\u043d\u044b.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u043e\u0437\u044c\u043c\u0435\u043c CopyShader. \u041d\u0430\u0441 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440.<\/p>\n<pre><code class=\"javascript\">var TexturePassExtendShader = { \u00a0 \u00a0 uniforms: \u00a0\u00a0\u00a0 { \u00a0\u00a0\u00a0\u00a0\u00a0 \"tDiffuse\": {value: null}, \u00a0\u00a0\u00a0\u00a0\u00a0 \"opacity\": {value: 1.0}, \u00a0\u00a0\u00a0\u00a0\u00a0 \"scaleX\": {value: 1}, \u00a0\u00a0\u00a0\u00a0\u00a0 \"scaleY\": {value: 1} \u00a0\u00a0\u00a0 }, \u00a0 \u00a0 vertexShader: \u00a0\u00a0\u00a0 [ \u00a0\u00a0 \u00a0\u00a0\u00a0\"uniform float scaleX;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"uniform float scaleY;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"varying vec2 vUv;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"void main() {\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"\u00a0 vUv = uv;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"\u00a0 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"\u00a0 gl_Position.x *= scaleX;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"\u00a0 gl_Position.y *= scaleY;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"}\" \u00a0\u00a0\u00a0 ].join(\"\\n\"), \u00a0 \u00a0 fragmentShader: \u00a0\u00a0\u00a0 [ \u00a0\u00a0\u00a0\u00a0\u00a0 \"uniform sampler2D tDiffuse;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"uniform float opacity;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"varying vec2 vUv;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"void main() {\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"\u00a0 gl_FragColor = texture2D(tDiffuse, vUv);\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"\u00a0 gl_FragColor.a *= opacity;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"}\" \u00a0\u00a0\u00a0 ].join(\"\\n\") };<\/code><\/pre>\n<p>\u0412 \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u043e\u043c \u0448\u0435\u0439\u0434\u0435\u0440\u0435 \u043c\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b \u043f\u043e \u0448\u0438\u0440\u0438\u043d\u0435 \u0438 \u0432\u044b\u0441\u043e\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 scaleX \u0438 scaleY, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 setRenderSize \u0441 \u0446\u0435\u043b\u044c\u044e \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0439 \u043d\u0430\u0448\u0435\u0439 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043c\u043e\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u043f\u043e\u0434\u0432\u0438\u0433\u043d\u0435\u0442 \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432 GLSL.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/site3d.site\/view-configurator\/1249\/334d56b3b0cef7c55dc333f09f67f3bc\/ru\" rel=\"noopener noreferrer nofollow\">\u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/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\/articles\/744978\/\"> https:\/\/habr.com\/ru\/articles\/744978\/<\/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<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443 \u043f\u043e\u0432\u0435\u0440\u0445 3D \u0441\u0446\u0435\u043d\u044b \u0441 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c post-processing.<\/p>\n<p>\u041f\u043e\u0434 \u043d\u0430\u0448\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 TexturePass, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 CopyShader. \u0414\u0430\u043d\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0432\u0435\u0440\u0445 \u0441\u0446\u0435\u043d\u044b \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443 \u0441 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c\u044e, \u043d\u043e \u0431\u0435\u0437 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0439. \u041a\u0430\u043a \u0440\u0430\u0437 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u044b \u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0448\u0435\u0439\u0434\u0435\u0440\u0435.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 TexturePass \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0448\u0435\u0439\u0434\u0435\u0440.<\/p>\n<pre><code class=\"javascript\">class TexturePass extends Pass { \u00a0 constructor(map, opacity, shader = undefined) \u00a0 { \u00a0\u00a0\u00a0 super(); \u00a0\u00a0\u00a0 if (shader === undefined &amp;&amp; CopyShader === undefined) \u00a0\u00a0\u00a0 { \u00a0\u00a0\u00a0\u00a0\u00a0 console.error('TexturePass relies on CopyShader'); \u00a0\u00a0\u00a0 } \u00a0\u00a0\u00a0 ... \u00a0 }   ... }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 TexturePassExtend \u0438 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0435\u0433\u043e \u043e\u0442 TexturePass.<\/p>\n<pre><code class=\"javascript\">class TexturePassExtend extends TexturePass { \u00a0 constructor(map, opacity) \u00a0 { \u00a0 \u00a0\u00a0super(map, opacity, TexturePassExtendShader); \u00a0 } \u00a0 \u00a0\u00a0setRenderSize(size) \u00a0\u00a0{ \u00a0\u00a0\u00a0 if (this.map === undefined) \u00a0\u00a0\u00a0\u00a0\u00a0 return; \u00a0\u00a0\u00a0  \u00a0\u00a0\u00a0 const mapWidth = this.map.image.width; \u00a0\u00a0\u00a0 const mapHeight = this.map.image.height; \u00a0\u00a0\u00a0 const mapRatio = mapWidth \/ mapHeight; \u00a0\u00a0\u00a0  \u00a0\u00a0\u00a0 const scaleX = mapWidth \/ size.x; \u00a0\u00a0\u00a0 const scaleY = (mapWidth \/ mapRatio) \/ size.y; \u00a0\u00a0\u00a0  \u00a0 \u00a0\u00a0this.uniforms['scaleX'].value = scaleX; \u00a0 \u00a0\u00a0this.uniforms['scaleY'].value = scaleY; \u00a0\u00a0} }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 TexturePass \u043d\u0430\u0448 \u0448\u0435\u0439\u0434\u0435\u0440 TexturePassExtendShader \u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 setRenderSize \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0445\u043e\u043b\u0441\u0442\u0430 \u0441\u0446\u0435\u043d\u044b.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u043e\u0437\u044c\u043c\u0435\u043c CopyShader. \u041d\u0430\u0441 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440.<\/p>\n<pre><code class=\"javascript\">var TexturePassExtendShader = { \u00a0 \u00a0 uniforms: \u00a0\u00a0\u00a0 { \u00a0\u00a0\u00a0\u00a0\u00a0 \"tDiffuse\": {value: null}, \u00a0\u00a0\u00a0\u00a0\u00a0 \"opacity\": {value: 1.0}, \u00a0\u00a0\u00a0\u00a0\u00a0 \"scaleX\": {value: 1}, \u00a0\u00a0\u00a0\u00a0\u00a0 \"scaleY\": {value: 1} \u00a0\u00a0\u00a0 }, \u00a0 \u00a0 vertexShader: \u00a0\u00a0\u00a0 [ \u00a0\u00a0 \u00a0\u00a0\u00a0\"uniform float scaleX;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"uniform float scaleY;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"varying vec2 vUv;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"void main() {\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"\u00a0 vUv = uv;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"\u00a0 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"\u00a0 gl_Position.x *= scaleX;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"\u00a0 gl_Position.y *= scaleY;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"}\" \u00a0\u00a0\u00a0 ].join(\"\\n\"), \u00a0 \u00a0 fragmentShader: \u00a0\u00a0\u00a0 [ \u00a0\u00a0\u00a0\u00a0\u00a0 \"uniform sampler2D tDiffuse;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"uniform float opacity;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"varying vec2 vUv;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"void main() {\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"\u00a0 gl_FragColor = texture2D(tDiffuse, vUv);\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"\u00a0 gl_FragColor.a *= opacity;\", \u00a0\u00a0\u00a0\u00a0\u00a0 \"}\" \u00a0\u00a0\u00a0 ].join(\"\\n\") };<\/code><\/pre>\n<p>\u0412 \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u043e\u043c \u0448\u0435\u0439\u0434\u0435\u0440\u0435 \u043c\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b \u043f\u043e \u0448\u0438\u0440\u0438\u043d\u0435 \u0438 \u0432\u044b\u0441\u043e\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 scaleX \u0438 scaleY, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 setRenderSize \u0441 \u0446\u0435\u043b\u044c\u044e \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0439 \u043d\u0430\u0448\u0435\u0439 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043c\u043e\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u043f\u043e\u0434\u0432\u0438\u0433\u043d\u0435\u0442 \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432 GLSL.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/site3d.site\/view-configurator\/1249\/334d56b3b0cef7c55dc333f09f67f3bc\/ru\" rel=\"noopener noreferrer nofollow\">\u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/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\/articles\/744978\/\"> https:\/\/habr.com\/ru\/articles\/744978\/<\/a><br \/><\/br><\/br><\/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-349589","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/349589","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=349589"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/349589\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=349589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=349589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=349589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}