├── Icon_ ├── .arstudio └── project.marker ├── .DS_Store ├── BlurImitation.arproj ├── textures ├── SkinSmoothingTexture.png └── SkinSmoothingTexture(1).png ├── README.md └── scripts └── script.js /Icon_: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.arstudio/project.marker: -------------------------------------------------------------------------------- 1 | document:4883432B-7484-42DB-A723-0072684061BB -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vyarovyi/FastBlurImitation/HEAD/.DS_Store -------------------------------------------------------------------------------- /BlurImitation.arproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vyarovyi/FastBlurImitation/HEAD/BlurImitation.arproj -------------------------------------------------------------------------------- /textures/SkinSmoothingTexture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vyarovyi/FastBlurImitation/HEAD/textures/SkinSmoothingTexture.png -------------------------------------------------------------------------------- /textures/SkinSmoothingTexture(1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vyarovyi/FastBlurImitation/HEAD/textures/SkinSmoothingTexture(1).png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Implementation of Efficient Gaussian blur with linear sampling 2 | 3 | Original GLSL code you can find here: 4 | http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/ 5 | -------------------------------------------------------------------------------- /scripts/script.js: -------------------------------------------------------------------------------- 1 | /* 2 | Implementation of 3 | Efficient Gaussian blur with linear sampling 4 | 5 | Theory and original GLSL code you can find here: 6 | http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/ 7 | */ 8 | 9 | const Materials = require('Materials'); 10 | const Textures = require('Textures'); 11 | const Shaders = require('Shaders'); 12 | const Reactive = require('Reactive'); 13 | const CameraInfo = require('CameraInfo'); 14 | 15 | const camTex = Textures.get('CameraTexture').signal; 16 | const blurMat = Materials.get('blurMat'); 17 | 18 | function texture2D(image, uv){ 19 | return Shaders.composition(image, uv); 20 | }; 21 | 22 | function vec2(value){ 23 | return Reactive.pack2(value, value); 24 | }; 25 | 26 | const offset = [0.0, 1.3846153846, 3.2307692308]; 27 | const weight = [0.2270270270, 0.3162162162, 0.0702702703]; 28 | 29 | function blur(image, resolution, direction) { 30 | const uv = Shaders.functionVec2(); 31 | var color = texture2D(image, uv).mul(weight[0]); 32 | 33 | for (var i=1; i